Thursday, April 11, 2019

networking - Cant connect to Ethernet after system installation (Ubuntu Server)




I have installed Ubuntu server edition on a computer. During the installation I skipped the network configuration, and now I don't know how to connect to the internet via LAN / Ethernet.



First, verify that you have a valid ethernet interface; ideally eth0:



ifconfig


See if you can connect temporarily:




sudo dhclient eth0


If you connect, edit /etc/network/interfaces to set a static IP address appropriate for a server:



sudo vim /etc/network/interfaces


I suggest the following, adjusted, of course to suit your network:




auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 192.168.1.1



Save the file and quit vim. Be sure to use an IP address outside the range of the DHCP pool in the router so as to avoid collisions. Get the system to read and use the changes:



sudo ifdown eth0 && sudo ifup -v eth0


Check:



ping -c3 www.google.com



If you get ping returns, you are all set.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...