Configure a command line IP address in Linux

 French

We are working on the linux ifconfig command

1. Set your IP address

the ip address is the logical address to identify your machine on the local network

root @ easytuto: ~ # ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up

2. Set your default gateway:

the default gateway is the address of the nearest network machine (example router)

root @ easytuto: ~ # route add default gw 192.168.1.1

3. Define your DNS server

with DNS server you can connect to the internet

the address for the dns server is the address of your gateway or ip address of google 8.8.8.8

root @ easytuto: ~ # echo “nameserver 8.8.8.8”> /etc/resolv.conf

Test by pinging google.com

root @ easytuto: ~ # ping google.com

Devin BARTON

I am an avid Linux lover and open source enthusiast. I use Ubuntu and believe in sharing knowledge. Apart from Linux, I love classic detective mysteries.

One thought on “Configure a command line IP address in Linux

Leave a Reply