[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Networking Q concerning /etc/network/interfaces

I've made a thorough going mess of this thread by changing the game a
couple of times during the course of it.  Very foolish of me, and a
number of people have put time and effort into trying to help.

Thank you.

I really am sorry for causing the confusion.  My poorly thought out
posts and bad descriptions have caused lots of it.

Now to clear up the confusion and narrow the questions down:

First I didn't start a new thread, since I thought that would be even
more confusing, even though the question has shifted.

The thread  started out with only this question:

  File /etc/network/interfaces showed that eth0 should be getting a
  dhcp served address.

  That fact appeared to be an anomaly since the only interface that
  was actually up and usable (and wired) was eth1.

  eth0 shown in `interfaces'; eth1 in reality.

  Why would that be? That was really the only question.

(I've learned during the course of the thread its because something
else is setting up the network. (NetworkManager).

Then I introduced a whole lot of confusion by musing about how an
interface that is not even wired might get an address.

I'd like now to just flush all that right out of the thread.

Although I did learn quite a lot about how this process works from
your helpful input so you did not waste your time by contributing.

Then I introduced another change... I wired the second nic.. Causing
still more confusion

I see now how they get addresses, thanks to helpful posters.
/etc/network/interfaces is not really consulted. NetworkManager does
the work.

-------        ---------       ---=---       ---------      -------- 
-------        ---------       ---=---       ---------      -------- 

So now to the only questions I still have:

To summarize it:  How best to switch which network adapter is assigned
eth0 and which to eth1.

Now the details:

I want to work on a router wired to my host.  Not to use the
router as a router but to tinker with the software on it (openwrt) and
try to learn the ropes before putting it in service.  I have no
questions about that... just explaining a bit what I'm doing.

I've now tried to setup things accordingly:

I have two nics with ethernet cables attached.  The working lan is
attached to one, and the router project to the other.

When I bootup, both adapters are given dhcp addresses.  One of them,
eth1, is hard coded by means of associating a specific dhcp address to
a specific MAC. That one is what has been in use as this hosts lan IP.

So eth1 is attached to the lan.  That IP is in the hosts files across
the lan.

A dhcp address from the allotted range (100-150) is given to eth0,
attached to the tinker project router.

With that setup:

Any outgoing pings to the actual lan machines from this host, fail.
Apparently because eth0 is automatically seen as the right network
adapter to use... and that adapter is running to the tinker project
mentioned.  Of course I can ping lan machines by using the -I operator
that forces ping to use eth1. 

But that requires manual intervention.

So, OK, I could either redo the lan router config and change which MAC
is assigned or I could switch witch physical wire plugs in where.
Both of those entail some amount of work.

I decided to try a third way; reverse the device names on the host.

However I'm not really sure how to do that so that it persists thru

The way I did do it was to reverse the names in:

In that file there are MAC addresses attached to device names (eth0
eth1) I simply reversed the device names.  So that the MAC that was
associated with eth1 is now associated with eth0 and vice versa.

The end result is that eth0 is now attached to the lan.  Now pings to
lan machines or (any other traffic to/from lan) just works.

I've found the change will persist through a reboot.

Now the actual questions:

Can any anyone tell me if that will survive an upgrade?

Or can anyone tell me if there is a better or canonical way to set
which device name goes with which hardware.


Reply to: