LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-25-2013, 09:15 AM   #1
ne0shell
LQ Newbie
 
Registered: May 2010
Posts: 21

Rep: Reputation: 0
Add static route for Tunneled range?


I need to add a static route to survive restarts for a range that is connected via GRE tunnel.

All the examples I've found are not clear on if I need to create a route config in network scripts for the tunnel device or if it just entered on the eth device. (Centos 6),

Example:

range is 192.168.1.0/24
tunnel gateway is 10.0.0.1
tunnel device is "tun0"
active NIC is "eth0"

Command example given:
echo 192.168.1.0/24 via 10.0.0.1″ >> /etc/sysconfig/network-scripts/route-eth0

Is this correct or should it actually be:

echo 192.168.1.0/24 via 10.0.0.1″ >> /etc/sysconfig/network-scripts/route-tun0

?

(Even the examples here on LQO only show actual NICs, none show tunnel specific setting)
 
Old 04-26-2013, 12:06 AM   #2
ne0shell
LQ Newbie
 
Registered: May 2010
Posts: 21

Original Poster
Rep: Reputation: 0
I'll answer my own question since I figured it out.

The correct file would be for that actual device so in this example it should be:

/etc/sysconfig/network-scripts/route-tun0


The correct syntax for the entry in the file is not exactly what the echo command I found lists, it should be like this:

192.168.1.0/24 via 10.0.0.1 dev tun0

or, from the cli:

echo 192.168.1.0/24 via 10.0.0.1 >> /etc/sysconfig/network-scripts/route-tun0

Last edited by ne0shell; 04-26-2013 at 12:08 AM.
 
  


Reply

Tags
route


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
permanently add static route glock19 Linux - Networking 26 04-08-2013 04:07 AM
add static route with ip command mattholm Linux - Newbie 2 01-24-2013 05:11 PM
How to add a multicast static route in centOS4.4 dozer Linux - Networking 2 08-05-2011 03:09 PM
how to add static route for loopback interface. UltraSoul Linux - Software 4 04-12-2009 01:02 AM
Route add to ban IP range? astroboy5714 Linux - General 0 06-01-2004 03:07 PM


All times are GMT -5. The time now is 09:30 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration