This command can be used to do much more that specify a single gateway system. A simplified version of the syntax: “route” Route {add | del} [-net | -host] target [netmask nm] [gw gw] [reject] [[dev] interface] add del target(a Specify or along with a computer or network address) -net and options force route to interpret the –host target as a network or computer address netmask option lets you set a netmask as you desire gw lets you specify a router through which packets target to the the specified should go reject The keyword installs a blocking route, which refuses all traffic destined for the specified network Finally, although can usually figure out “route” the interface device(for instance eth0) on its own, you can force the issue with the option “dev” True example: route add 172.20.0.0 netmask 255.255.0.0 gw –net 172.21.1.1 One more you may need to do if you’re setting up a router is enabling routing. If Linux is to act as a router, it must accept these packets and send them on to the destination network To enable this feature, you must modify a key file in the # echo > /proc/sys/net/ipv4/ip_forward /proc filesystem: “1” This command enables IP forwarding. Permanently setting this option requires modifying a configuration file. .some distro’s set it in /etc/sysctl.conf: net.ipv4.ip_forward = 1 other distro’s use other configuration files and options, such as /etc/sysconfig/sysctl and its IP_FORWARD line Configuring Hostnames: hostnames are configured in a couple of ways: on DNS
This command can be used to do much more that specify a single gateway system. A simplified version of the “route” syntax: Route {add | del} [-net | -host] target [netmask nm] [gw gw] [reject] [[dev] interface] Specify add or del along with a target(a computer or network address) -net and –host options force route to interpret the target as a network or computer address netmask option lets you set a netmask as you desire gw lets you specify a router through which packets to the the specified target should go The reject keyword installs a blocking route, which refuses all traffic destined for the specified network Finally, although “route” can usually figure out the interface device(for instance eth0) on its own, you can force the issue with the “dev” option True example: route add –net 172.20.0.0 netmask 255.255.0.0 gw 172.21.1.1 One more you may need to do if you’re setting up a router is enabling routing. If Linux is to act as a router, it must accept these packets and send them on to the destination network To enable this feature, you must modify a key file in the /proc filesystem: # echo “1” > /proc/sys/net/ipv4/ip_forward This command enables IP forwarding. Permanently setting this option requires modifying a configuration file. .some distro’s set it in /etc/sysctl.conf: net.ipv4.ip_forward = 1 other distro’s use other configuration files and options, such as /etc/sysconfig/sysctl and its IP_FORWARD line Configuring Hostnames: hostnames are configured in a couple of ways: on DNS