Skip to contentSkip to conversation

If eth0 goes down after a reboot, rules for it will be applied to eth1.

DISCUSSION Erik Enge 4 participants 6 messages Sep 11, 2002 – Sep 12, 2002

lore
Share & tools
lore

Erik Enge

author
#0 lore raw

Hi all.

I have a question about how ethernet cards work. I send it here because I'm thinking that this community probably has dealt with it before, as it seems to me to be an obvious problem (with no apparent solution to me; hence this email).

Let's assume I have a firewall with three NICs. As we know, the ethernet cards under Unix (I'm running Linux 2.4) are assigned eth0/1/2 and so on based on the bus number the BIOS gives them. My setup is as follows:

NIC 1, eth0, DMZ interface [somewhat laid-back firewall rules] NIC 2, eth1, LAN interface [very strict firewall rules] NIC 3, eth2, router interface [basically FORWARDs everything] NIC 4, eth3, external interface [basically FORWARDs everything]

Now, say we take down the firewall for some reason, and upon it coming back up eth0 dies. The bus assigning will then be a bit different, and so will eth0/1/2 and so on (which is what the firewall rules are set against).

This means that I could end up in a situation where my laid-back DMZ rules were applied to my LAN interface and my external interface would still work, because it would take the eth2 which is pretty laid-back. The only thing that wouldn't work (which would trigger me that something was wrong) is that I can't access the DMZ and my router interface. However, if I'm unlucky, some cracker might have enough time to intrude into my, now completely open, LAN interface and its associated network.

So, my question then, is how do you guys deal with this? Is there a way to ensure that the card in slot such-and-such is assigned eth1 every single time, even if the card assigned to eth0 dies? Or is there another and perhaps better solution to all this?

Thanks for any replies,

Erik Enge.

#1 lore raw
Quoted 7 lines · Erik Enge

Let's assume I have a firewall with three NICs.

NIC 1, eth0, DMZ interface [somewhat laid-back firewall rules] NIC 2, eth1, LAN interface [very strict firewall rules] NIC 3, eth2, router interface [basically FORWARDs everything] NIC 4, eth3, external interface [basically FORWARDs everything]

Quoted 8 lines

Now, say we take down the firewall for some reason, and upon it coming back up eth0 dies. The bus assigning will then be a bit different, and so will eth0/1/2 and so on (which is what the firewall rules are set against).

This means that I could end up in a situation where my laid-back DMZ rules were applied to my LAN interface and my external interface would still work, because it would take the eth2 which is pretty laid-back.

You're talking about your netfilter rules here (and you're right), but you haven't considered what happens to the IP addresses....

The IP address which was supposed to be on the 'real' eth0, which has just died, gets applied to what you think is eth1 (even though your computer has just decided to rename it eth0 as the first working ethernet card it found).

It is almost inconceivable that the interface connecting you to the outside world will deign to communicate with your router (or whatever else is the next hop upstream of you) because the IP address, network address, default gateway, netmask etc don't match.

Only if you physically plug the new eth0 (old eth1) into whatever the dead eth0 used to connect to will the new eth0 actually communicate with anything, and of course if you do that to each interface so that it talks, you've got your old configuration back again (minus one dead interface).

So, basically I don't think there's anything to worry about.

Antony.

Signature · 3 lines
Most people are aware that the Universe is big.

 - Paul Davies, Professor of Theoretical Physics
#2 lore raw
In reply to Erik Enge

I reboot. seems to me dells are notorious for losing a nic. in my case i can usually go out, but nothing gets in.

On 11 Sep 2002 09:42:15 -0400
Erik Enge <[email protected]> spewed into the bitstream:

~Hi all.
~
~I have a question about how ethernet cards work. I send it here ~because I'm thinking that this community probably has dealt with it ~before, as it seems to me to be an obvious problem (with no apparent ~solution to me; hence this email).

Signature · 4 lines
Michael H. Collins 		Admiral, Penguinista Navy      (o_
http://www.mdrconsult.com	http://www.lrsehosting.com/    //\
http://kpig.com			http://rawdeal.org             V_/_ 
http://www.redhat.com/opensourcenow/ 
#3 lore raw
In reply to Erik Enge

Erik:

I dont know if this does exactly what you want, but have you tried putting a

HWADDR=xx:xx:xx:xx:xx:xx

line into each /etc/sysconfig/network-scripts/ifcfg-ethx
This should tie ethx to the specified mac address. Remember to update if you change hardware.

Regards,

gene/

Quoted 11 lines · Erik Enge

Hi all.

I have a question about how ethernet cards work. I send it here because I'm thinking that this community probably has dealt with it before, as it seems to me to be an obvious problem (with no apparent solution to me; hence this email).

#4 lore raw
Quoted 10 lines · Lists

Erik:

I dont know if this does exactly what you want, but have you tried putting a

HWADDR=xx:xx:xx:xx:xx:xx

line into each /etc/sysconfig/network-scripts/ifcfg-ethx This should tie ethx to the specified mac address. Remember to update if you change hardware.

Sorry, what does this do ? This looks specific to some distribution to me
(and not one that I use) so it would be nice to know what happens to that information and how it gets integrated with netfilter rules ?

Antony.

Signature · 2 lines
Abandon hope, all ye who enter here.
You'll feel much better about things once you do.
#5 lore raw

Yes sorry you're right - this is redhat specific - I believe it is consumed by ifup which confirms the mac address matches before it actually ifup's the interface.Notrhing to do with netfilter really ...

Quoted 11 lines · Antony Stone
Quoted 1 line · Lists

..

Sorry, what does this do ? This looks specific to some distribution to me
(and not one that I use) so it would be nice to know what happens to that information and how it gets integrated with netfilter rules ?

Antony.