Linux Netfilter discussions
 help / color / mirror / Atom feed
* (No subject header)
@ 2004-11-29 23:00 John Black
  2004-11-30  7:09 ` Brent Clark
  0 siblings, 1 reply; 8+ messages in thread
From: John Black @ 2004-11-29 23:00 UTC (permalink / raw)
  To: netfilter


 
I'm trying to setup a connection to port 3389 on a windows
2003 server.

my server 80.1.1.1

public ip address for windows server110.20.30.15

private ip address for windows server 192.168.0.15


is this right:
iptbles -t nat -A PREROUTING -d 80.1.1.1 -p tcp \
--dport 3389   -j DNAT --to 110.20.30.15:2289
iptbles -t nat -A PREROUTING -d 110.20.30.15 -p tcp\
--dport 3389   -j DNAT --to 192.168.0.15:2289

 



^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: (No subject header)
@ 2004-11-29 23:10 John Black
  0 siblings, 0 replies; 8+ messages in thread
From: John Black @ 2004-11-29 23:10 UTC (permalink / raw)
  To: netfilter




> You also need forward statment
> 
> iptables -A FORWARD -d 110.20.30.15 -p tcp --dport 2289 -j
> ACCEPT
would my server need to be in that forwarding statement?
iptables -A FORWARD -d 80.1.1.1 -p tcp --dport 3389 -j
ACCEPT

because i want to allow only this address 80.1.1.1 access to
this port.

> also in case it matters to you, you misspelled iptables
> below.
it was just a typeo



^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: (No subject header)
@ 2004-07-30  3:33 Jason Opperisano
  2004-07-30  4:00 ` John Black
  0 siblings, 1 reply; 8+ messages in thread
From: Jason Opperisano @ 2004-07-30  3:33 UTC (permalink / raw)
  To: John Black, netfilter

> iptables -t nat -A PREROUTING -d X.X.X.X -p tcp --dport 22 -j DNAT \
> -- to 192.168.1.89:2222 (ares)
>
> iptables -t nat -A PREROUTING -d X.X.X.X -p tcp --dport 22 -j DNAT \
> -- to 192.168.1.90:22222 (zeus)

If X.X.X.X in that first rule == X.X.X.X in that second rule--the second rule will never be matched.

You're giving netfilter 3 pieces of information to use to decide whether you have a match:

Protocol = TCP
Dest IP = X.X.X.X
Dest Port = 22

Given those conditions, how will it skip the first rule and make it to the second?

I would reverse your theory.  Let the hosts on the inside listen on the standard SSH port (TCP 22), and use different ports on the external side:

iptables -t nat -A PREROUTING -d X.X.X.X -p tcp --dport 2222 -j DNAT \
 --to 192.168.1.89:22 (ares)

iptables -t nat -A PREROUTING -d X.X.X.X -p tcp --dport 2223 -j DNAT \
 --to 192.168.1.90:22 (zeus)

And then use:	ssh -p 2222 X.X.X.X to connect to ares
And:			ssh -p 2223 X.X.X.X to connect to zeus

-j


^ permalink raw reply	[flat|nested] 8+ messages in thread
* (No subject header)
@ 2004-07-28 16:01 John Black
  2004-07-28 21:52 ` Antony Stone
  0 siblings, 1 reply; 8+ messages in thread
From: John Black @ 2004-07-28 16:01 UTC (permalink / raw)
  To: netfilter

I have a NAT question for everyone.  
 
At work i have a single static IP address that all of the
computers in the LAN uses for the outside world.  My
firewall is also acting as a dns server.  
 
Question 1: When i try to ssh in to a computer from the
outside world it follows the first rule.  But when i change
ssh to listen to a certain address and port it still
defaults to the first rule?
 
Question 2: if the DNS server was running on a server behind
the firewall would this help sloves this problem?
 
 
thanks
john


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-11-30  7:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-29 23:00 (No subject header) John Black
2004-11-30  7:09 ` Brent Clark
  -- strict thread matches above, loose matches on Subject: below --
2004-11-29 23:10 John Black
2004-07-30  3:33 Jason Opperisano
2004-07-30  4:00 ` John Black
2004-07-28 16:01 John Black
2004-07-28 21:52 ` Antony Stone
2004-07-30  3:09   ` John Black

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox