no internet connection on terminal

3

1

I'm not sure what it's called but you know right before you login Ubuntu, you can hit CTRL+ALT+F1 and you get a terminal? That's what I'm referring to. The problem is that I'm not sure how to enable the internet connection there.

Reason why I need internet connection is because today I can't log in and I'm getting some "low graphics mode" problem and just can't login my desktop no matter what. Unfortunately, I was dumb enough to follow an instruction that removed xorg-server and now when I type

sudo apt-get install xorg-server

I just get because I don't have internet on that terminal. Is there any way to fix this?

EDIT: I connect through WiFi

this is the result of sudo ifconfig:

eth0  Link encap:Ethernet HWaddr 00:26:9e:94:ab:3a
      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:27 Base address:0x2000

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: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)

wlan0 Link encap:Ethernet HWaddr c4:17:fe:3e:be:ca
      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)

Sorry it took so long, I typed it by hand.

Max Williams

Posted 2010-07-21T20:52:46.000

Reputation: 31

2Tell us how you connect to Internet. Do you use LAN, WiFi, fax-modem, something else... – AndrejaKo – 2010-07-21T21:00:06.000

3What does sudo ifconfig say? – Tamara Wijsman – 2010-07-21T21:10:30.550

i just updated the post with necessary info. Thanks! – Max Williams – 2010-07-21T22:14:49.193

Answers

2

This is the answer how to connect to the Internet using WIFi from a terminal.

First, edit (or create) the file /etc/wpa_supplicant/wpa_supplicant.conf. Use this content;

 
eapol_version=1
ap_scan=1
network={
        ssid="networkname"
        psk="networkpassword"
}

then use sudo wpa_supplicant -i wlan0 -D wext -c /etc/wpa_supplicant/wpa_supplicant.conf -d Now run iwconfig, if there isn't "unassociated" behind wlan0, you've got Internet.

Depending on the configuration of your router, you may need to put some more info into the config file. The man page for wpa_supplicant.conf will tell you which options are possible, you're only interested in the ones in the Network subsection. It could then look like that:

network={
        ssid="networkname"
        scan_ssid=1
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        group=TKIP
        psk="networkpassword"
}

The network name and network password are the ones you always use. If you didn't change the factory settings, they're written somewhere on your router. For the rest of the options, you can either deduce which values to use from the wpa_supplicant.conf man page and the router's current settings and its user manual, or just try out some of the possible combinations, I think they're listed in the man.

I am afraid that the whole process is very skittish and if it doesn't work outright, you could spend a lot of time trying things out before you get a result (if you get it at all). The line I gave you for running wpa_supplicant starts a debug mode, so you can at least tell where something goes wrong, but it won't spell out the reason for you :(

rumtscho

Posted 2010-07-21T20:52:46.000

Reputation: 3 586

0

Yes there are ways to connect from command line, but before we list them, you should tell us how you connect to the Internet, because they are different for every channel.

But before you go through all the motions, you could add the Ubuntu CD to your sources by editing the file

/etc/apt/sources.list

and if needed, make it the preferred source in the apt config file or just comment out the Internet repositories in the sources list. Then pop the CD and run apt-get install again. As I believe that there wasn't a new kernel upgrade since 10.4 came out, your chances are reasonably good that installing from the CD should still function. Then, if you get the low graphics mode again, replace your xorg.conf with a version known to work (you can get some examples on the internet, or if you have the nvidia-current drivers, you can run nvidia-xconfig while X doesn't run to reset the graphics configuration). After that, everything should be alright.

rumtscho

Posted 2010-07-21T20:52:46.000

Reputation: 3 586

Unfortunately, I only have a CD with Karmic (9.10) on it. Will that work? – Max Williams – 2010-07-21T22:15:32.080

Just try it out, if it doesn't, apt should be able to roll back the bad installation. – rumtscho – 2010-07-21T23:07:32.517