OpenVZ Forum


Home » General » Support » *SOLVED* ports and port forwarding
Re: ports and port forwarding [message #10191 is a reply to message #10172] Mon, 12 February 2007 10:44 Go to previous messageGo to previous message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

I will help you this time, but I want to notice, that your question is not OpenVZ related. Therefore this is not the right place where to ask such questions. So, don't be offended on lack of answers on your post.

I will explain everything, assuming that you use RedHat/CentOS. For other distributions it shoold not be much different. So, if iptables is installed on your node, you should create file /etc/sysconfig/iptables with the following contents:

# Generated by iptables-save v1.2.11 on Mon Feb 12 13:04:04 2007
*nat
:PREROUTING ACCEPT [1033:152955]
:POSTROUTING ACCEPT [6:649]
:OUTPUT ACCEPT [5:589]
-A PREROUTING -d 192.168.3.184 -i eth1 -p tcp -m tcp --dport 22 -j ACCEPT
-A PREROUTING -d 192.168.3.184 -i eth1 -j DNAT --to-destination 10.0.0.5
-A POSTROUTING -s 10.0.0.5 -o eth1 -j SNAT --to-source 192.168.3.184
COMMIT
# Completed on Mon Feb 12 13:04:04 2007
# Generated by iptables-save v1.2.11 on Mon Feb 12 13:04:04 2007
*mangle
:PREROUTING ACCEPT [18349:1826391]
:INPUT ACCEPT [17920:1776389]
:FORWARD ACCEPT [17:3326]
:OUTPUT ACCEPT [7922:1202714]
:POSTROUTING ACCEPT [7939:1206040]
COMMIT
# Completed on Mon Feb 12 13:04:04 2007
# Generated by iptables-save v1.2.11 on Mon Feb 12 13:04:04 2007
*filter
:INPUT ACCEPT [17920:1776389]
:FORWARD ACCEPT [17:3326]
:OUTPUT ACCEPT [7922:1202714]
COMMIT


192.168.3.184 - IP address of HN
10.0.0.5 - IP address of VE
22 - port, which sshd is running on. According to your messafe it is 8091 for you.

Then do
# service iptables restart


For further information read manuals on netfilter.org
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: *SOLVED* diskspace no more than 40 GB
Next Topic: VPS -> HN having problems communicating
Goto Forum:
  


Current Time: Fri Sep 13 23:17:31 GMT 2024

Total time taken to generate the page: 0.04726 seconds