标签:rip conf top rest secondary 设置 host pts systemctl
有时已经把ip配置文件写好,还是会有下面的情况root:/etc/sysconfig/network-scripts # ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:a8:16:6d brd ff:ff:ff:ff:ff:ff
inet 192.168.64.140/24 brd 192.168.64.255 scope global ens33
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fea8:166d/64 scope link
valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:a8:16:77 brd ff:ff:ff:ff:ff:ff
inet 192.168.65.148/24 brd 192.168.65.255 scope global noprefixroute dynamic ens34
valid_lft 1799sec preferred_lft 1799sec
inet 192.168.65.147/24 brd 192.168.65.255 scope global secondary noprefixroute dynamic ens34
valid_lft 1435sec preferred_lft 1435sec
inet 192.168.65.146/24 brd 192.168.65.255 scope global secondary noprefixroute dynamic ens34
valid_lft 1461sec preferred_lft 1461sec
inet6 fe80::20c:29ff:fea8:1677/64 scope link
valid_lft forever preferred_lft forever
或者
root:/etc/sysconfig/network-scripts # ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:a8:16:6d brd ff:ff:ff:ff:ff:ff
inet 192.168.64.140/24 brd 192.168.64.255 scope global ens33
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fea8:166d/64 scope link
valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:a8:16:77 brd ff:ff:ff:ff:ff:ff
inet 192.168.65.147/24 brd 192.168.65.255 scope global dynamic ens34
valid_lft 1775sec preferred_lft 1775sec
inet 192.168.65.146/24 brd 192.168.65.255 scope global secondary dynamic ens34
valid_lft 1784sec preferred_lft 1784sec
inet6 fe80::20c:29ff:fea8:1677/64 scope link
valid_lft forever preferred_lft forever
# systemctl stop NetworkManager.service
# systemctl disable NetworkManager.service
# service network restart
root:/etc/sysconfig/network-scripts # cat ifcfg-ens34
BOOTPROTO="dhcp"
DEVICE="ens34"
ONBOOT="yes"
NM_CONTROLLED="no" #加入此行,网卡就不受NetworkManager所控制
标签:rip conf top rest secondary 设置 host pts systemctl
原文地址:https://blog.51cto.com/9019400/2385089