How we get networking on Linux

How we get networking on Linux

just three commands.

Step One: Set Your IP Address

ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up

Step 2: Set Your Default Gateway

route add default gw 192.168.1.1

Step 3: Set Your DNS Server

echo “nameserver 4.2.2.2” > /etc/resolv.conf

That’s it.

Assuming you have valid addresses for yourself and your gateway

ping google.com

Leave a Reply

Your email address will not be published. Required fields are marked *