View Single Post
  #1  
Old 21st June 2010, 08:52
Paladinemishakal Paladinemishakal is offline
Junior Member
 
Join Date: Jan 2008
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
Default 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?
Reply With Quote
Sponsored Links