LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-18-2012, 02:26 AM   #1
digitel
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Rep: Reputation: Disabled
Route creation when an interface is UP


Hi All,
New to this forum.
I need an help on this (if possible)


I have a machine establishing a VPN Tunnel with a remote server
When the connection is established, a new interface called Tunnel0 is created
I need a new route (like route add -n 192.168.100.0/24 -interface Tunnel0 )to be created automatically each time this Tunnel0 is UP
It would be nice the route was deleted once the Tunnel0 is DOWN or removed.

Any Hint ??

Thank you very much
 
Old 07-18-2012, 03:06 AM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Normally this is handled by the server side, where you configure it to push specific routes to clients.
Observer that in some vpn-client-apps there is a configure option to ignore routes sent by server.
First tip is to check that.

If that is not the case, routes are not pushed by server and you can't control the server, I can see 2 ways:
1) A script that first opens the tunnel and then adds the route.
2) A script that catches output from "ifconfig" and adds the route, if not present, when tunnel is up.

Not very difficult, first option being the easiest.
 
Old 07-18-2012, 10:47 AM   #3
digitel
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pingu View Post
I can see 2 ways:
1) A script that first opens the tunnel and then adds the route.
2) A script that catches output from "ifconfig" and adds the route, if not present, when tunnel is up.
2) is the best option from my side....

Since the VPN client rises the connection only when needed by operator (tunnel couldn't be activated even for days...) I suppose that script should run with no sense the whole day looking for Tunnel0 to be present...
Is there a lighter solution ?

Anyway, as I'm a newbie, does anybody have some script lines to suggest ??

Thank you very much
 
  


Reply


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
LXer: DeVeDe: the easy route to DVD creation on Linux LXer Syndicated Linux News 0 04-16-2012 12:03 AM
Route defaut Gateway to other Interface opensys Linux - Server 1 10-28-2011 02:12 AM
Multiple IP interface creation with down status sharpsanjay Linux - Networking 3 03-05-2010 12:38 AM
packet coming through one interface route out via another interface and SNAT also saiyen2002 Linux - Networking 2 09-14-2009 07:56 PM
User Interface Creation Tools Chryzmo Linux - Software 4 04-18-2004 10:12 PM


All times are GMT -5. The time now is 02:33 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration