Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a cPanel installed dedicated box. All of the hosts thats are in it have their own IP addresses. However when I try to connect to bank's POS system, host uses server IP. Why do hosts not use their dedicated IPs for outbound connections?

By the way, CSF firewall also installed. Do I make an arrangement via CSF IPTABLES configuration? Would it be work?

share|improve this question
up vote 1 down vote accepted

Using iptables, you would set the SNAT address. I assume that each of these "hosts" are virtual machines like in Xen, OpenVZ, KVM, etc. You'd do something like this:

iptables -t nat -A POSTROUTING -p tcp -o eth0 -s -j SNAT --to
iptables -t nat -A POSTROUTING -p tcp -o eth0 -s -j SNAT --to
... and so on

The above assumes that the Internet port is eth0 and that your virtual host IP addresses are and and that their public IP addresses are and, respectively.

If your hosts are actually just virtualhosts in Apache or similar, that's a whole different ballgame.

share|improve this answer
host are not virtual machines they all located i a dedicated machine which managing by whm cpanel. So they all vhost on apache – user1066698 May 22 '12 at 8:10
thank you so much this is the solution for my problem. – user1066698 May 22 '12 at 12:52

Use iptables to SNAT source IP when connecting to bank's POS system.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.