Redhat 7.6 网络配置问题

Redhat 7.6 网络配置问题

安装 redhat 7.6 时出现不寻常的问题。网络配置未按预期运行,我没有主意。

系统有 2 个接口。第二个接口有 2 个 IP 地址。这是正在设置的配置。

/etc/sysconfig/network
GATEWAY=10.135.149.1

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
HWADDR=00:50:56:aa:aa:18
TYPE=Ethernet
BOOTPROTO=none
IPADDR0=10.135.209.29
NETMASK0=255.255.255.224

/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
HWADDR=00:50:56:aa:e2:37
TYPE=Ethernet
BOOTPROTO=none
IPADDR0=10.135.149.8
NETMASK0=255.255.255.224
IPADDR1=10.135.149.18
NETMASK1=255.255.255.224

/etc/sysconfig/network-scripts/route-eth0 
10.0.0.0/8 via 10.135.209.1

除路由表外,一切看起来都正确。

 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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:50:56:aa:f1:72 brd ff:ff:ff:ff:ff:ff
    inet 10.135.209.30/27 brd 10.135.209.31 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:feaa:f172/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:50:56:aa:e1:2a brd ff:ff:ff:ff:ff:ff
    inet 10.135.149.8/30 brd 10.135.149.11 scope global noprefixroute eth1
       valid_lft forever preferred_lft forever
    inet 10.135.149.18/30 brd 10.135.149.19 scope global noprefixroute eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:feaa:e12a/64 scope link 
       valid_lft forever preferred_lft forever

default via 10.135.149.1 dev eth0 proto static metric 100 
default via 10.135.149.1 dev eth1 proto static metric 101 
10.0.0.0/8 via 10.135.209.1 dev eth0 proto static metric 100 
10.135.149.1 dev eth0 proto static scope link metric 100 
10.135.149.1 dev eth1 proto static scope link metric 101 
10.135.149.8/30 dev eth1 proto kernel scope link src 10.135.149.8 metric 101 
10.135.149.16/30 dev eth1 proto kernel scope link src 10.135.149.18 metric 101 
10.135.209.0/27 dev eth0 proto kernel scope link src 10.135.209.30 metric 100 

netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.135.149.1    0.0.0.0         UG        0 0          0 eth0
0.0.0.0         10.135.149.1    0.0.0.0         UG        0 0          0 eth1
10.0.0.0        10.135.209.1    255.0.0.0       UG        0 0          0 eth0
10.135.149.1    0.0.0.0         255.255.255.255 UH        0 0          0 eth0
10.135.149.1    0.0.0.0         255.255.255.255 UH        0 0          0 eth1
10.135.149.8    0.0.0.0         255.255.255.252 U         0 0          0 eth1
10.135.149.16   0.0.0.0         255.255.255.252 U         0 0          0 eth1
10.135.209.0    0.0.0.0         255.255.255.224 U         0 0          0 eth0

我不知道为什么,但我似乎得到了 2 个默认路由,一个来自 eth0,另一个来自 eth1。我可以通过声明默认网关设备来解决这个问题,但这意味着该服务器的配置将与其他集群不同。我已将相同的配置应用于其他 91 个相同版本的 redhat 主机,没有任何问题。需要更改什么才能返回预期的行为?

谢谢

答案1

发现问题了。NetworkManager 仍在运行。默认添加了额外的路由。

相关内容