Project

General

Profile

Actions

Bug #8138

closed
MS RB

Option <spoofmac> is ignored on interfaces without hwaddr

Bug #8138: Option <spoofmac> is ignored on interfaces without hwaddr

Added by Michael Sh. almost 9 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Normal
Category:
Interfaces
Target version:
Start date:
11/27/2017
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.4.x
Affected Architecture:
All

Description

MAC Address in GUI is not applyed to interface and allways set to random value. This causes a lot of problems if interface is LAN.

MS Updated by Michael Sh. over 8 years ago Actions #1

I did this:

                write_config(sprintf(gettext('The invalid MAC address (ff:ff:ff:ff:ff:ff) on interface %1$s has been automatically repla
                file_notice("MAC Address altered", sprintf(gettext('The invalid MAC address (ff:ff:ff:ff:ff:ff) on interface %1$s has be
        } elseif (!empty($wancfg['spoofmac']) && ($wancfg['spoofmac'] != $current_mac)) {   # <--
                mwexec("/sbin/ifconfig " . escapeshellarg($realhwif) .
                                            " link " . escapeshellarg($wancfg['spoofmac']));
        }

        /* media */

SW Updated by Steve Wheeler over 8 years ago Actions #2

Confirmed. MAC spoofing is broken on bridge interfaces and still broken in 2.4.4a. Testing on CE amd64.

Initially:

BRIDGE Interface (opt3, bridge0)

Status
up
MAC Address
02:01:c7:92:dc:00
IPv4 Address
10.215.45.1
Subnet mask IPv4
255.255.255.252
MTU
1500
In/out packets
0/0 (0 B/0 B)
In/out packets (pass)
0/0 (0 B/0 B)
In/out packets (block)
0/0 (0 B/0 B)
In/out errors
0/0
Collisions
0

Apply spoofing, bridge MAC does not change.

After reboot:

BRIDGE Interface (opt3, bridge0)

Status
up
MAC Address
02:f7:23:e6:d0:00
IPv4 Address
10.215.45.1
Subnet mask IPv4
255.255.255.252
MTU
1500
In/out packets
0/0 (0 B/0 B)
In/out packets (pass)
0/0 (0 B/0 B)
In/out packets (block)
0/0 (0 B/0 B)
In/out errors
0/0
Collisions
0

Config:
<opt3>
<descr><![CDATA[Bridge]]></descr>
<if>bridge0</if>
<enable></enable>
<spoofmac>00:80:78:11:22:33</spoofmac>
<ipaddr>10.215.45.1</ipaddr>
<subnet>30</subnet>
</opt3>

JP Updated by Jim Pingle over 8 years ago Actions #3

  • Category set to Interfaces
  • Priority changed from High to Normal
  • Target version set to 2.4.4
  • Affected Version changed from 2.4.2 to 2.4.x
  • Affected Architecture All added
  • Affected Architecture deleted ()

Updated by Anonymous about 8 years ago Actions #4

  • Assignee set to Renato Botelho

Updated by Anonymous about 8 years ago Actions #5

  • Status changed from New to In Progress
  • Assignee changed from Renato Botelho to Anonymous

Updated by Anonymous about 8 years ago Actions #6

  • Status changed from In Progress to New
  • Assignee changed from Anonymous to Renato Botelho

RB Updated by Renato Botelho about 8 years ago Actions #7

  • Status changed from New to 13

RB Updated by Renato Botelho about 8 years ago Actions #8

  • Status changed from 13 to In Progress

RB Updated by Renato Botelho about 8 years ago Actions #9

  • Subject changed from Option <spoofmac> is ignored at least for interface bridge to Option <spoofmac> is ignored on interfaces without hwaddr

Code is not changing any interface that doesn't have `hwaddr` item. I'm working on a fix to save original mac address created by OS when interface is created

RB Updated by Renato Botelho about 8 years ago Actions #10

  • Status changed from In Progress to Feedback

RB Updated by Renato Botelho about 8 years ago Actions #11

  • % Done changed from 0 to 100

Applied in changeset commit:2c1d7c12fa4f41a69d6c9267a34b1b767a1da522.

Updated by Anonymous about 8 years ago Actions #12

  • Status changed from Feedback to Resolved

Tested on a VM with CE:
2.4.4-DEVELOPMENT (amd64)
built on Wed Aug 29 00:38:57 EDT 2018
FreeBSD 11.2-RELEASE-p2

Was able to create a bridge and set a MAC and have it stay.

            [descr] => LAN
                     [if] => bridge0
                    [spoofmac] => aa:aa:aa:aa:aa:aa
                    [enable] =>

bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether aa:aa:aa:aa:aa:aa
    inet6 ::d prefixlen 128 

Setting as resolved.

Actions

Also available in: Atom