CentOS设置静态IP, DNS

[root@dextrys-yz ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetLink BCM57780 Gigabit Ethernet PCIe
DEVICE=eth0
#BOOTPROTO=dhcp
HWADDR=BC:30:5B:C7:20:53


#modify
BOOTPROTO=static
IPADDR=172.17.17.44
#BROADCAST=172.17.16.255
BROADCAST=172.17.17.255
NETMASK=255.255.255.0
#NETWORK=172.17.16.0
NETWORK=172.17.17.0
GATEWAY=172.17.17.2
ONBOOT=yes

[root@dextrys-yz ~]#


DNS
[root@dextrys-yz ~]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver 172.17.13.11

重新启动网络配置
# service network restart或者
# /etc/init.d/network restart

你可能感兴趣的:(centos)