I have searched and searched and tried several different things and have not been able to fina solution.
Here's my situation:
node1 has 2 interfaces: eth0 (Public IP: 56.X.X.X), and eth1 (Private IP: 10.X.X.X)
node2 has 2 interfaces: eth0 (Public IP: 56.X.X.X), and eth1 (Private IP: 10.X.X.X)
Each node is running Ubuntu 10.04 LTS
From this setup node1 and node2 each have access to the internet but also connect to each other privately through a LAN.
What I want to accomplish is have node1 be a firewall and proxy server for node2 and many other nodes which I will deploy later. node1 will have the only access to the internet as I will disable eth0 on node2 so that node2 only has access to anything on its private network.
Simply put, how can I forward a www request that comes into node1 and on eth0 and forward it to node2 using eth1 while node2 will act as the webserver for that request?
After following the example below, here is my iptables -L:
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere 10.182.43.193 state NEW tcp dpt:www ACCEPT tcp -- anywhere 10.182.43.193 state NEW tcp dpt:https ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Here is my iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination DNAT all -- anywhere firewall to:10.182.43.193 Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination