search by tags

for the user

adventures into the land of the command line

linux networking

checking routes

$ route

add a new static, non persistant route (will be lost after a host reboot)

$ route add -net 10.208.78.0 netmask 255.255.255.192 gw 10.208.72.225 metric 0 dev eth0

this will add this route

Destination  Gateway       Genmask         Flags Metric Ref Use Iface
10.208.78.0  10.208.72.225 255.255.255.192 UG    0      0   0   eth0

add a new static, persistent route (will remain after a host reboot)

$ vim /etc/sysconfig/network-scripts/route-eth0

add in the route such as

10.208.78.0/26 via 10.208.72.225 dev eth0

to apply the persistent route, you need to restart the network on the host

$ sudo /sbin/service network restart

sometimes its necessary to disable iptables

$ sudo /sbin/service iptables save
$ sudo /sbin/service iptables stop
$ chkconfig iptables off

in red hat, you can disable the firewall application as the root user

$ system-config-firewall-tui

press space to disable then save and exit

$ sudo /sbin/service iptables status
$ sudo /sbin/service ip6tables status

saving firewall rules to /etc/sysconfig/iptables

$ sudo /sbin/service iptables save