Configuring Iptables
Hi All,
I have a problem with configuring iptables. I have the following servers setup in a cloud environment:
Server #1
eth0
IP: 109.123.94.15
GW: 109.123.94.1
eth0:1
IP: 10.0.2.139
Route:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.2.0 * 255.255.255.0 U 0 0 0 eth0
109.123.94.0 * 255.255.255.0 U 0 0 0 eth0
default gw64-fastest.uk 0.0.0.0 UG 0 0 0 eth
Server #2
eth0
IP: 109.123.98.115
GW: 109.123.98.1
eth0:1
IP: 10.0.2.191
Route:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.2.0 * 255.255.255.0 U 0 0 0 eth0
109.123.98.0 * 255.255.255.0 U 0 0 0 eth0
default gw64-fastest.uk 0.0.0.0 UG 0 0 0 eth
As this setup is residing in a cloud environment, it has a defined set of route which I cannot change and I cannot add another network adapter (eg. eth1). Also whenever I added a gateway to the eth0:1 of Server #2, the server is not stable and will refuse connections after a while.
What I want to do here is:
1. setup iptables in Server #1 to act as the gateway for Server #2.
2. setup iptables in Server #2 to block all port except SSH and internally to route all traffic to exit via Server #1.
Can anyone show me what I need to put into the iptables rules?
|
Recent comments
1 day 8 hours ago
1 day 11 hours ago
1 day 12 hours ago
1 day 13 hours ago
1 day 15 hours ago
1 day 16 hours ago
1 day 18 hours ago
2 days 10 hours ago
2 days 10 hours ago
2 days 14 hours ago