|
||||||||
|
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|
Hello.
I have a requirement, wherein I have two NICs on a single host. One of the NIC would be in a standby state. The idea is to provide hotstandby, in case the first NIC fails the second NIC takes over. Both the NICs are configured for DHCP IP and as far as I know, the DHCP Server binds the IP with the MAC Address provided. In my case I need to get the same IP for both the NICs despite them having different MAC Addresses, basically because the host is the same and much of the host configuration is tied up with the IP. I checkced the DHCP server man pages, it states the IP can also be bound to a "Client Identifier". So, to make sure I get the same IP both these NICs, should I set the "client Id" like a host name and send the DHCP Discover message? Please advice if there is some kind of configuration needs to be done on the server side too? Thanks Ramesh Ramesh |
|
#2
|
|||
|
|||
|
On Feb 14, 4:40*pm, Ramesh <rrame...@gmail.com> wrote:
> In my case I need to get the same IP for both the NICs despite them > having different MAC Addresses, basically because the host is the same > and much of the host configuration is tied up with the IP. *I checkced > the DHCP server man pages, it states the IP can also be bound to a > "Client Identifier". I did it one time in a very messy way... It was something like this: host first { hardware ethernet 00:00:00:00:00:01; fixed-addres 192.168.0.10; } host second { hardware ethernet 00:00:00:00:00:10; fixed-address 192.168.0.10; } So, we got some cons: this configuration doesn't work with DDNS updates. I think (didn't test it) that you may make a bridge between the two interfaces and use 2 switch ports: brctl addbr br0 brctl addif br0 eth0 brctl addif br0 eth1 ip addr add 0.0.0.0 dev eth0 ip addr add 0.0.0.0 dev eth1 ip link set dev eth0 up ip link set dev eth1 up ip link ser dev br0 up ip addr add 192.168.0.10 dev br0 This also is a very very messy way, but is a way... Use you imagination and create a new one... |
|
#3
|
|||
|
|||
|
Hello,
(E-Mail Removed) a écrit : > > I think (didn't test it) that you may make a bridge between the two > interfaces and use 2 switch ports: Don't forget to enable STP (spanning tree) on the bridge and the switch, else you create a loop. Also, a bridge changes the MAC address of some of its interfaces : usually the bridge takes the MAC address of the first interface and duplicates it on the other interfaces. So you could just duplicate the MAC address of one interface to the other. Another approach may be to use bonding with the ifenslave utility ; some bonding modes such as active-backup (mode 1) are fault tolerant. However some modes may require support by the switch. |
|
#4
|
|||
|
|||
|
On Feb 15, 8:52*pm, Pascal Hambourg <boite-a-s...@plouf.fr.eu.org>
wrote: > Don't forget to enable STP (spanning tree) on the bridge and the switch, > else you create a loop. Also, a bridge changes the MAC address of some > of its interfaces : usually the bridge takes the MAC address of the > first interface and duplicates it on the other interfaces. So you could > just duplicate the MAC address of one interface to the other. I didn't say it cause STP is enabled by default. And you are right, the bridge MAC Address will be the one on the first interface added to it. |
|
#5
|
|||
|
|||
|
(E-Mail Removed) a écrit :
> > I didn't say it cause STP is enabled by default. Here STP appears to be disabled by default : # brctl addbr br0 # brctl show bridge name bridge id STP enabled interfaces br0 8000.000000000000 no Debian 3.1 (sarge) with kernel 2.4.33 and bridge-utils 1.0.4. Maybe it has changed in more recent kernel and/or bridge-utils versions. |
|
#6
|
|||
|
|||
|
On Feb 16, 3:40*pm, Pascal Hambourg <boite-a-s...@plouf.fr.eu.org>
wrote: > Here STP appears to be disabled by default : root@alderan:~# brctl show bridge name bridge id STP enabled interfaces br0 8000.00022ab2fc18 yes eth0 ath0 At my set it is enabled... Slackware 11.0 kernel 2.4.33.3 It's just a little issue... Everyone else, remember, just for precaution: # brctl stp br0 yes |
|
#7
|
|||
|
|||
|
On 15 Feb, 22:52, Pascal Hambourg <boite-a-s...@plouf.fr.eu.org>
wrote: > Another approach may be to use bonding with the ifenslave utility ; some > bonding modes such as active-backup (mode 1) are fault tolerant. However > some modes may require support by the switch. This is what I did. It works fine with two independant switches. The files I edited on Debian Etch to do this are: apt-get install ifenslave vi /etc/modprobe.d/arch/i386 add .... alias bond0 bonding alias bond1 bonding options bonding mode=1 miimon=100 downdelay=200 updelay=200 max_bonds=3 .... vi /etc/network/interfaces add .... # create one virtual IF from two ethernet IFs auto bond0 iface bond0 inet static pre-up modprobe bond0 hwaddress ether 00:11:22:33:44:55 address 192.168.0.2 netmask 255.255.255.0 up ifenslave bond0 eth1 eth2 down ifenslave -d bond0 eth1 eth2 # .... |
![]() |
| Tags |
| address, addresses, binding, mac, single |
| Thread Tools | |
| Display Modes | |
|
|