How to manually configure network in Linux

openwrt network configuration

Manually configure the network in Linux using the command line

In this guide, we will discuss how to manually configure the network in Linux. 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 netmask up

Second, we will be defining a gateway

Set Your Default Gateway

route default gw

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

Set Your DNS Server

echo "nameserver" > /etc/resolv.conf

Finally, check the connection


Method 2

Step 1 – first check the ping


Step 2 – cat /etc/config/network

Change IP and add DNS, Gateway.

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

option ipaddr ''
option gateway ''
option dns ''

Change IP and add DNS, Gateway.

Now restart network service

service network restart

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


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.