Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Routing Problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
adelante
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2003
Posts: 133
Location: South Africa - Johannesburg

PostPosted: Fri Sep 16, 2005 5:28 am    Post subject: Routing Problem Reply with quote

Hi, I seem to have a bit of a routing problem.

I have a server on my LAN, and an internet server, and there is a VPN setup between them.

LAN VPN IP = 192.168.1.223
LAN Server IP = 192.168.30.223
INTERNET VPN IP = 192.168.1.1
INTERNET Server IP = 209.xxx.xxx.xxx

Now I have setup iptables on the LAN server to POSTROUTE all 192.168.30.223:80 requests to 192.168.1.1:80 (ie: pushing all lan port 80 requests over the VPN to the Internet server)

My Problem is the routing of traffic back from the internet server over the vpn to the lan server.

To my knowledge, what is happening at the moment, is a request is coming to 192.168.30.223:80 and being forwarded to 192.168.1.1:80 correctly, but then 192.168.1.1 doesnt know what to do with the traffic, so it's passing it to it's default gateway, which is an internet router, and that doesnt know wtf to do with it either. (correct me if i am wrong)

How do I tell the Internet server that any traffic coming from the LAN server over the vpn, it must route back the same way it came?
Back to top
View user's profile Send private message
bigfunkymo
Apprentice
Apprentice


Joined: 23 Jan 2004
Posts: 237

PostPosted: Fri Sep 16, 2005 1:02 pm    Post subject: Reply with quote

what is the output of
Code:
# route -n

_________________
[No package... Grabbing a set.]
Back to top
View user's profile Send private message
adelante
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2003
Posts: 133
Location: South Africa - Johannesburg

PostPosted: Fri Sep 16, 2005 1:57 pm    Post subject: Reply with quote

Code:

Athena ~ # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.223   0.0.0.0         255.255.255.255 UH    0      0        0 tun0
209.212.xxx.xxx 0.0.0.0         255.255.255.240 U     0      0        0 eth0
209.212.xxx.xxx 0.0.0.0         255.255.255.240 U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         209.212.xxx.xxx 0.0.0.0         UG    0      0        0 eth0
Athena ~ #
Back to top
View user's profile Send private message
adelante
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2003
Posts: 133
Location: South Africa - Johannesburg

PostPosted: Fri Sep 16, 2005 2:08 pm    Post subject: Reply with quote

WOOHOO I GOT IT WORKING!!!

Code:

route add -net 192.168.1.1 netmask 255.255.255.255 gw 192.168.1.223
Back to top
View user's profile Send private message
bigfunkymo
Apprentice
Apprentice


Joined: 23 Jan 2004
Posts: 237

PostPosted: Fri Sep 16, 2005 2:53 pm    Post subject: Reply with quote

I assume that is from the "internet server"?

I don't really have a complete picture of what your configuration is, but I'm getting the vibe that you have something like this:

Code:

       A                               Router X                          B
 ----------------                   -----------------              -------------
|                |        ------   |                 |            |             |
| 192.168.30.223 |--LAN--|Switch|--| 192.168.30.1(?) |            |             |
| 192.168.1.223  |==VPN==|      |==|  (Not on VPN)   |====VPN=====| 192.168.1.1 |
|                |        ------   |                 |            |             |
 ----------------            |     |  <internet IF>  |--internet--| 209.x.x.x   |
                             |     |                 |            |             |
                             |      -----------------              -------------
   -----------------------------
   <The rest of 192.168.30.0/24>


Also, you didn't mention which VPN you were using.

If your setup is like how I described, then why not just put the VPN endpoint on Router X and just route traffic rather than trying to NAT, like you're doing now? Alternatively, you could make Box A into a router, but then you would have to add static routes to every host on 192.168.30.0/24--but if the already default router was the VPN endpoint, then there are no static routes necessary. All you have to do is add the route back to 192.168.30.0/24 via 192.168.1.223 from Box B and regular IP routing will handle it, no NAT required.
_________________
[No package... Grabbing a set.]
Back to top
View user's profile Send private message
adelante
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2003
Posts: 133
Location: South Africa - Johannesburg

PostPosted: Fri Sep 16, 2005 3:02 pm    Post subject: Reply with quote

Well this is my actually problem...

We might be moving all our internet servers from 1 hosting provider to another, now I need to come up with a way to have minimal downtime.

Now currently I have a Firewall server, which has like 10 internet ip's bound to it on eth0. eth1 has 192.168.0.1 and the rest of the servers are on the 192.168.0.0/24 network. Then I just NAT ip:port to the internal servers from the firewall.

So what I was thinking of doing while dns changes and stuff, was to move all our servers to a new location, and setup vpn's from the firewall to the servers at the new location, then instead of doing the natting to the internal 192.168.0.0/24 i could push it through the vpn connections.

Unless you have a better idea on how to make a migration from one provider to another? I wish I could keep the same IP addresses, but obviously that isnt an option...
Back to top
View user's profile Send private message
bigfunkymo
Apprentice
Apprentice


Joined: 23 Jan 2004
Posts: 237

PostPosted: Fri Sep 16, 2005 3:10 pm    Post subject: Reply with quote

for that situation, your idea doesn't seem so bad. I've never had to do such a migration myself, though.
_________________
[No package... Grabbing a set.]
Back to top
View user's profile Send private message
almackska
Tux's lil' helper
Tux's lil' helper


Joined: 16 Sep 2005
Posts: 112

PostPosted: Sat Sep 24, 2005 10:09 am    Post subject: Reply with quote

I think i might have the same problem. this is my output when i " route -n "

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0


Is this enough info?
Back to top
View user's profile Send private message
evilben
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jun 2004
Posts: 128
Location: GA, USA

PostPosted: Tue Sep 27, 2005 8:55 pm    Post subject: Reply with quote

almackska, I can't tell what your issue is from just the table.

But adelante, I am having the exact problem that you had--packets come in from the vpn and then my machine doesn't know what to do with them--but you're solution didn't work for me. This is the routing table for the machine I need to access from afar:

Code:

tux incoming # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.1.20     172.16.1.1      255.255.255.255 UGH   0      0        0 tun0
172.16.1.1      *               255.255.255.255 UH    0      0        0 tun0
192.168.2.0     172.16.1.1      255.255.255.0   UG    0      0        0 tun0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
10.0.0.0        *               255.0.0.0       U     0      0        0 eth1
loopback        *               255.0.0.0       U     0      0        0 lo
default         10.59.1.1       0.0.0.0         UG    0      0        0 eth1


The top line is equivalent to the one you added, I think. 172.16.1.1 and 172.16.1.20 are the ends of my vpn, with 20 being the machine that is running the service. 192.168.2.* is the lan ip behind the machine with a static ip, and 192.168.0.* is the lan here.

I don't understand why your solution would work anyway--could you explain please (that is, if it didn't "just work"!)?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum