Linux how to modify the ip address, host name and other information

  
modify the ip address
Immediate effect:
# ifconfig eth0 192.168.0.20 netmask 255.255.255.0
Startup effective:
Modify /etc/sysconfig/network -scripts/ifcfg-eth0
Modify default gateway
Effective immediately:
# route add default gw 192.168.0.254
Startup:
Modify /etc/sysconfig/network-scripts/ifcfg- Eth0
Modify dns
Modify /etc/resolv.conf
It can be effective immediately after modification, and the startup is also effective
Modify host name
Effective immediately:
# hostname fc2
Start Effective:
Modify /etc/sysconfig/network

Copyright © Windows knowledge All Rights Reserved