Home > 備忘録(Fedora) > ネットワーク構築 > 複数 nic の優先順位の変更( 134 )
metric の値は 0〜429,496,729(32ビット整数)で、windowsの場合は1〜9999までです。その値の最小値のインターフェイスが最優先される。
metric の値が最小のインターフェイス優先するので、enp3s0(100)が優先される。 優先順位は:enp3s0(100)ー>wlp2s0(600)
[root@server]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 100 0 0 enp3s0
default _gateway 0.0.0.0 UG 600 0 0 wlp2s0
192.168.10.0 0.0.0.0 255.255.255.0 U 100 0 0 enp3s0
192.168.10.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp2s0[root@server]# nmcli connection modify enp3s0の接続名 ipv4.route-metric 600 // 100 -> 600
[root@server]# nmcli connection modify wlp2s0の接続名 ipv4.route-metric 100 // 600 -> 100[root@server]# nmcli connection up enp3s0の接続名 // 反映
[root@server]# nmcli connection up wlp2s0の接続名 // 反映enp3s0 の metric が (100->600) , wlp2s0 の metric が (600->100) に変更されていることが確認できる。 優先順位は:wlp2s0(100)ー>enp3s0(600)
[root@server]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 100 0 0 wlp2s0
default _gateway 0.0.0.0 UG 600 0 0 enp3s0
192.168.10.0 0.0.0.0 255.255.255.0 U 100 0 0 wlp2s0
192.168.10.0 0.0.0.0 255.255.255.0 U 600 0 0 enp3s0