centos设置ip地址

下面分别设置网关、ip地址+子网掩码、DNS地址:

[root@xjbpc ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=xjbpc
GATEWAY=10.186.106.253

[root@xjbpc ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE=eth0
HWADDR=08:00:27:87:FC:A7
TYPE=Ethernet
UUID=fea9d8b1-d0b3-42b2-935c-5c08e90c5663
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=10.186.106.48
NETMASK=255.255.255.0

[root@xjbpc ~]# cat /etc/resolv.conf 
; generated by /sbin/dhclient-script
search DHCP HOST
nameserver 202.102.152.3
nameserver 186.76.76.76
nameserver 114.114.114.114
posted @ 2018-12-12 09:14  xuejianbest  阅读(99)  评论(0编辑  收藏  举报