linux查看,修改ip,gateway,dns,hostname

1.ip:

/sbin/ifconfig

ifconfig eth0 192.168.1.100
# vim /etc/sysconfig/network-scripts/ifcfg-eth0
# ON_BOOT = TRUE
# IPADDR

2.gateway

netstat -rn

vim /etc/sysconfig/network-scripts/ifcfg-eth0
# ON_BOOT = TRUE
# GATEWAY

3.dns

cat /etc/resolv.conf

vim /etc/resolv.conf

4.hostname

uname -n

# HOSTNAME
vi /etc/sysconfig/network
vi /etc/hosts

相关推荐