Fedora Linux Support Community & Resources Center
  #1  
Old 23rd March 2009, 10:55 AM
andy2008 Offline
Registered User
 
Join Date: Feb 2009
Posts: 63
strange ip route problem

I have a strange problem on Fedora10.
I have two internet connections so I need to use the "ip route" command to share one of these connections inside a LAN. I created another table in /etc/iproute2/rt_tables and using ip route I added a default via for this table.

Then using iptables with mark and SNAT I share the connection inside the LAN.
Everything went smoothly for about 2 weeks... than all of a sudden my clients start complaining that the internet connection isn't working. So after a few minutes of research I discovered that the default gateway I added for that table I created was GONE.
Does anyone know what the problem is and how could a route disappear just like that?
Reply With Quote
  #2  
Old 23rd March 2009, 04:21 PM
andy2008 Offline
Registered User
 
Join Date: Feb 2009
Posts: 63
Well, I solved part of the puzzle. I checked /var/log/messages and noticed that the PPPoE connection had a time out and restarted, thus losing it's default gateway I had added in it's table.

Now, my big question is this: how to make the pppoe connection automatically add the ip route in that specific table if, let's say, something like this happens again.
I did the dumb thing and added the line "ip route add table pppoe default via xx.xx.xx.xx dev ppp0" in the /etc/sysconfig/network-scripts/ifcfg-ppp0 file but of course it did not work.
Does anyone have any thought on this?
Reply With Quote
  #3  
Old 23rd March 2009, 04:58 PM
blittle Offline
Registered User
 
Join Date: Jun 2007
Posts: 397
setup the static routes you want in /etc/sysconfig/static-routes one route per line. For those routes not associated with a transient interface you prefix the route with "any" so that it is brought up at boot time. All the options of the "route" command are available, but omit the leading hyphen in front of "-net" or "-host".

an example /etc/sysconfig/static-routes :

any net 10.10.10.0 netmask 255.0.0.0 gw 192.168.1.1

(from the redhat mailing list)
__________________
My Smolt Profile
Reply With Quote
  #4  
Old 23rd March 2009, 08:09 PM
andy2008 Offline
Registered User
 
Join Date: Feb 2009
Posts: 63
I added the route in the static-routes file (I had to create this file cause there isn't such a file in Fedora10).
I removed the MARK from the iptables SNAT
I restarted the network service but it doesn't work.
Users from LAN now download via PPPoE but the upload goes through the linux default gateway, which is the other internet connection... which is exactly what happened before using MARK and creating another table with the ppp default via.
Reply With Quote
  #5  
Old 24th March 2009, 06:29 AM
andy2008 Offline
Registered User
 
Join Date: Feb 2009
Posts: 63
So I must return to my initial question. Is there any way to run this command:
"ip ro add table pppoe default via xx.xx.xx.xx dev ppp0" whenever I or the system restarts the pppoe connection?
Reply With Quote
  #6  
Old 24th March 2009, 07:27 PM
andy2008 Offline
Registered User
 
Join Date: Feb 2009
Posts: 63
I discovered the solution to this problem and because I hate it when people on forums forget to post the solution once they find it, I refuse to be one of those guys.
So, all I had to do was create the file /etc/ppp/ip-up.local, then run the command "chmod 755 ip-up.local"
and add inside this file whatever command I want the pppoe to run after a successful connection.
So I added my ip route command and now everytime I restart the pppoe connection, the route in my pppoe table appears automatically.
Reply With Quote
Reply

Tags
problem, route, strange

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
strange association issue with AP, cant route packets geek1234 Servers & Networking 2 13th December 2007 05:22 PM
Strange route dnar Using Fedora 1 28th July 2006 01:45 PM
problem with route after upgrading davidbrohall Servers & Networking 6 19th June 2005 05:47 PM
Vpn Client Route Problem hal Servers & Networking 0 2nd December 2004 03:06 PM


Current GMT-time: 23:04 (Tuesday, 18-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat