not getting a default gateway through dhcp

Discussion in 'Linux Networking' started by Amadeus W. M., Jul 6, 2005.

  1. Ever since I moved to this ISP I've been having network problems, and I
    need a little help.

    They gave me an antique motorolla cable modem, and usually I have a
    linksys router plugged into the router, but right now I have my FC4 pc
    plugged in directly into the modem, to rule out any problems with the
    router.

    For the last couple of days the connection was ok, but this afternoon it
    rained, and, since my ISP's service depends on the weather, the network
    went down. If it rains, it goes down, if it's windy, it goes down, if
    there's lightening, you guessed it, it goes down. It's an ISP from hell.

    Now I've configured eth0 with dhcp. It does get an IP address, but when I
    try to connect anywhere, it says no route to something (I can't check
    exactly what it says right now, because I'm trying to send this).

    I see network activity in gkrellm and I see ARP packets with ethereal,
    so the link is ok. So I look at the routing table, and I see no default
    gateway. But I did see some DHCP packets coming in, so I figured that must
    be the gateway. I do

    route add default gateway xx.xx.xx.xx

    and then voila! I'm online.

    Now that I got this far, I want to pinpoint where the problem is.
    Why am I not getting the default gateway? Is it some bug in my FC4 dhcp
    client, or is my stupid ISP that's not sending it. Is it possible to tell?

    As a matter of fact, I installed the dhcp server on this machine, and my
    other machines as well as the router got all the required info just fine.
    I do want to go out through the router though, and I want it to get all
    the info, as it should. I am positive my hardware is ok, except possibly
    the motorolla cable modem, which is from the ISP.

    Below is the DHCP packet I saw with ethereal. Please someone help, before
    I end up in a mad house.


    No. Time Source Destination Protocol Info
    4693 186.355671 24.35.40.1 255.255.255.255 DHCP DHCP Offer - Transaction ID 0x33d1a0

    Frame 4693 (363 bytes on wire, 363 bytes captured)
    Arrival Time: Jul 5, 2005 19:52:47.244828000
    Time delta from previous packet: 0.120903000 seconds
    Time since reference or first frame: 186.355671000 seconds
    Frame Number: 4693
    Packet Length: 363 bytes
    Capture Length: 363 bytes
    Protocols in frame: eth:ip:udp:bootp
    Ethernet II, Src: 00:50:57:00:99:a6, Dst: ff:ff:ff:ff:ff:ff
    Destination: ff:ff:ff:ff:ff:ff (Broadcast)
    Source: 00:50:57:00:99:a6 (Broadban_00:99:a6)
    Type: IP (0x0800)
    Internet Protocol, Src Addr: 24.35.40.1 (24.35.40.1), Dst Addr: 255.255.255.255
    (255.255.255.255)
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x07 (DSCP 0x01: Unknown DSCP; ECN: 0x03)
    0000 01.. = Differentiated Services Codepoint: Unknown (0x01)
    .... ..1. = ECN-Capable Transport (ECT): 1
    .... ...1 = ECN-CE: 1
    Total Length: 349
    Identification: 0x0000 (0)
    Flags: 0x00
    0... = Reserved bit: Not set
    .0.. = Don't fragment: Not set
    ..0. = More fragments: Not set
    Fragment offset: 0
    Time to live: 16
    Protocol: UDP (0x11)
    Header checksum: 0x6966 (correct)
    Source: 24.35.40.1 (24.35.40.1)
    Destination: 255.255.255.255 (255.255.255.255)
    User Datagram Protocol, Src Port: bootps (67), Dst Port: bootpc (68)
    Source port: bootps (67)
    Destination port: bootpc (68)
    Length: 329
    Checksum: 0x6b77 (correct)
    Bootstrap Protocol
    Message type: Boot Reply (2)
    Hardware type: Ethernet
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x0033d1a0
    Seconds elapsed: 0
    Bootp flags: 0x8000 (Broadcast)
    1... .... .... .... = Broadcast flag: Broadcast
    .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0 (0.0.0.0)
    Your (client) IP address: 24.35.42.93 (24.35.42.93)
    Next server IP address: 0.0.0.0 (0.0.0.0)
    Relay agent IP address: 24.35.40.1 (24.35.40.1)
    Client MAC address: 00:12:17:32:ea:79 (Cisco-Li_32:ea:79)
    Server host name not given
    Boot file name not given
    Magic cookie: (OK)
    Option 53: DHCP Message Type = DHCP Offer
    Option 54: Server Identifier = 24.35.0.42
    Option 51: IP Address Lease Time = 6 days, 23 hours, 59 minutes, 55 seconds
    Option 1: Subnet Mask = 255.255.248.0
    Option 5: Name Server
    IP Address: 24.35.0.12
    IP Address: 24.35.0.13
    Option 23: Default IP Time-to-Live = 64
    Option 27: All Subnets are Local = No
    Option 28: Broadcast Address = 255.255.255.255
    Option 31: Perform Router Discover = Enabled
    Option 35: ARP Cache Timeout = 1 minute
    Option 37: TCP Default TTL = 64
    Option 3: Router = 24.35.40.1
    Option 6: Domain Name Server
    IP Address: 24.35.0.12
    IP Address: 24.35.0.13
    Option 44: NetBIOS over TCP/IP Name Server = 127.0.0.1
    Option 46: NetBIOS over TCP/IP Node Type = H-node
    End Option
     
    Amadeus W. M., Jul 6, 2005
    #1
    1. Advertisements

  2. Amadeus W. M.

    Unruh Guest

    The router will often work by using dhcp to ask for an address and gateway
    for itself, and then deliver and address to you and itself as the gateway
    and do NAT for you.
    Thus when you transfered to direct connection the ISP, that job fell to your system.
    Complain, and complain. There may well be a bad connection somewhere that
    is letting in the rain. Does your TV signal also get degraded when it
    rains? Ie, it is probably not the ISP but rather hardware.



    As you discovered there was no default route. Without a default route,
    things will not work. dhcp usually does deliver a default route. And since
    it did so when you were connected throught the router, it is not the dhcp
    on your system (unless you changed something-- eg the config info in
    /etc/sysconfig/network or something)


    Good. You know what the immediate problem is and how to fix it. That is
    step 1. Look in the log files in /var/log to see if there are other hints.

    So what happens when you go through the router?
     
    Unruh, Jul 6, 2005
    #2
    1. Advertisements

  3. Haven't tried yet, but here's the thing. I configure eth0 using
    system-config-network (yeah, I'm on FC4) to use dhcp, save, then
    stop/start the network. And look at my
    /etc/sysconfig/network-scripts/ifcfg-eth0 file:

    2) root:~> more /etc/sysconfig/network-scripts/ifcfg-eth0
    DEVICE=eth0
    BOOTPROTO=dhcp
    BROADCAST=192.168.1.255
    HWADDR=00:03:6d:13:71:91
    IPADDR=192.168.1.10
    NETMASK=255.255.255.0
    NETWORK=192.168.1.0
    ONBOOT=yes
    TYPE=Ethernet
    DHCP_HOSTNAME=phoenix
    USERCTL=no
    PEERDNS=yes
    GATEWAY=192.168.1.1
    IPV6INIT=no

    Still trying to use the static private IP and gateway from back when I was
    using the router. No, I didn't forget to save the settings. And what's
    curious, is that with this file it's still getting the real address
    from the ISP (thouth no default gateway).

    Yea, during that rain there was a power outage right when I was compiling
    some gnome libraries, and sending out several emails and reading news. I
    have a surge protector which has a battery and it held up pretty well for
    a few minutes, but the power didn't come back until later, so the system
    went down uncleanly. I'm beginning to suspect my filesystem/packages have
    been corrupted, or my ISP's ARP tables have been poisoned, or I've been
    been had. So maybe it's better to reinstall, though I'd be really curious
    to see why the network settings are not saved.
     
    Amadeus W. M., Jul 6, 2005
    #3
  4. Amadeus W. M.

    Unruh Guest

    ???????? Why in the world do you have all that stuff in there? dhcp is for
    getting your IP address. Why are you specifying it? Dhcp should give you
    your gateway, why are you specifying it.
    All you need it the first two lines , onboot, and peerdns
    No wonder your system is getting confused.


    Saved how?
     
    Unruh, Jul 6, 2005
    #4
  5. I didn't put any of that in there manually (i.e. with a text editor). In
    RH/FC, there is this gui for configuring the network
    (system-config-network) which writes out the usual network scripts in
    /etc/sysconfig, based on the user selections. So instead of writing out an
    ifcfg-eth0 with the dhcp settings, it would write out the above
    ifcfg-eth0, no matter what. Probably a gnome thing, due to unclean
    shutdown. I reinstalled and it works now. I wouldn't dare touch the
    settings though.
     
    Amadeus W. M., Jul 7, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.