centos 网络配置
ifconfig 没有查到信息是正常的,因为你没设置!用VI命令编辑网络配置文件:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
在这里的ETH0,指的第一个网卡接口,如果你的服务器有多个请区分
4 网卡配置静态IP
1)编辑配置文件,添加修改以下内容
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=0a:ee:8e:a0:ad:ae
TYPE=Ethernet
UUID=cf179604-b924-495f-9ddb-eafc5735041e
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.10.10
NETMASK=255.255.255.0
GATEWAY=192.168.10.1
DNS1=8.8.8.8
DNS2=8.8.4.4
IPV6INIT=no
# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=ce:cf:fa:1a:a2:e0
TYPE=Ethernet
UUID=bea92e3f-e13b-4ddc-beb8-d8f67f996103
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.10.11
NETMASK=255.255.255.0
GATEWAY=192.168.10.1
DNS1=8.8.8.8
DNS2=8.8.4.4
IPV6INIT=no
:wq!
2)修改完后执行以下命令
# service ip6tables stop #停止IPV6服务
# chkconfig ip6tables off #禁止IPV6开机启动
# service network restart #重启网络连接
# ifconfig #查看IP地址
相关推荐
graseed 2020-10-28
SXIAOYI 2020-09-16
jinhao 2020-09-07
yoohsummer 2020-06-01
impress 2020-02-20
chenshuixian 2013-06-01
羽化大刀Chrome 2013-05-31
kanpiaoxue 2013-06-19
quanhaoH 2013-06-17
wutongyuq 2013-04-12
Tom天天 2013-07-12
pigsmall 2020-11-19
大数据杂谈 2020-09-26
ChinaWin 2020-08-13
mohanzb 2020-08-01
王国平 2020-06-20
kangtingting0 2020-05-20
MichelinMessi 2020-02-19
nicepainkiller 2020-01-25