Saturday, July 20, 2019

Ubuntu route configuration

Clear route table: sudo ip route flush table main
Add default route: sudo route add default gw 192.168.1.1
Add route to certain subnet: sudo ip route add 0.0.0.0/0 dev ens33

Add route according to route table: sudo route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1
Add route via: sudo ip route add 192.168.1.0/24 via 192.168.1.1


Delete certain route:
sudo route del -net 192.168.1.0 gw 0.0.0.0 netmask 255.255.255.0
sudo route del -net 192.168.1.0 gw 0.0.0.0 netmask 255.255.255.0 dev ens33


Restart network service:  systemctl restart networking
Restart network manager: sudo service network-manager




No comments:

Post a Comment