0

I'm trying to install ubuntu server on my old laptop. the reason is it's faster. my problem is internet connection. after installing i have to install some new software from repos. and connect my laptop to my network with eth0. please tell me how to check if there is internet access. and how to connect to a network with eth0 or wlan0. thanks

closed as unclear what you're asking by David Foerster, Zanna, TheWanderer, Rinzwind, Thomas Ward Dec 25 '16 at 16:10

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    check for connection using ping eg ping -c3 google.com see also: man ping maybe you need to use sudo ifconfig eth0 up; sudo dhcpd to set the iface eth0 up and enable dhcp. – LittleByBlue Oct 12 '15 at 6:08
  • Could you please edit your question to include the output of the terminal commands lspci -nnk | grep -A2 Network and LC_MESSAGES=POSIX nm-tool? Thanks. – David Foerster Dec 25 '16 at 10:42
2

Run the following command if you do not have an IP. If you do have an IP, skip the first part here and go down to the instructions for DNS:

sudo nano /etc/network/interfaces

Then, make sure the file looks like this, if not, make changes:

# The loopback network interface
auto lo eth0
iface lo inet loopback

# The primary network interface
iface eth0 inet dhcp

Press CTRL + o and then press ENTER to save the file. Press CTRL + x to exit nano.

Then, bring up the interface and restart networking:

sudo ifup -a    

sudo service networking restart

Again, run ifconfig to see if you have an inet address. If so, run the following command to check the network. If the network is good, you will not get any errors:

sudo apt-get update

DNS

If you get errors, you may need to set the dns resolver. To do this, edit resolvconf:

sudo nano /etc/resolv.conf

Now, set your nameserver to something like 8.8.4.4 for now, so the file should look like this:

nameserver 8.8.4.4

Press CTRL + o and then press ENTER to save the file. Press CTRL + x to exit nano.

Then, run the following command to update your dns settings:

sudo resolvconf -u

Run the following command to test the network:

sudo apt-get update

or

To check to see if you have internet, run the following command; the less percent packet loss, the better:

ping 8.8.8.8
1

Just connect the network cable and run ifconfig. If you get an IP-address you're good to go. If not, you need to edit the /etc/network/interfaces file

Eth0 with dhcp:

# The loopback network interface auto lo eth0 iface lo inet loopback

# The primary network interface iface eth0 inet dhcp

Eth0 with static IP:

# The loopback network interface auto lo eth0 iface lo inet loopback

# The primary network interface iface eth0 inet static address 192.168.1.99 netmask 255.255.255.0 broadcast 192.168.1.255 network 192.168.1.0 gateway 192.168.1.1 dns-nameservers 192.168.1.1

For wlan0 with dhcp and WEP encryption add:

auto wlan0 iface wlan0 inet dhcp wireless-essid myssid wireless-key a1b2c3d4e5

For wlan0 with dhcp and WPA add:

auto wlan0 iface wlan0 inet dhcp wpa-ssid myssid wpa-psk a1b2c3d4e5

Obviously you need to set your own IP, gateway, wifi password etc.

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