LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-03-2006, 01:12 PM   #1
doctorcisco
Member
 
Registered: Nov 2003
Posts: 70

Rep: Reputation: 17
GRE Tunnel with DHCP Address


Hello All,

I'm running a 2.4 Linux kernel on a Linksys router (OpenWRT), and need to set up a GRE tunnel from this box to a Cisco router. I've installed the kernel package on the Linky. ip tunnel mytunnel mode gre local 1.2.3.4 remote 2.3.4.5 ttl 32 (etc etc) works just fine.

Here's my problem: the IP address on my DSL line changes about every 2 days. With this configuration, the GRE tunnel goes down until I manually update the config on both ends.

Is there any way to use an interface name or DNS name instead of an IP for the "remote" subcommand? (Analagous to "ip unnumbered int vlan1" on a Cisco box?)

Barring that, is there a way to get Linux to:

a) Notice a changed IP (maybe a cron job to whatismyip.com or something.)

b) Automagically reconfigure its GRE tunnel whenever it decides its IP address has changed?

I can use tcl/expect on a server in the LAN to go update the Cisco. Any way to get the Linksys to do the job by itself?

Thanks,
doctorcisco
 
Old 07-16-2006, 09:37 PM   #2
jserink
LQ Newbie
 
Registered: Jul 2006
Posts: 2

Rep: Reputation: 0
Changing IP address...

Hello Doc Cisco:

Comments below:

Quote:
Originally Posted by doctorcisco
Hello All,

I'm running a 2.4 Linux kernel on a Linksys router (OpenWRT), and need to set up a GRE tunnel from this box to a Cisco router. I've installed the kernel package on the Linky. ip tunnel mytunnel mode gre local 1.2.3.4 remote 2.3.4.5 ttl 32 (etc etc) works just fine.

Here's my problem: the IP address on my DSL line changes about every 2 days. With this configuration, the GRE tunnel goes down until I manually update the config on both ends.

Is there any way to use an interface name or DNS name instead of an IP for the "remote" subcommand? (Analagous to "ip unnumbered int vlan1" on a Cisco box?)

Barring that, is there a way to get Linux to:

a) Notice a changed IP (maybe a cron job to whatismyip.com or something.)
Yes.

b) Automagically reconfigure its GRE tunnel whenever it decides its IP address has changed?
Yes.

I can use tcl/expect on a server in the LAN to go update the Cisco. Any way to get the Linksys to do the job by itself?
On Debian, there is a directory called /etc/ppp, in this directory are two other directories, ip-up.d and ip-down.d. There are man pages for this stuff but to cut to the chase, anytime that PPPd brings up the ppp interface, all the scripts in /etc/ppp/ip-up.d will be run in lexical order, write a bash with a name such that it is run after all the other scipts in this directory to bring up your tunnel.
Wirte a bash script to bring down the tunnel and delete the tunnal with an appropriate name to run after all the scripts in the /etc/ppp/ip-down.d directory.

Now, these ppp entries "may" be particular to Debian but each distro will have equivalent things so just look around your directories, you find what you need.

That should solve your problems.

Cheers,
john
Thanks,
doctorcisco
 
  


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
GRE tunnel with multiple sessions(based on key) sureshchandak Programming 1 06-23-2006 01:42 PM
need to create one gre tunnel with different sessions sureshchandak Linux - Kernel 1 06-23-2006 01:41 PM
gre tunnel with keys for different sessions sureshchandak Linux - Networking 0 06-13-2006 12:20 PM
gre tunnel problem sixone Linux - Networking 3 05-30-2005 11:57 AM
Question about a GRE Tunnel zerounu Linux - Networking 1 03-09-2004 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:43 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
Open Source Consulting | Domain Registration