Configure permanent static route on Ubuntu or Debian

How to Configure permanent static route on Ubuntu or Debian

1. Configure Permanent static routes in /etc/networking/interfaes

root@ubuntu:~# vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
auto eth0
iface eth0 inet dhcp
up route add -net 192.168.4.0/24 eth0
root@ubuntu:~#

2. Restart Network to take affect

root@ubuntu:~# /etc/init.d/networking restart

3. Checking Route on your System

root@ubuntu:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 100 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.4.0 * 255.255.255.0 U 0 0 0 eth0
root@ubuntu:~#

That’s all. Thanks for using IThelpblog.com

 

 

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>