LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-25-2015, 07:20 AM   #1
schhabra
LQ Newbie
 
Registered: May 2015
Posts: 3

Rep: Reputation: Disabled
Persistent Static ROutes


Need help in configurnig Persistent Static ROutes in Debian (Wheezy) Linux Machine


Situation 1 - One Network INterface - eth0

I have configured some persistent routes in /etc/network/interfaces file (As mentioned below)

post-up ip route add <NW>/32 via <GW> dev eth0
post-up ip route add <NW>/32 via <GW> dev eth0

Note:- Removed Network and Gateway Address

and they are working perfectly fine

when I give command "route" - it shows in the list.


Situation 2 - two Network INterfaces - eth0.XXX and eth0.xxx , configured virtually (wherein x represents por no. )

I am using the same configuration as mentioned above in /etc/network/interfaces file.

But when I reloading the service, its not coming when i give route command

below is the current configuration


auto lo
iface lo inet loopback

auto eth0.XXXX
iface eth0.XXXX inet static
address NW
netmask NM
gateway GW
vlan_raw_device eth0

auto eth0.XXX
iface eth0.XXX inet static
address NW
netmask NM
gateway GW

post-up ip route add <NW>/32 via <GW> dev eth0
post-up ip route add <NW>/32 via <GW> dev eth0

vlan_raw_device eth0

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

pl. help - that what is going wrong in this.
 
Old 05-26-2015, 03:13 PM   #2
grim76
Member
 
Registered: Jun 2007
Distribution: Debian, SLES, Ubuntu
Posts: 308

Rep: Reputation: 50
Looks like you are adding the routes to the lower device and not the eth0.XXX or eth0.XXXX devices where your IP communication would happen.
 
Old 05-27-2015, 01:22 AM   #3
schhabra
LQ Newbie
 
Registered: May 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
I already tried putting -
post-up ip route add <NW>/32 via <GW> dev eth0.xxx
post-up ip route add <NW>/32 via <GW> dev eth0.xxx

but not working
 
Old 05-27-2015, 08:34 AM   #4
grim76
Member
 
Registered: Jun 2007
Distribution: Debian, SLES, Ubuntu
Posts: 308

Rep: Reputation: 50
So if you run the commands that you have in the post-up do they run from the CLI manually on your interfaces?
 
Old 05-27-2015, 09:00 AM   #5
schhabra
LQ Newbie
 
Registered: May 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
yes, if I run command - "ip route add <NW>/32 via <GW> dev eth0.xxx" on terminal excluding (post-up), it gets added and shows when i run route -n
 
Old 05-27-2015, 12:55 PM   #6
grim76
Member
 
Registered: Jun 2007
Distribution: Debian, SLES, Ubuntu
Posts: 308

Rep: Reputation: 50
I don't think you need the vlan_raw_device setting. That might be throwing some things off. I have not seen this setting used before.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick question about persistent static routes and default gateway ghughes5669 Linux - Networking 1 04-23-2014 02:16 PM
add static routes to be persistent on reboot cjashu Linux - Server 2 03-18-2014 10:12 AM
persistent static routes agrana Slackware 4 03-24-2011 09:57 AM
Adding persistent static routes in Redhat.. [NISTnet installed...!] bala1987 Linux - Networking 2 05-26-2009 08:58 AM
persistent static routes, not so persistent Hewson Linux - Networking 4 04-27-2007 05:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration