linux ip route add 1

linux ip route add

ip route add {NETWORK/MASK} via {GATEWAYIP}
ip route add {NETWORK/MASK} dev {DEVICE}
ip route add default {NETWORK/MASK} dev {DEVICE}
ip route add default {NETWORK/MASK} via {GATEWAYIP}

Here is what the above code is Doing:
1. The first line is adding a route to the network 10.0.0.0/24 via the gateway 10.0.0.1.
2. The second line is adding a route to the network 10.0.0.0/24 via the device eth0.
3. The third line is adding a default route via the device eth0.
4. The fourth line is adding a default route via the gateway 10.0.0.1.

Similar Posts