firewall piercing for SQL and TS

Support for security such as Firewalls and securing linux
Post Reply
asounds
Posts: 4
Joined: 2006/03/24 20:19:16
Location: KS, USA

firewall piercing for SQL and TS

Post by asounds » 2006/03/24 20:25:53

I just setup a Centos 4.3 server. Using iptables and Webmin, I have a working firewall. Now, I need to be able to access an internal (masq'd) Windows server with Terminal Services and SQL. I had this working fine with IPChains on my old system, but can't figure it out with IPTables.

Below is what I currently have, and the forwarding is not working. I have copied examples I have found on the web, but nothing is working yet. I am sure there is something I am missing.

This server is also running email and DNS

Thanks

*nat
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o eth0 -j SNAT --to- (external IP)
-A PREROUTING -i eth0 -s 0/0 -p udp --dport 3389 -j DNAT --to-destination 192.168.0.2
-A PREROUTING -i eth0 -s 0/0 -p tcp --dport 3389 -j DNAT --to-destination 192.168.0.2
COMMIT
*mangle
:PREROUTING ACCEPT [55:7936]
:INPUT ACCEPT [52:7702]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [52:7702]
:POSTROUTING ACCEPT [52:7702]
COMMIT
*filter
:FORWARD ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -s 127.0.0.1 -j ACCEPT
-A INPUT -s 192.168.0.0/24 -i eth1 -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 10000 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 110 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -s 192.168.0.0/24 -i eth0 -j DROP
-A INPUT -s 127.0.0.1/255.0.0.0 -i eth0 -j DROP
-A INPUT -p udp -m udp -j DROP
-A INPUT -p tcp -m tcp --tcp-flags SYN,ACK,RST SYN -j DROP
-A FORWARD -i eth1 -o eth0 -j ACCEPT
-A FORWARD -i eth0 -o eth1 -p udp --dport 3389 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
-A FORWARD -i eth0 -o eth1 -p tcp --dport 3389 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
-A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
-A FORWARD -i eth1 -j ACCEPT
-A FORWARD -i lo -j ACCEPT
-A FORWARD -j LOG
-A INPUT -j LOG
COMMIT

asounds
Posts: 4
Joined: 2006/03/24 20:19:16
Location: KS, USA

Re: firewall piercing for SQL and TS

Post by asounds » 2006/03/24 21:49:51

Solved! Thanks.

Post Reply

Return to “CentOS 4 - Security Support”