FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 07-27-2010, 06:20 PM
Sthu Deus
 
Default Assigning to new NICs the previous interface names.

Good day.


How I can make best way the following:

having 2 NICs in an OS (called eth0 and eth1, having iptables rules
set accordingly) and exchanging one or two of them with (an)other(s)
NIC(s), to make it be again (called eth0 and eth1, having iptables rules
set accordingly) automatically.

?

For now I have to clear up udev rules net file so that it will be
filled w/ eth0 and 1 instead of 2 and 3.
Then I have to review which one is set for one network, and
another - for another network - according to interfaces file.


Thank You for Your time.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4c4f2387.0b07650a.3bb5.ffffe79e@mx.google.com">htt p://lists.debian.org/4c4f2387.0b07650a.3bb5.ffffe79e@mx.google.com
 
Old 07-27-2010, 06:55 PM
Camaleón
 
Default Assigning to new NICs the previous interface names.

On Wed, 28 Jul 2010 01:20:46 +0700, Sthu Deus wrote:

> How I can make best way the following:
>
> having 2 NICs in an OS (called eth0 and eth1, having iptables rules set
> accordingly) and exchanging one or two of them with (an)other(s) NIC(s),
> to make it be again (called eth0 and eth1, having iptables rules set
> accordingly) automatically.

(...)

Just guessing, but... how about changing/adjusting their udev names
matching their MAC address?

/etc/udev/rules.d/70-persistent-net.rules

Once/if that file gets modified, take care for the rest of the involved
files (/etc/networking/interfaces) are pointing to the right devices.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2010.07.27.18.55.08@gmail.com">http://lists.debian.org/pan.2010.07.27.18.55.08@gmail.com
 
Old 07-29-2010, 07:06 AM
Sthu Deus
 
Default Assigning to new NICs the previous interface names.

Thank You for Your time and answer, Camaleón:

> Just guessing, but... how about changing/adjusting their udev names
> matching their MAC address?

In my view it is impossible (though correct me if I'm wrong here): I do
not know the MACs of the new NICs that will be installed as a
replacement for the existing ones.

> /etc/udev/rules.d/70-persistent-net.rules
>
> Once/if that file gets modified, take care for the rest of the
> involved files (/etc/networking/interfaces) are pointing to the right
> devices.

Is possible to be done somehow automatically (by the tools available
for Debian and not writing my own scripts)?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4c51323d.487e0e0a.32a6.12d3@mx.google.com">http://lists.debian.org/4c51323d.487e0e0a.32a6.12d3@mx.google.com
 
Old 07-29-2010, 08:13 AM
Camaleón
 
Default Assigning to new NICs the previous interface names.

On Thu, 29 Jul 2010 14:06:24 +0700, Sthu Deus wrote:

> Thank You for Your time and answer, Camaleón:
>
>> Just guessing, but... how about changing/adjusting their udev names
>> matching their MAC address?
>
> In my view it is impossible (though correct me if I'm wrong here): I do
> not know the MACs of the new NICs that will be installed as a
> replacement for the existing ones.

I'm not following you here. You can:

1/ Write the rules _after_ plug-in the cards: they will get detected as
eth2 and eth3 then you only have to adjust the udev rules.

2/ Write the rules _before_ plug-in the cards: you can edit the udev
rules and create new ones by reading the MAC address of the adapters
which is printed (or "sticked") on the card.

Udev rules for network adapters are used to have persistent names for
uniquely identifying eth0, eth1, eth2, eth(n) with a physical device...
in the same manner that udev handles hard disks.

So, if your goal is to replace the current ethernet cards with a newer
ones and keep the iptables rules to match the older ("eth0", "eth1")
names -which will be pointing to the legacy/removed devices-, you just
need to update the rules so that the new adapters get the older names. I
know, it sounds a bit messy.

>> /etc/udev/rules.d/70-persistent-net.rules
>>
>> Once/if that file gets modified, take care for the rest of the involved
>> files (/etc/networking/interfaces) are pointing to the right devices.
>
> Is possible to be done somehow automatically (by the tools available for
> Debian and not writing my own scripts)?

Unless I'm wrong, I see no objection to edit "70-persistent-net.rules"
directly. Dunno if there is another "Debian-way" (manual or automatic)
for this :-?

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2010.07.29.08.13.26@gmail.com">http://lists.debian.org/pan.2010.07.29.08.13.26@gmail.com
 
Old 07-29-2010, 12:42 PM
Stephen Powell
 
Default Assigning to new NICs the previous interface names.

On Thu, 29 Jul 2010 03:06:24 -0400 (EDT), Sthu Deus wrote:
>
> Is possible to be done somehow automatically (by the tools available
> for Debian and not writing my own scripts)?

I haven't been following this thread; so I don't know what specific
problem you are trying to solve. But for me, the most common case
is that I have one network card which I need to replace and I want
it to have the interface name eth0, just like the original one. There
are no other network cards in the machine.

For that specific case, the easist solution is to simply erase (rm)
the /etc/udev/rules.d/70-persistent-net.rules file. Then shutdown,
swap network cards, and boot up. During boot, a new
/etc/udev/rules.d/70-persistent-net.rules file will be created, and
it will list the MAC address of the new card and assign it to eth0.

For machines with two network cards, it's not much more difficult.
Let's say that card1 is assigned to eth0 and card2 is assigned to
eth1. You want to replace one of them. Edit the file
/etc/udev/rules.d/70-persistent-net.rules and delete the line(s)
which describe the card you want to replace. Then shutdown,
swap cards, and boot up. During boot, a new line will be added to
/etc/udev/rules.d/70-persistent-net.rules which describes the new card,
and it will be assigned to the interface that was deleted. Make a
backup copy of the file somewhere else before editing or deleting it,
just in case, but the procedure I described will probably work just fine.

--
.'`. Stephen Powell
: :' :
`. `'`
`-


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1083967198.30806.1280407377733.JavaMail.root@md01. wow.synacor.com">http://lists.debian.org/1083967198.30806.1280407377733.JavaMail.root@md01. wow.synacor.com
 
Old 07-29-2010, 05:39 PM
Sthu Deus
 
Default Assigning to new NICs the previous interface names.

Thank You for Your time and answer, Stephen:

> Edit the file
> /etc/udev/rules.d/70-persistent-net.rules and delete the line(s)
> which describe the card you want to replace.

That's all true. Is there a technique where this can be done
automatically? Say, there is a man that knows how to operate w/ the
hardware stuff but has little experience w/ linux, it could be
wonderful for him (and others) that he could just his this job while
the technique will do the rest.

I can write a script that will be checking for ethN where N>1 and to
auto edit the udev net-persistent file, then rerun network service, but
may there is a ready tool, also, may it takes care of which one of the
NICs should be eth1 or 0 - for the diver nets (so that iptables will
be happy).


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4c51bce8.020cd80a.653b.28d9@mx.google.com">http://lists.debian.org/4c51bce8.020cd80a.653b.28d9@mx.google.com
 

Thread Tools




All times are GMT. The time now is 09:42 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org