Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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 10.0.0.2 -j SNAT --to 5.0.0.2
iptables -t nat -A POSTROUTING -p tcp -o eth0 -s 10.0.0.3 -j SNAT --to 5.0.0.3
... and so on

The above assumes that the Internet port is eth0 and that your virtual host IP addresses are 10.0.0.2 and 10.0.0.3 and that their public IP addresses are 5.0.0.2 and 5.0.0.3, 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
1  
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

 
discard

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.