[Nottingham] NIC MACs aliases & IP aliases

Martin martin at ml1.co.uk
Fri May 8 17:30:45 UTC 2009


Martin wrote:
[---]
> One 'trick' that looks to be good is to use the kernel TUN/TAP and 
> bridging modules to set up:
> 
> 
> tap0 ---|
>          |
>          br0 --- eth0
>          |
> tap1 ---|
> 
> 
> so that eth0 just looks/behaves like the port on a network switch 
> connected to two (virtual) physical devices tap0 and tap1 (and as many 
> others as you wish). Looks ideal for fail-over and whatever else...
> 
> 
> So... Will it work and how do you set it up?
> 
> I'm guessing:
> 
> tunctl -t tap0 (to create tap0 with unique MAC)
> tunctl -t tap1 (to create tap1 with unique MAC)
> 
> brctl addbr br0
> brctl addif br0 eth0
> brctl addif br0 tap0
> brctl addif br0 tap1
> brctl stp br0 off
> 
> ...and then ifup them with an IP address and add routing.

Tried that so that I can have multiple MACs behind one physical NIC to a 
network and...

The ARP doesn't work :-(

I get an IP address and unique MACs on the tap0 and tap1, and "brctl 
showmacs br0" lists the MACs for eth0, tap0 and tap1 as expected. I can 
set the routing. I can ping tap0 and tap1 ok from the localhost. But no 
packets get out onto the physical network, and "arp -vne" shows no 
entries or at most, my network gateway machine as 'incomplete'.

What else is needed?


ifconfig gives:

eth0      Link encap:Ethernet  HWaddr 00:00:5A:00:02:9F 

           UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1 

           RX packets:33199103 errors:0 dropped:2 overruns:0 frame:0 

           TX packets:25258904 errors:0 dropped:0 overruns:0 carrier:0 

           collisions:0 txqueuelen:1000 

           RX bytes:27442009127 (25.5 GiB)  TX bytes:44505153117 (41.4 
GiB)
           Interrupt:16 


lo        Link encap:Local Loopback
           inet addr:127.0.0.1  Mask:255.0.0.0
           UP LOOPBACK RUNNING  MTU:16436  Metric:1
           RX packets:3962479 errors:0 dropped:0 overruns:0 frame:0
           TX packets:3962479 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:0
           RX bytes:861292210 (821.3 MiB)  TX bytes:861292210 (821.3 MiB)

tap0      Link encap:Ethernet  HWaddr A2:EF:EF:BD:3A:21
           inet addr:192.168.128.127  Bcast:192.168.128.255 
Mask:255.255.255.0
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 

           RX packets:0 errors:0 dropped:0 overruns:0 frame:0 

           TX packets:0 errors:0 dropped:1310 overruns:0 carrier:0 

           collisions:0 txqueuelen:500 

           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b) 


tap1      Link encap:Ethernet  HWaddr EE:8D:73:DF:B5:AB
           inet addr:192.168.128.126  Bcast:192.168.128.255 
Mask:255.255.255.0
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 

           RX packets:0 errors:0 dropped:0 overruns:0 frame:0 

           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 

           collisions:0 txqueuelen:500 

           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b) 




Any ideas?

Cheers,
Martin


-- 
----------------
Martin Lomas
martin at ml1.co.uk
----------------



More information about the Nottingham mailing list