route

show / manipulate the IP routing table

copy
15
2
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0This is an obscure one documented so people know how to do it. This sets all of the class D (multicast) IP routes to go via "eth0". This is the correct normal configuration line with a multicasting kernel.

details |

copy
4
2
route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0adds a route to the local network 192.56.76.x via "eth0". The word "dev" can be omitted here.

details |

copy
4
7
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.3 dev eth0Add's the net 192.168.1.0 to be gatewayed through the eth0 interface on 192.168.1.3

details |

copy
3
1
route add -net 127.0.0.0 netmask 255.0.0.0 dev loadds the normal loopback entry, using netmask 255.0.0.0 and associated with the "lo" device (assuming this device was previously set up correctly with ifconfig)

details |

copy
3
0
route add ipx4 sl0

source | details |

copy
2
3
route del defaultDeletes the current default route, which is labeled "default" or 0.0.0.0 in the destination field of the current routing table.

details |

copy
3
0
route add default gw mango-gw

source | details |

copy
2
0
route del default

source | details |

copy
2
1
route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4This command adds the net "192.57.66.x" to be gatewayed through the former route to the SLIP interface.

details |

copy
2
1
route -eShow routing table

details |

copy
3
0
route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4

source | details |

copy
1
2
route add default gw mango-gwAdds a default route (which will be used if no other route matches). All packets using this route will be gatewayed through "mango-gw". The device which will actually be used for that route depends on how we can reach "mango-gw" - the static route to "mango-gw" will have to be set up before.

details |

copy
1
1
route add ipx4 sl0Adds the route to the "ipx4" host via the SLIP interface (assuming that "ipx4" is the SLIP host).

details |

copy
1
2
route add -net 10.0.0.0 netmask 255.0.0.0 rejectThis installs a rejecting route for the private network "10.x.x.x."

details |

copy
1
0
route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0

source | details |

copy
0
0
route add -net 10.0.0.0 netmask 255.0.0.0 reject

source | details |

copy
0
0
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

source | details |

copy
0
0
route add -net 127.0.0.0 netmask 255.0.0.0 dev lo

source | details |