LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-18-2008, 05:58 PM   #1
wastingtime
Member
 
Registered: Sep 2004
Posts: 86

Rep: Reputation: 17
can I setup a personal route through a server to a gateway using iptables


I would like to setup my machine such that it uses another non-dedicated server as a route to the network's gateway.

On my machine I want to setup the default gateway to be the other server.
On that server I want to set routing such that any packets from my machine whose destination is not that server will be forwarded to the actual gateway.

The motivation for this setting is that direct communication between the gateway and my machine is very slow, but communication between my machine and that server, and between that server and the gateway, is really fast.
 
Old 04-20-2008, 07:41 PM   #2
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35
The cleanest way to do this is to cut the slow link between your machine and the gateway, and then set your default route to point at the "other machine". If you fail to cut your slow link, you may be able to send packets outward through the fast path, but the replies will very likely return along the slow path. (It's a bummer, but this communication stuff goes both ways.)

The down side of this is that you will now be dependent on the "other machine" to be up in order to get connectivity to the rest of the world. A workaround is to write yourself a script that sets the slow link down and makes the default route change, and a corresponding one that reverses these steps. It's not pretty, but will save you some typing.

A more complex way to achieve somewhat the same result is to learn about routing protocols, and to get that set up on your machine, the "other machine" and the gateway. If all three are participants in the routing protocol, you might be able to tweak the parameters so that you could leave both links up and failover would be automatic, but I guess that is a good deal of work. For starters, you will need to use a protocol that is more complex than RIP, so that you can get the protocol to consider link speeds as well as the number of hops. Depending on your network arrangement, this possibly means using OSPF, BGP, or something else.

Good luck.
 
  


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
New to Linux, need to setup a firewall/gateway server. ChildOfThunder LinuxQuestions.org Member Intro 1 10-19-2007 08:19 AM
Route mail through personal server jantman Linux - Networking 3 11-30-2006 05:44 PM
IPTABLES How to access to web server on gateway from LAN? kozaki Linux - Networking 4 08-26-2005 11:27 AM
My gateway can't route michaelsanford Linux - Networking 0 04-20-2005 05:05 PM
iptables setup for server pitt30 Linux - Security 1 04-21-2004 10:19 AM

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

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

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