1,修改静态网络配置
Java代码
[root@davidserver ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:0C:29:99:5A:3C"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="1cb095a6-b832-4dc1-92e1-1a1a7a58abc8"
IPADDR="8.0.0.10"
BROADCAST="8.0.0.255"
NETMASK="255.255.255.0"
NETWORK="8.0.0.0"
GATEWAY="8.0.0.1"
IPV6INIT="no"
IPV6_AUTOCONF="no"
简化配置
Java代码
[root@davidserver ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
ONBOOT="yes"
TYPE="Ethernet"
IPADDR="8.0.0.11"
BROADCAST="8.0.0.255"
NETMASK="255.255.255.0"
NETWORK="8.0.0.0"
GATEWAY="8.0.0.1"
IPV6INIT="no"
IPV6_AUTOCONF="no"
2,修改DNS服务
Java代码
[root@davidserver ~]# vim/etc/resolv.conf
nameserver 8.0.0.1
时间: 2024-11-18 06:29:35