Strange Linux Networking issue:

This is a discussion on Strange Linux Networking issue: within the Tech Board forums, part of the Community Boards category; On an embedded system we send an IP address via the kernel command line. This IP address is arbitrary and ...

  1. #1
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065

    Strange Linux Networking issue:

    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?

  2. #2
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    I still don't know what the deal is (this seems completely against the kernel binding protocols) but I am able to remove the unwanted IP address without dropping the whole connection. I found that I can execute the command:

    ip address del 192.168.0.100 dev eth0

    and I'll instantly only have 10.120.6.97 as the network address.

    How funky is that!

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    20
    Can you ping both networks from the same device at the same time? That would be odd.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Port app from Windows to Linux
    By BobS0327 in forum Linux Programming
    Replies: 12
    Last Post: 02-12-2006, 01:35 AM
  2. Is Linux Really A Programmers OS?
    By SourceCode in forum A Brief History of Cprogramming.com
    Replies: 43
    Last Post: 04-07-2003, 09:24 PM
  3. linux wont boot
    By GanglyLamb in forum Tech Board
    Replies: 4
    Last Post: 02-13-2003, 03:04 PM
  4. Linux? Windows Xp?
    By VooDoo in forum Linux Programming
    Replies: 15
    Last Post: 07-31-2002, 08:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21