HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=4)
-   -   Configuring Iptables (http://www.howtoforge.com/forums/showthread.php?t=46683)

Paladinemishakal 21st June 2010 09:52

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?


All times are GMT +2. The time now is 18:57.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.