On an embedded system we send an IP address via the kernel command line. This IP address is arbitrary and is there to set a default IP address. These command line parameters are:
Code:
ip=192.168.0.100:192.168.0.0::255.255.255.0::eth0:yes
We use an interfaces file that is called by ifup/down. The interfaces file has the following:
Code:
# Configure Loopback
auto lo eth0
iface lo inet loopback
# DHCP on the first ethernet device
#iface eth0 inet dhcp
iface eth1 inet dhcp
# Static interface for the first ethernet interface, comment out the
# above and uncomment this
iface eth0 inet static
address 10.120.6.97
netmask 255.255.252.0
network 10.120.4.0
gateway 10.120.4.1
Now, here is a shot of ifconfig eth0
Code:
eth0 Link encap:Ethernet HWaddr 00:60:0C:01:A8:89
inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:400 errors:0 dropped:0 overruns:0 frame:0
TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39171 (38.2 KiB) TX bytes:4074 (3.9 KiB)
Interrupt:194 Base address:0x8300 DMA chan:8
Here is a shot of route -n:
Code:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.120.4.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 10.120.4.1 0.0.0.0 UG 0 0 0 eth0
You may note that BOTH the command line parameter and the interfaces file are used on this network adapter. The really odd thing is that I can ping the device from EITHER network (on my development station I set an IP alias of 192.168.0.50 and I could ping, telnet, and do whatever I wanted with that IP address.
So, my question is WHAT IS GOING ON HERE???? I have searched the /sys and /proc directories attempting to find the stale information about the IP addresses and can find nothing. I find what I think is the MAC address under /sys but cannot locate anything else.
My goal is to make it so the interfaces file trumps the command line settings but I don't even understand why/how this is doing this. I didn't even know it was possible to bind two IP addresses to the same interface (not an alias, the SAME interface).
Any ideas?