Project

General

Profile

Bug #8138

Option <spoofmac> is ignored on interfaces without hwaddr

Added by Michael Sh. 10 months ago. Updated 26 days ago.

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

100%

Estimated time:
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.

Associated revisions

Revision 2c1d7c12 (diff)
Added by Renato Botelho about 1 month ago

Implement #1335:

Let VLANs to have a different MAC address than its parent.

While here also fixes #8138 and do not ignore <spoofmac> for interfaces
without hwaddr field

History

#1 Updated by Michael Sh. 7 months ago

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 */

#2 Updated by Steve Wheeler 6 months ago

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>

#3 Updated by Jim Pingle 3 months ago

  • 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 set to All

#4 Updated by Steve Beaver about 1 month ago

  • Assignee set to Renato Botelho

#5 Updated by Steve Beaver about 1 month ago

  • Status changed from New to In Progress
  • Assignee changed from Renato Botelho to Steve Beaver

#6 Updated by Steve Beaver about 1 month ago

  • Status changed from In Progress to New
  • Assignee changed from Steve Beaver to Renato Botelho

#7 Updated by Renato Botelho about 1 month ago

  • Status changed from New to This Sprint

#8 Updated by Renato Botelho about 1 month ago

  • Status changed from This Sprint to In Progress

#9 Updated by Renato Botelho about 1 month ago

  • 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

#10 Updated by Renato Botelho about 1 month ago

  • Status changed from In Progress to Feedback

#11 Updated by Renato Botelho about 1 month ago

  • % Done changed from 0 to 100

#12 Updated by Stephen Jones 26 days ago

  • 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.

Also available in: Atom PDF