Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Dynamic IP head scratcher

  • 06-07-2009 1:37pm
    #1
    Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭


    I have an Ubuntu server set up with two network cards.

    One is assigned a static IP, one is DHCP.

    When I connect the cards to our internal network, the NIC assigned a dynamic address picks up and IP address without problem (from our internal DHCP server).

    When I connect the same card to the outside world, and it looks for an IP address via our ISP, it doesn't get assigned an address. I take the cable from the back of the Linux machine and plug it straight into a Windows machine, the NIC on the Windows machine picks up an IP address from our ISP DHCP host without problem.

    So I think it's fairly clear that the problem is on the Linux end.

    I've added the ISP DNS to /etc/resolv.conf but that hasn't worked.

    Any ideas what I am doing wrong?


Comments

  • Closed Accounts Posts: 4,564 ✭✭✭Naikon


    Tom Dunne wrote: »
    I have an Ubuntu server set up with two network cards.

    One is assigned a static IP, one is DHCP.

    When I connect the cards to our internal network, the NIC assigned a dynamic address picks up and IP address without problem (from our internal DHCP server).

    When I connect the same card to the outside world, and it looks for an IP address via our ISP, it doesn't get assigned an address. I take the cable from the back of the Linux machine and plug it straight into a Windows machine, the NIC on the Windows machine picks up an IP address from our ISP DHCP host without problem.

    So I think it's fairly clear that the problem is on the Linux end.

    I've added the ISP DNS to /etc/resolv.conf but that hasn't worked.

    Any ideas what I am doing wrong?

    Assuming you have dhclient intalled on your box, plug
    the cable from the cable modem to the interface you
    want to use as a default gateway for the internal hosts.

    Now, try run dhclient -r to release the current stale lease(if any)
    Then, as root/sudo run dhclient to obtain a new lease.
    Look at the output and look for any anomalies.

    It should usually make broadcast requests to 255.255.255.255
    which basically means pass the request to every networks broadcast address.
    This could potentially cause problems if not set correctly.

    Now restart your network interfaces with:
    /etc/init.d/networking restart

    Try the above before we move onto other solutions:)


  • Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭Tom Dunne


    Right, when I do the dhclient -r it says that it is releasing eth0 (which is the correct network card) on 192.168.X.X port 67, which is my internal DCHP server. It also says network unreachable, consult README for details on setting the broadcast address.

    So that doesn't look right, does it?

    When I then do the dhclient command, it does the request on 255.255.255.255, port 67 as expected, but does not get a lease/IP address.

    Then when I do the /etc/init.d/networks restart, I get the exact same as above.


  • Closed Accounts Posts: 4,564 ✭✭✭Naikon


    Can you please post up the results of these commands?

    #ifconfig eth0
    #netstat -r
    #cat /etc/dhclient.conf

    Can you ping the cable modem/upstream connection from the ubuntu pc?


  • Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭Tom Dunne


    Naikon wrote: »
    Can you please post up the results of these commands?

    #ifconfig eth0

    eth0 Link encap:Ethernet HWaddr 00:0d:56:b9:66:1f
    inet6 addr: fe80::20d:56ff:feb9:661f/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:9834 (9.8 KB)
    Interrupt:28
    Naikon wrote: »
    #netstat -r

    Hmm, methinks this might be the problem:

    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window irtt Iface
    Naikon wrote: »
    #cat /etc/dhclient.conf

    # Configuration file for /sbin/dhclient, which is included in Debian's
    # dhcp3-client package.
    #
    # This is a sample configuration file for dhclient. See dhclient.conf's
    # man page for more information about the syntax of this file
    # and a more comprehensive list of the parameters understood by
    # dhclient.
    #
    # Normally, if the DHCP server provides reasonable information and does
    # not leave anything out (like the domain name, for example), then
    # few changes must be made to this file, if any.
    #

    option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

    send host-name "<hostname>";
    #send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
    #send dhcp-lease-time 3600;
    #supersede domain-name "fugue.com home.vix.com";
    #prepend domain-name-servers 127.0.0.1;
    request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers;
    #require subnet-mask, domain-name-servers;
    #timeout 60;
    #retry 60;
    #reboot 10;
    #select-timeout 5;
    #initial-interval 2;
    #script "/etc/dhcp3/dhclient-script";
    #media "-link0 -link1 -link2", "link0 link1";
    #reject 192.33.137.209;

    #alias {
    # interface "eth0";
    # fixed-address 192.5.5.213;
    # option subnet-mask 255.255.255.255;
    #}


    #lease {
    # interface "eth0";
    # fixed-address 192.33.137.200;
    # medium "link0 link1";
    # option host-name "andare.swiftmedia.com";
    # option subnet-mask 255.255.255.0;
    # option broadcast-address 192.33.137.255;
    # option routers 192.33.137.250;
    # option domain-name-servers 127.0.0.1;
    # renew 2 2000/1/12 00:00:01;
    # rebind 2 2000/1/12 00:00:01;
    # expire 2 2000/1/12 00:00:01;
    #}
    Naikon wrote: »
    Can you ping the cable modem/upstream connection from the ubuntu pc?

    No, ping gives host unreachable.


  • Closed Accounts Posts: 4,564 ✭✭✭Naikon


    Tom Dunne wrote: »
    Hmm, methinks this might be the problem:

    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window irtt Iface

    No, ping gives host unreachable.

    Not good.

    Try ping the localhost address 127.0.0.1 just to make sure
    the network stack isn't borked. Strange considering you
    say it picks up an address from the internal dhcp server.

    Make sure eth1 and eth0 have been set, eth1 appears
    to have no ip and subnet mask set( I know, you want dhcp).
    We will try network configuration manually for now.

    We can try rebuild the routing table temporarily just
    to see if we can get some progress.

    Try these commands out if you get the chance:

    ip route add 127.0.0.0/8 dev lo
    ip route add <your_eth0_lan_subnet_ip>/<subnet_mask> dev eth0
    ip route add <your_eht1_lan_subnet_ip>/<subnet_mask> dev eth1
    ip route add default via <your_internet_subnet_ip> dev eth1

    Make sure the interfaces have an ip and sub mask before above.
    You can leave the subnet mask as /24 or 255.255.255.0 for simplicity.

    Bit messy, but hopefully we can establish some communication.
    Then try to ping the cable modem once you establish the default
    route for outbound(internet) packets.

    Looking at the ifconfig output, are you intentially using IPv6?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭Tom Dunne


    Only getting back to this now.
    Naikon wrote: »
    Try ping the localhost address 127.0.0.1 just to make sure
    the network stack isn't borked.

    Done and working fine.
    Naikon wrote: »
    Make sure eth1 and eth0 have been set, eth1 appears
    to have no ip and subnet mask set( I know, you want dhcp).
    We will try network configuration manually for now.

    Now, when you say set, what exactly do you mean? With an internal, static IP address (i.e. 192.168.X.X)? Or with another IP address?
    Naikon wrote: »
    Looking at the ifconfig output, are you intentially using IPv6?

    No, that's the thing. IPV4 all the way. I reckon it's because it isn't picking up an external IP address, so it's defaulting to a generic IPV6 address.


  • Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭Tom Dunne


    Right, interesting development.

    There is a Cisco unit between the DSL modem and the servers. It appears that there is a connection between the ISP issued IP address and the MAC address of the network card.

    So it looks like the unit is aware of the Windows XP Network Card MAC, but no aware of the Linux one. That would explain what I am seeing.

    I'll have an update on this tomorrow when our Cisco/Networking person has a look at it.


  • Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭Tom Dunne


    All sorted. :o

    It wasn't the Linux config at all, it was whatever the Cisco unit was doing. Apparently, it makes the DHCP request from the ISP, then it allocates the address based on MAC address.

    Now I can't ping the App server from the Linux machine, but I am sure that's just a matter of adding a route.

    Thanks for all the help.


Advertisement