
nmcli を介して NetworkManager が静的ルートを管理する方法がわかりません。3 つのネットワーク インターフェイスを備えた CentOS 7.1.1503 サーバーがあります。
[root@brick ~ ]# nmcli con show
NOMBRE UUID TIPO DISPOSITIVO
int-ofi-nueva 3646ca3f-42b7-4bef-a677-6f92a5d55ee7 802-3-ethernet enp4s0
tvcable-ext e4dce451-6cc1-4a32-a8d6-394905f6a024 802-3-ethernet enp2s0
int-ofi-vieja ecbb8828-cd46-4b18-8b5e-61291a051553 802-3-ethernet enp5s0
インターフェースはenp2s0
私の WAN インターフェースであり、デフォルト ルートを持つものです。インターフェースで nmcli を使用して静的ルートを設定しましたenp5s0
が、NetworkManager を再起動してもこのルートはルーティング テーブルに追加されません。各インターフェースに接続されているネットワークに対応するルートのみが追加されます。詳細は次のとおりです。
[root@brick ~ ]# ifconfig
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet xxx.xxx.xxx.xxx netmask 255.255.255.248 broadcast xxx.xxx.xxx.xxx
inet6 fe80::feaa:14ff:fe76:fc7b prefixlen 64 scopeid 0x20<link>
ether fc:aa:14:76:fc:7b txqueuelen 1000 (Ethernet)
RX packets 13928182 bytes 1503741109 (1.4 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 372577 bytes 75107061 (71.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.2.1 netmask 255.255.255.0 broadcast 172.17.2.255
inet6 fe80::fe75:16ff:fe8a:a702 prefixlen 64 scopeid 0x20<link>
ether fc:75:16:8a:a7:02 txqueuelen 1000 (Ethernet)
RX packets 336962 bytes 70850425 (67.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 515100 bytes 589742232 (562.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.1.2 netmask 255.255.255.0 broadcast 172.17.1.255
inet6 fe80::c6e9:84ff:fe02:fbcc prefixlen 64 scopeid 0x20<link>
ether c4:e9:84:02:fb:cc txqueuelen 1000 (Ethernet)
RX packets 41353 bytes 12914987 (12.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11386 bytes 1672601 (1.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ルーティングテーブル:
[root@brick ~ ]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 <wan_gateway> 0.0.0.0 UG 100 0 0 enp2s0
172.17.1.0 0.0.0.0 255.255.255.0 U 1 0 0 enp5s0
172.17.2.0 0.0.0.0 255.255.255.0 U 0 0 0 enp4s0
<wan_network> 0.0.0.0 255.255.255.248 U 0 0 0 enp2s0
接続構成:
[root@brick ~ ]# nmcli con show int-ofi-vieja
connection.id: int-ofi-vieja
connection.uuid: ecbb8828-cd46-4b18-8b5e-61291a051553
connection.interface-name: enp5s0
connection.type: 802-3-ethernet
connection.autoconnect: yes
connection.autoconnect-priority: 0
connection.timestamp: 1444951423
connection.read-only: no
connection.permissions:
connection.zone: --
connection.master: --
connection.slave-type: --
connection.secondaries:
connection.gateway-ping-timeout: 0
802-3-ethernet.port: --
802-3-ethernet.speed: 0
802-3-ethernet.duplex: --
802-3-ethernet.auto-negotiate: yes
802-3-ethernet.mac-address: --
802-3-ethernet.cloned-mac-address: --
802-3-ethernet.mac-address-blacklist:
802-3-ethernet.mtu: auto
802-3-ethernet.s390-subchannels:
802-3-ethernet.s390-nettype: --
802-3-ethernet.s390-options:
ipv4.method: manual
ipv4.dns:
ipv4.dns-search:
ipv4.addresses: 172.17.1.2/24
ipv4.gateway: --
ipv4.routes: { ip = 10.125.25.0/24, nh = 172.17.1.9 }
ipv4.route-metric: 1
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.never-default: no
ipv4.may-fail: yes
[ipv6 settings ommitted for brevity]
プロパティ ipv4.routes は設定されているが、ルートがロードされていないことに注意してください。カーネルに認識させるには、その接続で何か他のものを設定する必要がありますか?