2 ways to manually configure network in linux 7



Configure network in linux 7 using the command line

In this guide, we will discuss how to manually configure network in linux 7. This is the most basic and traditional way to configure the network in Linux.

Method 1

First, we will be defining the IP address to the adapter eth0.

Set Your IP Address


ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

Second, we will be defining a gateway

Set Your Default Gateway

route default gw 192.168.1.1



Third, we will update /etc/resolv.conf file for DNS

Set Your DNS Server

echo "nameserver 8.8.8.8" > /etc/resolv.conf

Finally, check the connection

ping google.com

Method 2

Step 1 – first check the ping

ping google.com

Step 2 – cat /etc/config/network

Change IP and add DNS, Gateway.

Step 3 – Edit – vi /etc/config/network

option ipaddr '192.168.1.101'
option gateway '192.168.1.1'
option dns '1.1.1.1'



Change IP and add DNS, Gateway.

Now restart network service

service network restart
ping google.com

Above Tutorial was Performed on Ubuntu, Centos, Openwrt and DD-wrt

techouse

I love helping beautiful people like you. I love hanging out with my dogs.

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

× How can I help you?