Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How to connect to Wired internet connection through terminal?

i corrupted my Xorg while experimenting on my system so I had to forcibly drop to Command Line.

However, my question is this - How do I connect to wired connection from the command line??

share|improve this question

marked as duplicate by Alvar, izx, Mitch, Eliah Kagan, RobotHumans Aug 11 '12 at 22:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Place the following into /etc/network/interfaces with an editor.

It will cause the network manager to bring up your Ethernet automatically and configure it with DHCP.

auto eth0 iface
iface eth0 inet dhcp

As Morgan correctly suggested you can find out if you should use something other than eth0 to refer to your wired connection by using the command ip link.

After adding this restart the network manager with:

sudo /etc/init.d/networking restart

(You should get an error message).

If this doesn't work you can try:

sudo ifdown eth0
sudo ifup eth0

And if that doesn't work you can reboot.

If all this doesn't work for you please mention in your question what you tried and what messages you got. You might find more information at the bottom of /var/log/syslog if you look right after you try it. tail -n 50 /var/log/syslog

share|improve this answer

ifconfig eth0 up (obviously adjust the IP address for your local network) should do the trick in a pinch. It's possible your ethernet adapter isn't eth0; using "ifconfig -a" or "ip link" should at least show you the interfaces for you to configure them.

share|improve this answer
Didn't work. :( – Akshit Baunthiyal Aug 11 '12 at 12:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.