Command-line connect to wired network for Ubuntu

14,677

Solution 1

If your router is set up to serve IP addresses via dhcp, run sudo dhclient3 eth0 to ask for an IP address for the eth0 interface.

Solution 2

The No DHCPOFFERS received. means that you're not reaching, and getting a response, from the DHCP server.

There may be a number of reasons for this, but having your wireless in monitor mode isn't one I'd put on the list. It could be that the DHCP server only serves a limited set of MAC addresses (each network card has a unique MAC address), or that there is no DHCP server. It could also be a security feature of the switch restricting access only to certain MAC addresses.

The other thing to check is hardware - does the network cable work with another computer and does your computer work with another wired network.

The easy way to test your theory is to take wlan0 out of monitor mode.

Share:
14,677

Related videos on Youtube

baz
Author by

baz

Elitists are oppressive, anti-intellectual, ultra-conservative, and cancerous to the society, environment, and humanity. Please help make Stack Exchange a better place. Expose elite supremacy, elitist brutality, and moderation injustice to https://stackoverflow.com/contact (complicit community managers), in comments, to meta, outside Stack Exchange, and by legal actions. Push back and don't let them normalize their behaviors. Changes always happen from the bottom up. Thank you very much! Just a curious self learner. Almost always upvote replies. Thanks for enlightenment! Meanwhile, Corruption and abuses have been rampantly coming from elitists. Supportive comments have been removed and attacks are kept to control the direction of discourse. Outright vicious comments have been removed only to conceal atrocities. Systematic discrimination has been made into policies. Countless users have been harassed, persecuted, and suffocated. Q&A sites are for everyone to learn and grow, not for elitists to indulge abusive oppression, and cover up for each other. https://softwareengineering.stackexchange.com/posts/419086/revisions https://math.meta.stackexchange.com/q/32539/ (https://i.stack.imgur.com/4knYh.png) and https://math.meta.stackexchange.com/q/32548/ (https://i.stack.imgur.com/9gaZ2.png) https://meta.stackexchange.com/posts/353417/timeline (The moderators defended continuous harassment comments showing no reading and understanding of my post) https://cs.stackexchange.com/posts/125651/timeline (a PLT academic had trouble with the books I am reading and disparaged my self learning posts, and a moderator with long abusive history added more insults.) https://stackoverflow.com/posts/61679659/revisions (homework libels) Much more that have happened.

Updated on September 17, 2022

Comments

  • baz
    baz over 1 year

    I like to know how to use command-line to connect to a wired network in general for Ubuntu 8.10?

    In my case, I connect a cable to my laptop but it doesn't work with my WICD. So I like to try command-line method.

    Here is the ifconfig of my network adapters:

    $ ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:c0:9f:8d:23:74  
              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)
              Interrupt:19 Base address:0x1800 
    
    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:4457 errors:0 dropped:0 overruns:0 frame:0
              TX packets:4457 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:493002 (493.0 KB)  TX bytes:493002 (493.0 KB)
    
    wlan0     Link encap:Ethernet  HWaddr 00:0e:9b:ab:56:19  
              UP BROADCAST NOTRAILERS PROMISC ALLMULTI  MTU:576  Metric:1
              RX packets:1508929 errors:0 dropped:0 overruns:0 frame:0
              TX packets:768144 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:806027375 (806.0 MB)  TX bytes:78834873 (78.8 MB)
    
    wlan0:avahi Link encap:Ethernet  HWaddr 00:0e:9b:ab:56:19  
              inet addr:169.254.5.92  Bcast:169.254.255.255  Mask:255.255.0.0
              UP BROADCAST NOTRAILERS PROMISC ALLMULTI  MTU:576  Metric:1
    
    wmaster0  Link encap:UNSPEC  HWaddr 00-0E-9B-AB-56-19-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)
    

    UPDATE:

    Tried what oyvindio suggested. Here is the failing message:

    $ sudo dhclient3 eth0
    There is already a pid file /var/run/dhclient.pid with pid 18279
    killed old client process, removed PID file
    Internet Systems Consortium DHCP Client V3.1.1
    Copyright 2004-2008 Internet Systems Consortium.
    All rights reserved.
    For info, please visit http://www.isc.org/sw/dhcp/
    
    mon0: unknown hardware address type 803
    wmaster0: unknown hardware address type 801
    mon0: unknown hardware address type 803
    wmaster0: unknown hardware address type 801
    Listening on LPF/eth0/00:c0:9f:8d:23:74
    Sending on   LPF/eth0/00:c0:9f:8d:23:74
    Sending on   Socket/fallback
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 15
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
    No DHCPOFFERS received.
    No working leases in persistent database - sleeping.