Re: Networking Q concerning /etc/network/interfaces
On Sat 11 Feb 2012 at 17:29:25 -0500, Harry Putnam wrote:
> A little more to the story is that the address shown in ifconfig -a
> for eth0 (192.168.1.54) is ping-able from around the network.
> There is only 1 ethernet wire connected to the machine and no
> wireless, so both addresses must be on the remaining nic. (eth1)
That's not ok. The conclusion is incorrect.
> (The subject host is localhost)
> from host b (a physical machine on the lan) I can ping the above
> address (...54) or ssh to it, and arrive on localhost.
> Ditto for the actual real address (...42).
> and hostname -i shows:
> 127.0.1.1 192.168.1.42
hostname(1) advises against using the -i option. Not that it matters too
much, but is 192.168.1.42 in your /etc/hosts?
> So, it seems there is no way around thinking both addresses are on a
> single nic since there is only one ethernet wire attached to
As above; erroneous. Find out about MAC addresses and ARP. They are
basic to communication on an ethernet network and will help you see a
way round your thinking.
When pinging, host b sends an ARP broadcast to all machines asking: 'any
of you out there know about the IP address 192.168.1.54?' eth1 is aware
192.168.1.54 isn't its address but, being conscientious, asks about on
the machine it lives on. eth0 says: 'hey that's me!'. eth1 then tells
host b: 'I've found what you are looking for, 192.168.1.54's traffic can
be sent to 192.168.1.42 first.'
Two addresses on two interfaces. ifconfig says as much too.