Modify IP, DNS, and routing configuration under Linux operating system

  

The commands for modifying IP, DNS, and routing configuration under the Linux operating system are as follows: #ifconfig eth0 New #ip Then edit /etc/sysconfig/network-scripts/ifcfg-eth0, modify ip 1. Modify IP address [aeolus] @db1 network-scripts]$ vi ifcfg-eth0 DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=219.136.241.211 NETMASK=255.255.255.128 GATEWAY=219.136.241.254 Second, modify the gateway vi /etc/sysconfig/network NETWORKING=yes HOSTNAME =Aaron GATEWAY=192.168.1.1 Third, modify the DNS [aeolus@db1 etc]$ vi resolv.conf nameserver 202.96.128.68 nameserver 219.136.241.206 Fourth, restart the network configuration /etc/init.d/network restart Modify the ip address : # ifconfig eth0 192.168.0.20 netmask 255.255.255.0 Startup Effective: Modify /etc/sysconfig/network-scripts/ifcfg-eth0 Modify default gateway Immediately: # route add Default gw 192.168.0.254 Startup: Modify /etc/sysconfig/network-scripts/ifcfg-eth0 Modify dns Modify /etc/resolv.conf After the modification, it will take effect immediately, and the startup is also effective. Modify the host name to take effect immediately: # hostname fc2 Startup takes effect : Modify /etc/sysconfig/network .

Copyright © Windows knowledge All Rights Reserved