Results 1 to 7 of 7

Thread: 1 NIC, 1 Router, and an out of range IP address

  1. #1

    1 NIC, 1 Router, and an out of range IP address

    Hi, I'm running Mandrake 9.2. Recently I had the bright idea to give my machine a static address on my local network so I could set up an nfs. However, when I try to set a static IP address, my internet connection fails, meanwhile the router and other machines on the network maintain their connections. When I have my machine set to get an address via DHCP it works fine, although it is getting an IP which is out of the range set on my DHCP server (which is running on a router). I've posted the output from route -n below as well as the ifcfg-eth0 file for my non-functional setup. As a note, When things are set to grab an address from DHCP, it gives me an address of 192.168.102.101 (everywhere I have looked things are set with the same subnet mask as below, so I don't know why it doesn't give me a 192.168.0.x). To sum up this rambling question, how do I get my computer to keep a static IP address, and still connect to the internet? Are there some config files, somewhere that I am missing? Could I be running two DHCP servers and not know it?

    ******Non Functional Routing Table************

    Kernel IP routing table
    Destination >> Gateway >> Genmask >> Flags >> Use Iface
    192.168.0.0 >> 0.0.0.0 >> 255.255.255.0 > U >> 0 eth0
    127.0.0.0 >> 0.0.0.0 >> 255.0.0.0 >> U >> 0 lo
    0.0.0.0 >> 192.168.0.1 >> 0.0.0.0 >> UG >> 0 eth0

    ********* Non-Functional ifcfg-eth0 **************

    DEVICE=eth0
    BOOTPROTO=static
    IPADDR=192.168.0.101
    NETMASK=255.255.255.0
    NETWORK=192.168.0.0
    BROADCAST=192.168.0.255
    GATEWAY=192.168.0.1
    ONBOOT=yes

    ********** physical setup **********

    cable -> router (running dhcpd) -> Mandrake 9.2 machine (trying to keep static IP)

  2. #2
    Administrator Moderator
    Member
    starfish's Avatar
    Join Date
    Apr 2004
    Posts
    141
    I think the problem is that you have set you static IP address to be on a network range that doesn't match that of the range assigned to your default router (the DHCP router)

    You probably need to set the NIC to be in the range 192.168.102.2 through 192.168.102.254.

    A couple questions:
    What is the DHCP range set on the router?
    What is the actual IP address of the router on the home network.
    What is the output of the ifconfig -a command when the NIC is set to DHCP?
    What is the output of the netstat -nr command when the NIC is set to DHCP?


    We should be able to figure it out once you have that info.

  3. #3
    Thank you very much for your help with this, I really do appreciate it. The IP address of the router is 192.168.0.1. It serves out an IP range of 192.168.0.10 - 192.168.0.199 (I don't know why I set it that way, but I don't think there's any harm in it). In the morning I will try to set the machine for a static address in the 192.168.102.x range and see if that helps, and let you know. I am confused about the output below. I see that the IFconfig says eth0 has an IP of 192.168.102.101, but netstat is showing something different. Is this normal? I see that it doesn't match the same pattern as the output from the static information...but I don't know.

    ************ ifconfig with DHCP *************

    eth0 Link encap:Ethernet HWaddr 00:08:A1:583:89
    inet addr:192.168.102.101 Bcast:192.168.102.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:7768 errors:0 dropped:0 overruns:0 frame:0
    TX packets:8747 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0
    RX bytes:3005142 (2.8 Mb) TX bytes:974542 (951.7 Kb)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:2170 errors:0 dropped:0 overruns:0 frame:0
    TX packets:2170 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0
    RX bytes:2648549 (2.5 Mb) TX bytes:2648549 (2.5 Mb)


    ********** netstat with DHCP set ************

    Kernel IP routing table
    Destination >> Gateway >> Genmask >> Flags > irtt > Iface
    192.168.102.0 >> 0.0.0.0 >> 255.255.255.0 >> U > 0 > eth0
    127.0.0.0 >> 0.0.0.0 >> 255.0.0.0 >> U > 0 > lo
    0.0.0.0 >> 192.168.102.1 >> 0.0.0.0 >> UG > 0 > eth0

  4. #4
    Setting the IP for 192.168.102.101 didn't work either.

    One of the things I tried was to change the range of IP addresses that the router will accept to 192.168.0.0 to 192.168.0.100 to avoid a conflict with the IP I am trying to set.

    Is it possible that there is a config file somewhere that sets the acceptable IP range of the LAN? Although, having said that - everything with this setup seems Kosher router ranges, network masks, eth0 configs. The only trouble is that the IP address I want eth0 to have will not let the machine connect the the internet or LAN. What could be stopping it from connecting?

    Another idea that I have is, the connection stops when I set the eth0 configs to statically keep the same IP address that I get from the DHCP server. That doesn't make sense to me, unless the IP address has nothing to do with the fact that my macchine won't connect when it is set to get a static address.

    This machine was previously set to connect directly to a cable connection, via the cable companies router. Could these old settings be effecting my connection? If so, how would I change them?

  5. #5
    Administrator Moderator
    Member
    starfish's Avatar
    Join Date
    Apr 2004
    Posts
    141
    There is something definitely wrong.

    Something on your network (which doesn't appear to be your router) is issuing IPs in the 1928.16.102.x range.

    Is there wireless involved anywhere? For example a WAP connected to the router that may also be acting as a DHCP server. Or maybe your WAP peering with some other router, possibly a neighbors, that is a DHCP server in that range?

    Double check to make sure the router really isn't the 192.168.102.x culprit.

    The routing table shows 192.168.102.1 as the default gateway. Is that the IP address of your router?

    From what I see, you'll have to set your IP address to something in the 192.168.102.x range and then set your default gateway to 192.168.102.1. Here is a link on how to do that. http://www.linuxhomenetworking.com/l...work-linux.htm

    You seem to be either mistaken about the router, or there is something else on the network that is providing access to the Net.

  6. #6
    Yee Haww! It works! I have an IP phone from Vonage with a motorola router that must have been providing the IP address. When I unplugged it and let eth0 negotiate its address via DHCP, the pesky 102 went away and the machine got an IP address that was in the range I would have expected, ie. 192.168.0.x. I was able to set the dumb static address and get connected to the net and LAN.


    I had completely forgotten about that phone router. Although I am a bit surprised that it was running its own DHCP server (at least that's what I am assuming).


    Thank you very much for your help. Once the nfs is up and running, I'm going to name it after you.

  7. #7
    Administrator Moderator
    Member
    starfish's Avatar
    Join Date
    Apr 2004
    Posts
    141
    That's good to hear. Rememebr to set the IP address outside of the 192.168.0.10 - 192.168.0.199 range so that you don't get a conflict at some stage later with two devices on your network with the same IP. (One static and the other DHCP)

    I originally saw this problem with a friend of mine who had a laptop with both a wireless card and a regular ethernet NIC. It caused all sorts of problems.

    Congrats.

Similar Threads

  1. Router MAC address changing?
    By DavidMcCann in forum Linux - Hardware, Networking & Security
    Replies: 6
    Last Post: 03-25-2008, 09:40 PM
  2. Bad ip address
    By saswata in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 08-27-2007, 05:26 AM
  3. Range of a double integer in C++
    By tech291083 in forum Redhat / Fedora
    Replies: 4
    Last Post: 04-28-2007, 07:22 AM
  4. How to Achive IP address through MAC(Ethernet) address
    By krishnacins in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 10-03-2005, 02:17 PM
  5. ip address on rh7.2
    By elovkoff in forum Linux - General Topics
    Replies: 9
    Last Post: 02-27-2002, 02:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •