Find the answer to your Linux question:
Results 1 to 3 of 3
I'm running Ubuntu (Hardy) on a laptop that connects to the internet via a wireless router. In an effort to switch from DHCP to a static IP address, I have ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2008
    Posts
    2

    Help. I tried to switch from DHCP to Static IP and screwed up all my settings.


    I'm running Ubuntu (Hardy) on a laptop that connects to the internet via a wireless router. In an effort to switch from DHCP to a static IP address, I have accidentally screwed up my /etc/network/interfaces and /etc/resolv.conf, and uninstalled dhcp3-client (and its dependencies). I also can no longer see my wireless network manager and can't connect to anything.

    Here is some information:

    $ ifconfig
    Code:
    eth0      Link encap:Ethernet  HWaddr 00:16:d3:28:21:b4  
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Base address:0x2000 Memory:ee000000-ee020000 
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:1980 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1980 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:111785 (109.1 KB)  TX bytes:111785 (109.1 KB)
    
    wlan0     Link encap:Ethernet  HWaddr 00:13:02:9c:06:d1  
              inet addr:192.168.1.17  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::213:2ff:fe9c:6d1/64 Scope:Link
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:1012 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1112 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:114356 (111.6 KB)  TX bytes:168766 (164.8 KB)
    wmaster0  Link encap:UNSPEC  HWaddr 00-13-02-9C-06-D1-00-00-00-00-00-00-00-00-00-00  
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    # /etc/network/interfaces
    Code:
    auto lo
    iface lo inet loopback
    
    allow-hotplug wlan0
    iface wlan0 inet static
    address 192.168.1.17
    netmask 255.255.255.0
    gateway 192.168.1.1
    wpa-driver wext
    wpa-key-mgmt WPA-PSK
    wpa-proto WPA2
    wpa-ssid XX
    
    auto wlan0
    # /etc/resolv.conf
    Code:
    nameserver 192.168.1.1
    $ ping 64.208.34.100
    Code:
    PING 64.208.34.100 (64.208.34.100) 56(84) bytes of data.
    From 192.168.1.17 icmp_seq=2 Destination Host Unreachable
    From 192.168.1.17 icmp_seq=3 Destination Host Unreachable
    From 192.168.1.17 icmp_seq=4 Destination Host Unreachable
    Please ask questions if it will help; I will respond within 10 minutes of your post! I'm desperate. Thanks!

  2. #2
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    Apply DHCP again and see what settings it does.
    # dhclient
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  3. #3
    Just Joined!
    Join Date
    Nov 2008
    Posts
    2
    OK, I changed "static" to "dhcp" in /etc/network/interfaces and then I ran dhclient:

    $ sudo dhclient
    Code:
    Internet Systems Consortium DHCP Client V3.0.4
    Copyright 2004-2006 Internet Systems Consortium.
    All rights reserved.
    For info, please visit http://www.isc.org/sw/dhcp/
    
    wmaster0: unknown hardware address type 801
    wmaster0: unknown hardware address type 801
    Listening on LPF/wmaster0/
    Sending on   LPF/wmaster0/
    Listening on LPF/eth0/00:16:d3:28:21:b4
    Sending on   LPF/eth0/00:16:d3:28:21:b4
    Listening on LPF/wlan0/00:13:02:9c:06:d1
    Sending on   LPF/wlan0/00:13:02:9c:06:d1
    Sending on   Socket/fallback
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
    DHCPDISCOVER on wmaster0 to 255.255.255.255 port 67 interval 6
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
    DHCPDISCOVER on wmaster0 to 255.255.255.255 port 67 interval 7
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
    DHCPDISCOVER on wmaster0 to 255.255.255.255 port 67 interval 12
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
    DHCPDISCOVER on wmaster0 to 255.255.255.255 port 67 interval 16
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 21
    DHCPDISCOVER on wmaster0 to 255.255.255.255 port 67 interval 16
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
    DHCPDISCOVER on wmaster0 to 255.255.255.255 port 67 interval 4
    No DHCPOFFERS received.
    No working leases in persistent database - sleeping.
    $ ping 64.208.34.100
    Code:
    connect: Network is unreachable
    $ ifconfig
    Code:
    eth0      Link encap:Ethernet  HWaddr 00:16:d3:28:21:b4  
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Base address:0x2000 Memory:ee000000-ee020000 
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:2148 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2148 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:121233 (118.3 KB)  TX bytes:121233 (118.3 KB)
    
    wlan0     Link encap:Ethernet  HWaddr 00:13:02:9c:06:d1  
              inet6 addr: fe80::213:2ff:fe9c:6d1/64 Scope:Link
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:6246 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6236 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:705798 (689.2 KB)  TX bytes:969144 (946.4 KB)
    
    wmaster0  Link encap:UNSPEC  HWaddr 00-13-02-9C-06-D1-00-00-00-00-00-00-00-00-00-00  
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

  4. $spacer_open
    $spacer_close

Posting Permissions

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