Categories
Kali Linux

Kali Linux network routing priority

When Wi-Fi and Ethernet are both connected and Wi-Fi is the only way to to access the internet, kali linux default routing cannot access the internet. To access the internet on this system, Wi-Fi metric value should have lower value than Ethernet metric value.

The metric value of the network devices can be modified by nmcli command.

The following commands change Wi-Fi metric value from 600 to 50. After changing the metric value , Wi-Fi has lower metric value and the system can access the internet.

# default network setting 
kali@kali:$ ip r
default via 192.168.0.1 dev eth0 proto dhcp metric 100 
default via 192.168.10.1 dev wlan0 proto dhcp metric 600 
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.2 metric 100 
192.168.10.0/24 dev wlan0 proto kernel scope link src 192.168.10.9 metric 600 

# change wlan0 metric from 600 to 50
kali@kali:$ sudo nmcli connection modify access-point-name ipv4.route-metric 50
kali@kali:/mnt/tmp$ sudo nmcli connection up access-point-name
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)

# current network setting
kali@kali:$ ip r
default via 192.168.10.1 dev wlan0 proto dhcp metric 50 
default via 192.168.0.1 dev eth0 proto dhcp metric 100 
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.2 metric 100 
192.168.10.0/24 dev wlan0 proto kernel scope link src 192.168.10.9 metric 50