Possible to have 2 gateways at once in routing table?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Possible to have 2 gateways at once in routing table?
I have slackware version 7 and I am trying to convert my internet connection from dialup to DSL. I want both dialup and DSL working at the same time, so when my domain name gets re-associated with my new IP address, there will be no interruption in connectivity.
Everything works just fine for my dial up static IP connection. This box was my primary gateway for my LAN. I just bought a linksys router to connect to my DSL and now I have that setup for my default gateway for my LAN. I have already begun forwarding ports from my linksys router to my slackware box (for web pages and ftp etc..). Internally, I can either type in my old static IP / domain name OR my new static IP and the router will forward my requests to the slackware box. However, externally if I type in my old static IP / domain name nothing answers. But if I type in my new IP address the slackware box answers. I'm thinking it might be a routing gateway problem, because in my /etc/ppp/ip-up script which originally looked like:
#!/bin/bash
#
# Script which handles the routing issues as necessary for pppd
# Only the link to Newman requires this handling.
#
# When the ppp link comes up, this script is called with the following
# parameters
# $1 the interface name used by pppd (e.g. ppp3)
# $2 the tty device name
# $3 the tty device speed
# $4 the local IP address for the interface
# $5 the remote IP address
# $6 the parameter specified by the 'ipparam' option to pppd
#
/sbin/route add -net 0.0.0.0 gw $5 dev $1
exit 0
I added a new line for another gateway:
#!/bin/bash
#
# Script which handles the routing issues as necessary for pppd
# Only the link to Newman requires this handling.
#
# When the ppp link comes up, this script is called with the following
# parameters
# $1 the interface name used by pppd (e.g. ppp3)
# $2 the tty device name
# $3 the tty device speed
# $4 the local IP address for the interface
# $5 the remote IP address
# $6 the parameter specified by the 'ipparam' option to pppd
#
/sbin/route add -net 0.0.0.0 gw $5 dev $1
/sbin/route add -net 0.0.0.0 gw 192.168.1.100 dev eth0
exit 0
But then the first connection via dialup doesn't work when I externally ping the dialup's IP.
Any suggestions on how I can get the slackware box to accept connections either from the linksys router OR the dialup connection? It seems I can either have one or the other.
I think I figured it out... I changed my /etc/ppp/ip-up file to:
#!/bin/bash
#
# Script which handles the routing issues as necessary for pppd
# Only the link to Newman requires this handling.
#
# When the ppp link comes up, this script is called with the following
# parameters
# $1 the interface name used by pppd (e.g. ppp3)
# $2 the tty device name
# $3 the tty device speed
# $4 the local IP address for the interface
# $5 the remote IP address
# $6 the parameter specified by the 'ipparam' option to pppd
#
/sbin/route add -net 0.0.0.0 gw $5 dev $1
/sbin/route add -host 0.0.0.0 gw 192.168.1.100 eth0
exit 0
Basically I added the line with the -host option. But I don't really understand why it works... If anyone can help me out, I'd appreciate it!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.