Private Island Networks Inc.

On Linux, how do I change the default route?

Nov 03, 2020 asked by anonymous
share
subscribe to mailing list:

Question / Issue:

I have the following route table but want the default traffic to go out eth0. How do I change this? # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.3.1 0.0.0.0 UG 0 0 0 eth2 192.168.0.0 * 255.255.255.0 U 0 0 0 eth0 192.168.3.0 * 255.255.255.0 U 0 0 0 eth2 192.168.5.0 * 255.255.255.0 U 0 0 0 wlan0 192.168.6.0 * 255.255.255.0 U 0 0 0 eth1
X-ray Engineering Services

Responses:

Date: Nov. 3, 2020

Author: Mind Chasers

Comment:

Assuming your gateway on eth0 is 192.168.0.1, try this: # ip route replace default via 192.168.0.1 Your routing table should look like something like this: # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0 192.168.0.0 * 255.255.255.0 U 0 0 0 eth0 192.168.3.0 * 255.255.255.0 U 0 0 0 eth2 192.168.5.0 * 255.255.255.0 U 0 0 0 wlan0 192.168.6.0 * 255.255.255.0 U 0 0 0 eth1

Post your answer or comment:

your email address will be kept private
authenticate with a 3rd party for enhanced features, such as image upload
previous month
next month
Su
Mo
Tu
Wd
Th
Fr
Sa
loading