LinuxQuestions.org
Register a domain and help support LQ
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-12-2009, 07:40 PM   #1
foilpan
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Rep: Reputation: 0
static routing question (cent os 4.x server)


i have a client who has a need to route traffic from one server back to the lan, apparently, and wants to do it via static routes. i most likely don't have all the details on this, but it seems something like this (fictitious IPs):

cable modem/gateway: 180.0.0.10
-> hub
server: 180.0.0.90
router: 180.0.0.89
router lan ip: 192.168.40.1
lan range: 192.168.40.0/24

the cable modem connects to a small hub with at least the router and this one server attached.

client wants to set a static route from the server (180.0.0.90) to the lan IP of the router (192.168.40.1).

first, is this even possible?

second, is it advisable?

i tried looking at setting a static route with something like the following but am hesitant to leave it in place. i'm not even convinced it will work.

Code:
ip route add 192.168.40.0/24 via 180.0.0.10 dev eth0
i've also looked into using /etc/sysconfig/network-scripts/route-eth0 to do this with similar parameters.

thanks for any tips.
 
Old 04-13-2009, 06:15 AM   #2
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
hi foilpan,

ok, from your provided information here
Quote:
cable modem/gateway: 180.0.0.10
-> hub
server: 180.0.0.90
router: 180.0.0.89
router lan ip: 192.168.40.1
lan range: 192.168.40.0/24
actually - your server is at the internet 180.0.0.0, hence there is no need to create a static route to reach it from your router (or LAN) perspective - because it has been included on the default routing table 0.0.0.0/0 in the router, and both the router and the server are still on the same subnet (i assume).

and you cant directly accessing LAN behind NAT router from the servers view - so, i hope the answer is clear.

HTH.
 
Old 04-13-2009, 08:15 AM   #3
foilpan
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Original Poster
Rep: Reputation: 0
thanks for the reply. as i suspected, i didn't have all the details, but it still can't happen the way they want. aside from not being able to route to RFC 1918 networks from the WAN side, there are some other things in the mix.
 
Old 04-13-2009, 10:39 AM   #4
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
hi,

Quote:
but it still can't happen the way they want.

aside from not being able to route to RFC 1918 networks from the WAN side
no, they are correct. it is doable - but from the server and LAN/router perspective it is useless.

by using overlapping NAT - or let us say iptables DNAT in linux - you can make that server which resides on the net "become" the member of the LAN - but, that only goes from the server perspective.

so the route probably :
server :
ip route LAN next-hop via router

router :
iptables -t nat -I POSTROUTING here ...
iptables -t nat -I PREROUTING here ...

LAN :
ip route 0/0 next-hop via router

so - from there you can see that it become useless
and, it really needs a special/careful design to do it.

HTH.

Last edited by rossonieri#1; 04-13-2009 at 10:42 AM.
 
Old 04-13-2009, 01:03 PM   #5
foilpan
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Original Poster
Rep: Reputation: 0
thanks, rossonieri#1. that makes a bit more sense, though i'm unsure of what the router/firewall is running and if it's capable.

regardless, i think the simpler approach would be to keep the server behind the firewall and otherwise resolve the issues that prompted them to place it outside in the first place. we'll see…

it's an interesting situation, nonetheless.
 
  


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
static routing between two networks verb Linux - Networking 3 07-04-2008 05:43 PM
Static IP Routing dojiep Linux - Networking 2 08-08-2006 07:42 AM
Static Routing Troubles Rundi Linux - Networking 2 07-16-2004 11:38 AM
An internet/routing/server question orange400 Linux - Networking 3 05-28-2004 08:07 AM
Static Ip's and Routing Sarcha Linux - Networking 5 02-28-2003 08:19 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration