iptables forward - multiple external to multiple internal
[NOT SOLVED]
Hi This post is a follow up on http://www.linuxquestions.org/questi...etwork-608234/ , but since the question can stand for itself here a new thread. I'm trying to route multiple external IP's, configured on a host-server, to multiple internal IP's. Example: IP 74.74.74.145 to 192.168.2.2 IP 74.74.74.146 to 192.168.2.3 Internal gateway/hostip 192.168.2.1 My problem is that both ext. IP's are pointing to first internal IP (192.168.2.2). I've found different way's to route between network, but as far as i can tell all are all based on different interfaces. You can se below in my ifconfig, that both external IP's are configured as alias to the host IP. I'm stuck now. Any ideas? astbis Here my attempt: Code:
$IPTABLES --table nat --append POSTROUTING -o eth0 -j MASQUERADE Ifconfig: Code:
eth0 Link encap:Ethernet HWaddr 00:1D:92:39:34:84 |
Here's an example of how you could do it:
Code:
$IPTABLES -P FORWARD DROP EDIT: These rules will only work on a gateway/firewall setup in which you have a LAN and WAN interface. I just took a look at your previous post and it seems you're doing some virtual host stuff which I have no idea about. So if this isn't an old school gateway/firewall just ignore this - although it might still help you indirectly. |
Thanks it works like a charm.
|
It seems, that there are difficulties after all.
All traffic coming from externat sources to the internal/virtual machine works find and also the opposite way internal/virtual to external machine. The setup: Two internal machines. 192.168.2.2 / 74.74.74.145 192.168.2.3 / 74.74.74.146 I will try to explain the problem. I am on 74.74.74.145 and try to nmap the services on 74.74.74.146 i get the result of the hostmachine. So neither 74.74.74.145 or 74.74.74.146 answeres. Ping works fine. How can i get one internal/virtual machine to access the other internal without using the internal addresses? |
All times are GMT -5. The time now is 08:48 AM. |