Project

General

Profile

Actions

Bug #8138

closed

Option <spoofmac> is ignored on interfaces without hwaddr

Added by Michael Sh. over 6 years ago. Updated over 5 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.

Actions #1

Updated by Michael Sh. about 6 years 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 */

Actions #2

Updated by Steve Wheeler about 6 years 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>

Actions #3

Updated by Jim Pingle almost 6 years 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 All added
  • Affected Architecture deleted ()
Actions #4

Updated by Anonymous over 5 years ago

  • Assignee set to Renato Botelho
Actions #5

Updated by Anonymous over 5 years ago

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

Updated by Anonymous over 5 years ago

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

Updated by Renato Botelho over 5 years ago

  • Status changed from New to 13
Actions #8

Updated by Renato Botelho over 5 years ago

  • Status changed from 13 to In Progress
Actions #9

Updated by Renato Botelho over 5 years 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

Actions #10

Updated by Renato Botelho over 5 years ago

  • Status changed from In Progress to Feedback
Actions #11

Updated by Renato Botelho over 5 years ago

  • % Done changed from 0 to 100
Actions #12

Updated by Anonymous over 5 years 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.

Actions

Also available in: Atom PDF