All of lore.kernel.org
 help / color / mirror / Atom feed
* Adding listening ports
@ 2003-07-29 19:06 Richard Plana
  2003-07-29 21:06 ` Sebastian
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Plana @ 2003-07-29 19:06 UTC (permalink / raw)
  To: netfilter

Hi,

Because of (overly?) strict security policies at our company, one can 
only make TCP connections to ports 80 and 443. I was wondering if 
netfilter could be used to redirect packets destined for port 443 to the 
listening sshd daemon on port 22 on an external machine.

I tried "iptables -I RH-Lokkit-0-50-INPUT 5 -p tcp -m tcp --dport 443  
--syn -j ACCEPT" (I'm using RedHat's default config) and "iptables -t 
nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 
127.0.0.1:22" to do the actual routing, but that didn't seem to work:

$ ssh -p 443 localhost
ssh: connect to host localhost port 443: Connection refused

Suggestions would be appreciated.
-- 


*Richard Neal Plana, B.Sc., CCNA*
Lead Software Engineer
Zi Corp.



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

* RE: Adding listening ports
@ 2003-07-29 20:16 Daniel Chemko
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Chemko @ 2003-07-29 20:16 UTC (permalink / raw)
  To: Richard Plana, netfilter

The DNAT operation happens firstly so the INPUT rule needs to refer to
port 22 since the address/port mangle has already occurred.

Secondly, instead of DNAT, you could have used the redirect jump
instead.

-----Original Message-----
From: Richard Plana [mailto:rplana@zicorp.com] 
Sent: Tuesday, July 29, 2003 12:07 PM
To: netfilter@lists.netfilter.org
Subject: Adding listening ports

Hi,

Because of (overly?) strict security policies at our company, one can 
only make TCP connections to ports 80 and 443. I was wondering if 
netfilter could be used to redirect packets destined for port 443 to the

listening sshd daemon on port 22 on an external machine.

I tried "iptables -I RH-Lokkit-0-50-INPUT 5 -p tcp -m tcp --dport 443  
--syn -j ACCEPT" (I'm using RedHat's default config) and "iptables -t 
nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 
127.0.0.1:22" to do the actual routing, but that didn't seem to work:

$ ssh -p 443 localhost
ssh: connect to host localhost port 443: Connection refused

Suggestions would be appreciated.
-- 


*Richard Neal Plana, B.Sc., CCNA*
Lead Software Engineer
Zi Corp.




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

* RE: Adding listening ports
  2003-07-29 19:06 Adding listening ports Richard Plana
@ 2003-07-29 21:06 ` Sebastian
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian @ 2003-07-29 21:06 UTC (permalink / raw)
  To: 'Richard Plana', Netfilter Mailinglist

Hello...

You can also add "Port 443" to /etc/ssh/sshd_config or whatever your ssh
config file is.

Greets
Sebastian.


> -----Original Message-----
> From: netfilter-admin@lists.netfilter.org 
> [mailto:netfilter-admin@lists.netfilter.org] On Behalf Of 
> Richard Plana
> Sent: Tuesday, July 29, 2003 9:07 PM
> To: netfilter@lists.netfilter.org
> Subject: Adding listening ports
> 
> 
> Hi,
> 
> Because of (overly?) strict security policies at our company, one can 
> only make TCP connections to ports 80 and 443. I was wondering if 
> netfilter could be used to redirect packets destined for port 
> 443 to the 
> listening sshd daemon on port 22 on an external machine.
> 
> I tried "iptables -I RH-Lokkit-0-50-INPUT 5 -p tcp -m tcp 
> --dport 443  
> --syn -j ACCEPT" (I'm using RedHat's default config) and "iptables -t 
> nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 
> 127.0.0.1:22" to do the actual routing, but that didn't seem to work:
> 
> $ ssh -p 443 localhost
> ssh: connect to host localhost port 443: Connection refused
> 
> Suggestions would be appreciated.
> -- 
> 
> 
> *Richard Neal Plana, B.Sc., CCNA*
> Lead Software Engineer
> Zi Corp.
> 
> 
> 



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

end of thread, other threads:[~2003-07-29 21:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-29 19:06 Adding listening ports Richard Plana
2003-07-29 21:06 ` Sebastian
  -- strict thread matches above, loose matches on Subject: below --
2003-07-29 20:16 Daniel Chemko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.