niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » Linux » networking
Two routers, one LAN...
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
JKB
*nix forums beginner


Joined: 26 Apr 2005
Posts: 45

PostPosted: Tue Feb 15, 2005 2:52 pm    Post subject: Two routers, one LAN... Reply with quote

Hello,

I'm trying to add a DSL line on my server.

DSL---ROUTER0---eth2 (192.168.1.1) thibon
DSL---ROUTER1---eth0 (192.168.254.1) kant
ethernet--------eth1 (192.168.0.128) bergson

All services have to be routed by eth0 (http, https, smtp, pop3s,
imaps...) except the source ports 3000 and 3001 when they come
from 192.168.0.130.

When the destination ports are 3000 or 3001 and come from eth2, I
want to forward them at 192.168.0.130.

My configuration is :
Destination Gateway Genmask Flags Metric Ref Use
Iface
wan0 * 255.255.255.0 U 0 0 0 eth2
localnet * 255.255.255.0 U 0 0 0 eth1
wan1 * 255.255.255.0 U 0 0 0 eth0
default 192.168.254.254 0.0.0.0 UG 0 0 0 eth0

Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT tcp -- anywhere thibon tcp dpt:3000 to:192.168.0.130
DNAT tcp -- anywhere thibon tcp dpt:3001 to:192.168.0.130
DNAT tcp -- anywhere kant tcp dpt:8000 to:192.168.0.130:8080
DNAT tcp -- alain.astelys.fr anywhere tcp spt:3000 to:192.168.1.254
DNAT tcp -- alain.astelys.fr anywhere tcp spt:3001 to:192.168.1.254

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- localnet/24 anywhere (eth0)
MASQUERADE all -- localnet/24 anywhere (eth2)

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

kant:8000 is forwarded on 192.168.0.130:8080 without any trouble.

When I try to initialize a connection to thibon:3000, I can see a
paquet on eth2, but no one on the lan. My server does not forward
this paquet. Why ?

For information, this is my /var/lib/iptables/active :

# Generated by iptables-save v1.2.11 on Mon Feb 14 14:58:07 2005
*mangle
:PREROUTING ACCEPT [7625:1093924]
:INPUT ACCEPT [5993:588052]
:FORWARD ACCEPT [1574:494364]
:OUTPUT ACCEPT [5296:1335062]
:POSTROUTING ACCEPT [6880:1831901]
COMMIT
# Completed on Mon Feb 14 14:58:07 2005
# Generated by iptables-save v1.2.11 on Mon Feb 14 14:58:07 2005
*filter
:INPUT ACCEPT [9878:939309]
:FORWARD ACCEPT [3392:887746]
:OUTPUT ACCEPT [8879:2794234]
COMMIT
# Completed on Mon Feb 14 14:58:07 2005
# Generated by iptables-save v1.2.11 on Mon Feb 14 14:58:07 2005
*nat
:PREROUTING ACCEPT [333:47996]
:POSTROUTING ACCEPT [195:17389]
:OUTPUT ACCEPT [195:17389]
[15:900] -A PREROUTING -d 192.168.1.1 -p tcp -m tcp --dport 3000 -j DNAT --to-destination 192.168.0.130
[0:0] -A PREROUTING -d 192.168.1.1 -p tcp -m tcp --dport 3001 -j DNAT --to-destination 192.168.0.130
[0:0] -A PREROUTING -d 192.168.254.1 -p tcp -m tcp --dport 8000 -j DNAT --to-destination 192.168.0.130:8080
[0:0] -A PREROUTING -s 192.168.0.130 -p tcp -m tcp --sport 3000 -j DNAT --to-destination 192.168.1.254
[0:0] -A PREROUTING -s 192.168.0.130 -p tcp -m tcp --sport 3001 -j DNAT --to-destination 192.168.1.254
[18:1423] -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth0 -j MASQUERADE
[18:1423] -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth2 -j
MASQUERADE
COMMIT
# Completed on Mon Feb 14 14:58:07 2005

Thanx in advance,

JKB
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Fri Jan 09, 2009 12:56 am | All times are GMT
navigation Forum index » *nix » Linux » networking
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Can't understand why "no more routers" Jason Lixfeld Exim 2 Sat Jul 01, 2006 3:01 pm
No new posts Terminal servers: which is better cyclades or cisco routers? peelmanu@yahoo.com networking 2 Fri Jun 02, 2006 11:44 pm
No new posts passing packets though routers Hactar networking 0 Mon May 29, 2006 7:21 pm
No new posts Feature request - getting a result from redirect routers ... Stanislaw Halik Exim 2 Sun May 21, 2006 8:30 pm
No new posts Tell me what is bridge mode and half bridge mode of adsl ... saeedkhan75@gmail.com networking 0 Wed Mar 29, 2006 11:06 am

Loans | Live mortgage rates | Debt Consolidation | Remortgages | Brazilian Property
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1373s ][ Queries: 16 (0.0683s) ][ GZIP on - Debug on ]