# Set MAC for network bridge fails

## gaebb3r

Hi together,

I am desperately trying to find out why my Cisco E3200 router doesn't assign the IP address 10.0.0.10 to my network interface via DHCP as bound to the MAC address in the router config.

On my system I have defined a bridge built of eth0 and eth1, see my /etc/conf.d/net:

```
agph ~ # cat /etc/conf.d/net

config_eth0="null"

config_eth1="null"

bridge_br0="eth0 eth1"

mac_br0="00:1B:21:03:37:BD"

modules_br0="ifconfig dhcpcd"

config_br0="dhcp"

dhcpcd_br0="-t 2"

dns_servers_br0="10.0.0.1"

brctl_br0="stp off"

dns_domain="home.net"
```

To check the MAC address that is communicating with the router I took a look into the DHCP log of the router:

```
Tue, 14 May 2013 22:00:47 received REQUEST from 2e:65:c7:7d:d5:d3

Tue, 14 May 2013 22:00:47 sending NAK to 2e:65:c7:7d:d5:d3

Tue, 14 May 2013 22:00:47 received REQUEST from 2e:65:c7:7d:d5:d3

Tue, 14 May 2013 22:00:47 sending NAK to 2e:65:c7:7d:d5:d3

Tue, 14 May 2013 22:00:47 received REQUEST from 2e:65:c7:7d:d5:d3

Tue, 14 May 2013 22:00:47 sending NAK to 2e:65:c7:7d:d5:d3

Tue, 14 May 2013 22:00:47 received REQUEST from 2e:65:c7:7d:d5:d3

Tue, 14 May 2013 22:00:47 sending NAK to 2e:65:c7:7d:d5:d3

Tue, 14 May 2013 22:00:47 received DISCOVER from 2e:65:c7:7d:d5:d3

Tue, 14 May 2013 22:00:48 sending OFFER to 255.255.255.255 with 10.0.0.100

Tue, 14 May 2013 22:00:48 received REQUEST from 2e:65:c7:7d:d5:d3

Tue, 14 May 2013 22:00:48 sending ACK to 10.0.0.100

Tue, 14 May 2013 22:00:55 received DISCOVER from 00:1b:21:03:37:bd

Tue, 14 May 2013 22:00:55 sending OFFER to 255.255.255.255 with 10.0.0.10

Tue, 14 May 2013 22:00:59 received DISCOVER from 00:1b:21:03:37:bd

Tue, 14 May 2013 22:00:59 sending OFFER to 255.255.255.255 with 10.0.0.10

Tue, 14 May 2013 22:01:07 received DISCOVER from 00:1b:21:03:37:bd

Tue, 14 May 2013 22:01:07 sending OFFER to 255.255.255.255 with 10.0.0.10
```

Checking my network specs shows something strange:

```
agph ~ # ifconfig 

br0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500

        inet 10.0.0.100  netmask 255.255.255.0  broadcast 10.0.0.255

        ether 00:1b:21:03:37:bd  txqueuelen 0  (Ethernet)

        RX packets 144320  bytes 312933856 (298.4 MiB)

        RX errors 0  dropped 18  overruns 0  frame 0

        TX packets 98764  bytes 5621292 (5.3 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        ether 00:1c:c0:b1:c7:5b  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

        device interrupt 20  memory 0xd1200000-d1220000  

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 169.254.54.91  netmask 255.255.0.0  broadcast 169.254.255.255

        ether 00:1b:21:03:37:bd  txqueuelen 1000  (Ethernet)

        RX packets 248588  bytes 366444901 (349.4 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 120872  bytes 8643153 (8.2 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

        device interrupt 17  memory 0xd1120000-d1140000
```

First, I need to know why does br0 send a DHCP REQUEST with MAC address 2e:65:c7:7d:d5:d3 (which is being created randomly, restarting net.br0 shows another MAC requesting an address in the router's log)?

The next question is, why does eth1 get a zeroconf address as it is set to "null" in /etc/conf.d/net? Should look like eth0 (where I have no cable connected to)...

Is anybody able to help me out?

Thanks a lot, guys.

----------

## eyoung100

first of all, I would test both ethernet cards by plugging in an ethernet cable to both. 

169.254.x.x is indicative of a hardware failure

Assigning a random bridge MAC ensures no devices will be knocked off the net because eth1 is receiving the 169.address, therefore the bridge cant be set until restarting it...

----------

## lost+found

Hi,

The MAC address of your old lease is used first, unless you delete it manually in /var/lib/dhcpcd (or drop the old lease with a dhcpcd option?).

Because you're connecting to another bridge (the router), it might help to turn "spanning tree protocol" on, and to try different values for forward delay.

(2 lines, to make 2 values work)

```
brctl_br0="setfd 1

stp on"

```

For some reason, putting "setfd" before "stp" works best, to prevent it getting ignored.

```
# man brctl
```

----------

## gaebb3r

Thank you guys,

I have split up the bridge and tested the interfaces separately.

Seems as if eyoung100 is right with the assumption that the card might have gone as eth0 (onboard Intel e1000e) works absolutely fine.

But what is very strange - I don't have any problems with the non-working card on Windows 7... Best to buy a newer one as the PRO/1000 PT is rather old.

Thank you very much.

----------

