weird Iptables problem
From: AY Xu (ay_xu_at_yahoo.com)
Date: 08/15/05
- Previous message: Unruh: "Re: is it possible to find the IP address from the MAC address ?"
- Next in thread: Eric Teuber: "Re: weird Iptables problem"
- Reply: Eric Teuber: "Re: weird Iptables problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 15 Aug 2005 08:39:42 -0700
RHEL3, Iptables 1.2.8-12. Two network interfaces(eth0 202.158.174.62,
eth1 192.168.0.9). Web server runs at 192.168.0.6, on port 80. Domain
www.chiaotai.com, DNS query to 202.158.174.62(FQDN).
------------- iptables script(part)--------------------------------
#!/bin/bash
ipt=/sbin/iptables
$ipt -F
$ipt -X
$ipt -Z
$ipt -t nat -F
IF="eth+"
INTIF="eth1"
EXTIF="eth0"
IPADDR="202.158.174.62/32"
## DNAT for Applications
# Web Server at port 80
$ipt -t nat -A PREROUTING -i $EXTIF -d $IPADDR -p tcp --dport 80 \
-j DNAT --to 192.168.0.6:80
...skip...
------------- iptables script(part)--------------------------------
I fail to access www.chiaotai.com from internet, and get bellow dump on
LINUX:
------------------------------
[root@mail etc]# tcpdump -i eth0 port 80 -n
tcpdump: listening on eth0
00:01:21.268141 222.69.230.70.1499 > 202.158.174.62.http: S
3071094721:3071094721(0) win 64240 <mss 1452,nop,nop,sackOK> (DF) [tos
0x60]
00:01:24.115554 222.69.230.70.1499 > 202.158.174.62.http: S
3071094721:3071094721(0) win 64240 <mss 1452,nop,nop,sackOK> (DF) [tos
0x60]
00:01:30.125042 222.69.230.70.1499 > 202.158.174.62.http: S
3071094721:3071094721(0) win 64240 <mss 1452,nop,nop,sackOK> (DF) [tos
0x60]
------------------------------
But if change iptables scripts to:
$ipt -t nat -A PREROUTING -i $EXTIF -d $IPADDR -p tcp --dport 10080 -j
DNAT --to 192.168.0.6:10080
(Sure change IIS port from 80 to 10080)
Then access address at www.chiaotai.com:10080, all is okay. Run
"netstat -an", no application takes up port 80.
>>From the tcpdump outputs, it looks like packets to dport 80 on eth0
were not forwarded to 192.168.0.6. But if change port to 10080, it's
okay! Don't know why, can anybody explain this?
Thanks for any help
Xu Zuoyin
- Previous message: Unruh: "Re: is it possible to find the IP address from the MAC address ?"
- Next in thread: Eric Teuber: "Re: weird Iptables problem"
- Reply: Eric Teuber: "Re: weird Iptables problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|