Skip to contentSkip to conversation

Help!!!

DISCUSSION radu 3 participants 4 messages Jun 23, 2005

lore
Share & tools
lore

radu

author
#0 lore raw

Hello all,

My networck config:

Internet -> linux box -> My PC(192.168.50.101)

linux box
eth0 local 192.168.50.0/24
eth1 Internet

my iptables config:

iptables -P FORWARD DROP
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 4662 -j DNAT --to 192.168.50.101 iptables -I FORWARD -d 192.168.50.101 -p tcp --dport 4662 -j ACCEPT iptables -I FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -I FORWARD -s 192.168.50.101 -j ACCEPT
iptables -t nat -I POSTROUTING -o eth1 -j MASQUERADE

why I'm receiving on my PC packages with external ip on 4690,4544,4581.. ports???

Signature · 2 lines
Best regards,
 Radu                          mailto:[email protected]
#1 lore raw
Quoted 2 lines · radu

why I'm receiving on my PC packages with external ip on 4690,4544,4581.. ports???

That would be me. I was trying to lure you into posting something on this list. ;)

Quoted 9 lines

Internet -> linux box -> My PC(192.168.50.101)

linux box
eth0 local 192.168.50.0/24
eth1 Internet

my iptables config:

iptables -P FORWARD DROP

good

Quoted 2 lines

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 4662 -j DNAT --to 192.168.50.101

4662/tcp packet arriving at the external interface should have their destination changed to Radu's computer ...

Quoted 2 lines

iptables -I FORWARD -d 192.168.50.101 -p tcp
--dport 4662 -j ACCEPT

... and those packets should be accepted.

Quoted 2 lines

iptables -I FORWARD -i eth1 -o eth0 -m state
--state ESTABLISHED,RELATED -j ACCEPT

Any replies to established or related connections arriving at the external interface, destined to the internal interface, should be accepted.

This is surely the rule letting those in. Check the connection tracking table when you see them come in.

Signature · 2 lines
    mail to this address is discarded unless "/dev/rob0"
    or "not-spam" is in Subject: header
author
#2 lore raw

Hello /dev/rob0,

ok.
I modify the rule

Quoted 2 lines
Quoted 2 lines

iptables -I FORWARD -i eth1 -o eth0 -m state
--state ESTABLISHED,RELATED -j ACCEPT

in

Quoted 2 lines
Quoted 2 lines

iptables -I FORWARD -i eth1 -o eth0 -d 192.168.50.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT

and this don't work...

[23/Jun/2005 16:00:34] "Network" action = 'denied', descr = 'Unopened port', proto = 6, laddr = 192.168.50.101, raddr = 217.132.77.214, lport = 2276, rport = 4662, direc = 'in', ruleId = 0, proc = 'N/A'

Q. why rule don't work ?
Q. why this packages with flag ESTABLISHED come to me?

Thursday, June 23, 2005, 3:14:24 PM, you wrote:

Quoted 2 lines · radu
Quoted 2 lines

why I'm receiving on my PC packages with external ip on 4690,4544,4581.. ports???

dr> That would be me. I was trying to lure you into posting something on dr> this list. ;)

Quoted 9 lines
Quoted 9 lines

Internet -> linux box -> My PC(192.168.50.101)

linux box
eth0 local 192.168.50.0/24
eth1 Internet

my iptables config:

iptables -P FORWARD DROP

dr> good

Quoted 2 lines
Quoted 2 lines

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 4662 -j DNAT --to 192.168.50.101

dr> 4662/tcp packet arriving at the external interface should have their dr> destination changed to Radu's computer ...

Quoted 2 lines
Quoted 2 lines

iptables -I FORWARD -d 192.168.50.101 -p tcp
--dport 4662 -j ACCEPT

dr> ... and those packets should be accepted.

Quoted 2 lines
Quoted 2 lines

iptables -I FORWARD -i eth1 -o eth0 -m state
--state ESTABLISHED,RELATED -j ACCEPT

dr> Any replies to established or related connections arriving at the dr> external interface, destined to the internal interface, should be dr> accepted.

dr> This is surely the rule letting those in. Check the connection tracking dr> table when you see them come in.

Signature · 2 lines
Best regards,
 radu                            mailto:[email protected]
#3 lore raw
In reply to radu
Quoted 10 lines · radu

Hello all,

My networck config:

Internet -> linux box -> My PC(192.168.50.101)

linux box
eth0 local 192.168.50.0/24
eth1 Internet

Quoted 8 lines

my iptables config:

iptables -P FORWARD DROP
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 4662 -j DNAT --to 192.168.50.101 iptables -I FORWARD -d 192.168.50.101 -p tcp --dport 4662 -j ACCEPT iptables -I FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -I FORWARD -s 192.168.50.101 -j ACCEPT
iptables -t nat -I POSTROUTING -o eth1 -j MASQUERADE

a cleaned-up version of your script:

  iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 4662 \
    -j DNAT --to 192.168.50.101
  iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

  iptables -P FORWARD DROP
  iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
  iptables -A FORWARD -p tcp -d 192.168.50.101 --dport 4662 -j ACCEPT
  iptables -A FORWARD -s 192.168.50.101 -j ACCEPT

-j

--
"Meg: Oh no! I'm missing the news!
Peter: We all miss The News, Meg, but Huey Lewis needs time to create, and we need to be patient."
--Family Guy