Saturday, September 23, 2017

How to config IP Address in CentOS via Terminal

Step 1. Open terminal
Step 2. Switch to root, next
     
              #vi /etc/sysconfig/network-scripts/ifcfg-eth0
         
                         DEVICE = "eth0"
                         BOOTPROTO = "Static"
                         ONBOOT = "Yes"
                         TYPE = "Ethernet"
                         IPADDR = 192.168.4.4
                         NETMASK = 255.255.255.0
                         GATEWAY = 192.168.4.7
                         DNS1 = 8.8.8.8
                         DNS2 = 8.8.4.4
        Press Esc, wq!

           # /etc/init.d/network restart


for advance ip configuration make copy the eth0 to eth0:0, eth0:1 and change IP's as per your wish.

you can refer Here

 network-scripts]# cp ifcfg-eth0 ifcfg-eth0:0
 network-scripts]# vi ifcfg-eth0:0

DEVICE="eth0:0"
BOOTPROTO="Static"
ONBOOT="yes"
TYPE="Ethernet"
IPADDR=192.168.10.7
NETMASK=255.255.255.0
GATEWAY=192.168.1.100
DNS1=8.8.8.8


here edit your advance IP Address and restart your Network 


No comments:

Post a Comment