OpenVZ Forum


Home » General » Support » SSH and IPTABLES
SSH and IPTABLES [message #33564] Wed, 22 October 2008 14:56 Go to next message
alfonsodiecko is currently offline  alfonsodiecko
Messages: 14
Registered: October 2008
Junior Member
Hi,
I have now create my own container with a Debian etch template. My problem is that the communication with ssh doesn’t work. My root server has only one public IP “217.172.182.14” and my OpenVZ container the “192.168.172.50” what in the configuration was added. I have add some rules into my IPtable script

iptables -A INPUT -p tcp --dport 10122 -j AKZEPTIEREN
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -A PREROUTING -d 217.172.182.14 -i eth0 -p tcp --dport 10122 -j DNAT --to-destination  192.168.172.50:22


But the Connection fails when I try to connect the “217.172.182.14:10122”. Are there some other necessary steps after the standard installation (like http://www.howtoforge.de/howto/installation-und-gebrauch-von -openvz-auf-debian-etch/) to make a connection with NAT possible ?
I would be very pleased for further information.

Regards Alfonso
Re: SSH and IPTABLES [message #33704 is a reply to message #33564] Sat, 01 November 2008 19:05 Go to previous message
mcarreira is currently offline  mcarreira
Messages: 30
Registered: February 2007
Member
I think you may need a FORWARD rule.
These are the lines my firewall script has to forward ssh to my ssh server:

iptables -t nat -A PREROUTING -i $ifINTERNET -p tcp --sport $UNPORTS --dport $PORT_SSH_EXTERNAL -j DNAT --to-destination $sSSHSERVER:22
iptables -A FORWARD -i $ifINTERNET -o $ifVENET0 -p tcp --sport $UNPORTS -d $sSSHSERVER --dport ssh -m state --state NEW -j ACCEPT

Previous Topic: Problem Upgrade from 2.4.21 to openvz 2.6.18
Next Topic: NATed GRE packets does not reach VETH (NAT,GRE,VETH)
Goto Forum:
  


Current Time: Sun Jul 28 00:19:31 GMT 2024

Total time taken to generate the page: 0.02728 seconds