Networking Forums

Networking Forums > Computer Networking > Linux Networking > BRidge Problem with DNAT

Reply
Thread Tools Display Modes

BRidge Problem with DNAT

 
 
buzzer
Guest
Posts: n/a

 
      07-14-2005, 03:37 PM
Hi

I've gat a problem that's outside my knowledge !
so I describe it to you :

I've get a linux gateway with 3 network iface : eth1 to the ethernet
adsl modem, eth0 to my network and ath0 is a Wireless card used as an
Access Point.

because I use linux-igd, I decide to create a bridge between the two LAN
iface in order to only deal with 2 iface !

so br0 is a bridge between eth0 and ath0.

I create iptables rules using br0 and eth1. those rules are simple :

Chain PREROUTING (policy ACCEPT)
target prot opt in out source destination
DROP all -- eth1 * 0.0.0.0/0 192.168.0.0/24
DROP all -- eth1 * 192.168.0.0/24 0.0.0.0/0

Chain POSTROUTING (policy ACCEPT)
target prot opt in out source destination
MASQUERADE all -- * eth1 192.168.0.0/24 0.0.0.0/0

Chain INPUT (policy DROP)
target prot opt in out source destination
INETIN all -- eth1 * 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- * * 192.168.0.0/24 0.0.0.0/0
ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
ACCEPT udp -- br0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:67

INETIN is my input filter for icmp and services (smtp http ...)
(unusefull to show it)

Chain FORWARD (policy DROP)
target prot opt in out source destination
ACCEPT all -- eth1 br0 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- br0 eth1 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- !eth1 !eth1 192.168.0.0/24 0.0.0.0/0

Chain OUTPUT (policy ACCEPT)
target prot opt in out source destination
INETOUT all -- * eth1 0.0.0.0/0 0.0.0.0/0

INETOUT is my output filter for services

At this point everything work fine.

When using linux-igd, rules are adding to PREROUTING with target DNAT :

target prot opt in out source destination
DNAT tcp -- eth1 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:5662
to:192.168.0.2:5662
DNAT udp -- eth1 * 0.0.0.0/0 0.0.0.0/0 udp dpt:5672
to:192.168.0.2:5672

so everything look nice! but if a dump packet on eth1, I can see this :

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
17:24:06.232072 IP 209.67.220.58.42895 > <my public ip>.5662: S
2699075760:2699075760(0) win 5840 <mss 1460,sackOK,timestamp 646790852
0,nop,wscale 0>
17:24:06.232757 IP 192.168.0.2.5662 > 209.67.220.58.42895: S
498211568:498211568(0) ack 2699075761 win 65535 <mss 1460,nop,wscale
0,nop,nop,timestamp 0 0,nop,nop,sackOK>
17:24:09.047839 IP 192.168.0.2.5662 > 209.67.220.58.42895: S
498211568:498211568(0) ack 2699075761 win 65535 <mss 1460,nop,wscale
0,nop,nop,timestamp 0 0,nop,nop,sackOK>
17:24:09.224100 IP 209.67.220.58.42895 > <my public ip>.5662: S
2699075760:2699075760(0) win 5840 <mss 1460,sackOK,timestamp 646791152
0,nop,wscale 0>
17:24:09.224407 IP <my public ip>.5662 > 209.67.220.58.42895: . ack
2699075761 win 65535 <nop,nop,timestamp 243533 646790852>
17:24:15.032186 IP 192.168.0.2.5662 > 209.67.220.58.42895: S
498211568:498211568(0) ack 2699075761 win 65535 <mss 1460,nop,wscale
0,nop,nop,timestamp 0 0,nop,nop,sackOK>
17:24:15.222856 IP 209.67.220.58.42895 > <my public ip>.5662: S
2699075760:2699075760(0) win 5840 <mss 1460,sackOK,timestamp 646791752
0,nop,wscale 0>

we can see that packet from LAN to NET are not NATing !!!
please help I'don't understand !

Buzzer
 
Reply With Quote
 
 
 
 
chris-usenet@roaima.co.uk
Guest
Posts: n/a

 
      07-15-2005, 10:33 AM
buzzer <buzzer_@t_free_point_fr> wrote:
> I've gat a problem that's outside my knowledge !


> we can see that packet from LAN to NET are not NATing !!!
> please help I'don't understand !


DNAT/MASQ is broken on recent kernels. See my very recent posts on
exactly this subject - including a pointer to a kernel patch

Chris
 
Reply With Quote
 
buzzer
Guest
Posts: n/a

 
      07-15-2005, 11:42 AM
chris-(E-Mail Removed) a écrit :
> buzzer <buzzer_@t_free_point_fr> wrote:
>
>>I've gat a problem that's outside my knowledge !

>
>
>>we can see that packet from LAN to NET are not NATing !!!
>>please help I'don't understand !

>
>
> DNAT/MASQ is broken on recent kernels. See my very recent posts on
> exactly this subject - including a pointer to a kernel patch
>
> Chris


you're right !

thank's a lot ! I go back to 2.6.9 (because of fedora) and all is fine !

regards

buzzer
 
Reply With Quote
 
 
 
Reply

Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DNAT translate source adress problem giorgi.tsuladze@gmail.com Linux Networking 1 12-05-2007 01:41 PM
DNAT cap Windows Networking 0 01-18-2006 01:04 PM
Problems with DNAT. P. Kenter Linux Networking 3 03-04-2005 04:07 PM
Iptables, DNAT, Forwarding? problem... Mitch Linux Networking 1 04-19-2004 04:23 PM
iptables DNAT problem from internal net Lothar Behrens Linux Networking 2 09-16-2003 07:49 AM



1 2 3 4 5 6 7 8 9 10 11