インタフェースメトリックの変更

 

(20)

https://matsumana.wordpress.com/2011/04/25/ubuntu%E3%81%A7lua3-u2-agt%E3%82%92%E4%BD%BF%E3%81%86/
https://qastack.jp/superuser/331720/how-do-i-set-the-priority-of-network-connections-in-ubuntu
https://askubuntu.com/questions/1008571/how-can-i-configure-default-route-metric-with-dhcp-and-netplan


vi /etc/netplan/50-cloud-init.yaml

network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: no
dhcp6: no
addresses: [10.11.12.8/24]
gateway4: 10.11.12.1
nameservers:
addresses: [8.8.8.8]
routes:
- to: 10.11.12.0/24
via: 0.0.0.0
metric: 10

netplan apply

-- USBネットワークインタフェース追加
LUA3-U2-ATX

lsusb
ip a s

ドライバをインストール
cd /usr/local/src
tar xvfj AX88772C_772B_772A_760_772_178_Linux_Driver_v4.24.0_Source.tar.bz2
cd AX88772C_772B_772A_760_772_178_Linux_Driver_v4.24.0_Source
modprobe -r asix
make
make install
modprobe asix
reboot


※netplanを参照しないため、interfacesに記載
vi /etc/network/interfaces

auto eno2
iface eno2 inet static
metric 30
address 10.11.12.22
netmask 255.255.255.0
dns-nameservers 8.8.8.8

systemctl restart networking


route -n

※コマンドでメトリックを動的に変更する場合

apt install ifmetric

ifmetric eno2 50
ifmetric eno1 100

ifmetric eno2 100
ifmetric eno1 50


-- パケット送信元インタフェース確認
ping 送信先arp -d
ping 送信
ping 送信先arp -a
→メトリックが低いインタフェースが記録されている

 

(10)

https://matsumana.wordpress.com/2011/04/25/ubuntu%E3%81%A7lua3-u2-agt%E3%82%92%E4%BD%BF%E3%81%86/
https://qastack.jp/superuser/331720/how-do-i-set-the-priority-of-network-connections-in-ubuntu
https://askubuntu.com/questions/1008571/how-can-i-configure-default-route-metric-with-dhcp-and-netplan


vi /etc/network/interfaces

auto eno1
iface eno1 inet static
metric 10
address 10.11.12.8
netmask 255.255.255.0
gateway 10.11.12.1
dns-nameservers 8.8.8.8

systemctl restart networking

-- USBネットワークインタフェース追加
LUA3-U2-ATX

lsusb
ip a s

ドライバをインストール
apt install make
apt install linux-headers-4.19.0-12-amd64

cd /usr/local/src
tar xvfj AX88772C_772B_772A_760_772_178_Linux_Driver_v4.24.0_Source.tar.bz2
cd AX88772C_772B_772A_760_772_178_Linux_Driver_v4.24.0_Source
modprobe -r asix
make
make install
modprobe asix
reboot

 

vi /etc/network/interfaces

auto eno2
iface eno2 inet static
metric 30
address 10.11.12.22
netmask 255.255.255.0
dns-nameservers 8.8.8.8

systemctl restart networking

apt install net-tools
route -n

※コマンドでメトリックを動的に変更する場合

apt install ifmetric

ifmetric eno2 50
ifmetric eno1 100

ifmetric eno2 100
ifmetric eno1 50

 

-- パケット送信元インタフェース確認
ping 送信先arp -d
ping 送信
ping 送信先arp -a
→メトリックが低いインタフェースが記録されている

 

(8)

-- USBネットワークインタフェース追加
LUA3-U2-ATX

lsusb
ip a s

※ドライバインストール不要


nmcli con modify eno1 ipv4.route-metric 50
nmcli con modify eno2 ipv4.route-metric 100

nmcli con modify eno1 ipv4.route-metric 100
nmcli con modify eno2 ipv4.route-metric 50

reboot

nmcli con show eno1 | grep metric
nmcli con show eno2 | grep metric

route -n
ip r

-- パケット送信元インタフェース確認
ping 送信先arp -d
ping 送信
ping 送信先arp -a
→メトリックが低いインタフェースが記録されている

 

 

(2012R2)
https://amksystem.com/cmd/cmd4/


-- USBネットワークインタフェース追加
LUA3-U2-ATX

ドライバインストール

 

netsh interface ipv4 show interface

netsh interface ipv4 set interface 4 met=50
netsh interface ipv4 set interface 5 met=100

netsh interface ipv4 set interface 4 met=100
netsh interface ipv4 set interface 5 met=50


-- パケット送信元インタフェース確認
ping 送信
ping 送信先arp -d
ping 送信先arp -a
→メトリックが低いインタフェースが記録されている