For those who are new to Ubuntu or Debian, default setting of your network card is using DHCP. And in some case you want to use static IP, maybe for bypass some filter or your DHCP server is not working properly then you cannot connect to the network unless your network administrator come and fix it. In that situation you really need to change your network configuration from dhcp to static ip.
To change your network configuration from dhcp to static ip is not hard. You can follow these steps below:
- Open your terminal client
- Type this command:
sudo vim /etc/network/interfaces
- Then you will see there are 2 network interface, lo and eth0. See example below:
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp
- Change the eth0 one according to your network setting (you can call your network administrator and tell you the setting) , see example below
auto eth0 iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1
- Save that file and close
- Restart your network to apply the new setting, with this command:
- See your network configuration by type:
That’s it. Thanks for reading this article. Please leave any comment if you have another tips or input.
What do you do about configuring DNS,… and WINS if you use Samba.
G'day Wes, DNS is in /etc/resolve.conf. RE WINS, depends if you want to setup a client or server. Both of which are well documented in the SAMBA docs.
thanks a lot you fixed my problem