We will use eth0 in this example, your interface can be named differently, seeĀ Finding your network interface.
If you have disabled the either wicd or the network manager you probably don’t have a network connection anymore. Connect via a regular UTP cable to your router, and assuming you have DHCP enabled do the following:
sudo ip link set dev eth0 down
sudo dhclient eth0
This will bring your eth0 up by using DHCP. Your network is now configured (for the time being).
If you don’t have DHCP enabled configure your network by issuing the commands below, the gateway address is the IP address of your router. And your IP should be in the same range as the router is.
sudo ip addr add 192.168.1.14/24 dev eth0
sudo ip link set dev eth0 up
sudo ip route add default via 192.168.1.1
These commands configure your interface but these changes will not survive a reboot, since the information is not stored anywhere. This is where the interfaces file comes in handy. To configure an interface permanently you’ll need to edit the interfaces file, /etc/network/interfaces.
sudo vi /etc/network/interfaces
## To configure a dynamic IP address
auto eth0
iface eth0 inet dhcp
## Or configure a static IP
auto eth0
iface eth0 inet static
address 192.168.1.14
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
For these settings to take effect you need to restart your networking services.
sudo /etc/init.d/networking restart
sudo nano /etc/resolv.conf
Do not edit this file by hand –your changes will be overwritten
# I add this
nameserver 8.8.8.8
nameserver 8.8.4.4
sudo apt-get remove dhcp-client
sudo /etc/init.d/networking restart
My name is Rayhan and I’m an IT professional with over 10 years of experience in the field. I’m passionate about all things tech, and I love helping people solve their IT problems. In my free time, I enjoy tinkering with new gadgets and software, and I’m always on the lookout for the latest tech trends. I believe that technology has the power to make our lives easier and more enjoyable, and I’m excited to be a part of this ever-evolving field. Thank you for taking the time to visit my page.