centos 6.3命令行网络设置
centos 6版本操作系统默认是没有设置网络配置,需要在启动后自行配置网络:
动态地址模式(DHCP)
1.检查网络ip a
ip a
2.修改/etc/sysconfig/networking-scripts下的ifcfg-eth0
DEVICE="eth0" HWADDR="00:22:19:09:4D:3C" NM_CONTROLLED="yes" ONBOOT="no"
如下:
DEVICE="eth0" HWADDR="00:22:19:09:4D:3C" NM_CONTROLLED="yes" ONBOOT="yes" # Interface enabled BOOTPROTO="dhcp" #Assigning IP from DHCP
重新启动网络服务
service network restart
静态地址模式(STATIC)
1.查看现有网络 ip a
2.修改/etc/sysconfig/networking-scripts下的eth0
DEVICE="eth0"
HWADDR="00:22:19:09:4D:3C" NM_CONTROLLED="yes" ONBOOT="no"
如下:
DEVICE=eth0 BOOTPROTO=static HWADDR=00:0c:29:20:23:72 NM_CONTROLLED=yes ONBOOT=yes TYPE=Ethernet UUID="78457eda-3132-40da-9637-e770306b6315" IPADDR=172.16.80.15 NETMASK=255.255.192.0 GATEWAY=172.16.64.1 DNS1=172.16.2.129
3.重启网络服务
service network restart
再检查网络
ip a:如eth0正常,一切ok.
相关推荐
haitianisgood 2020-07-21
吹云 2020-11-05
84407805 2020-11-01
曾是土木人 2020-10-31
87201442 2020-10-15
java0 2020-09-29
81437716 2020-09-18
81437716 2020-09-13
bluecarrot 2020-09-11
myCat 2020-09-09
83427718 2020-09-07
85560694 2020-09-03
89520991 2020-08-21
89550191 2020-08-09
katie000 2020-08-04
hunningtu 2020-07-30
89961330 2020-07-28
yuzhongdelei0 2020-07-28