Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
setting up a nat box
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Moszer
n00b
n00b


Joined: 12 Aug 2003
Posts: 8

PostPosted: Tue Dec 09, 2003 3:40 am    Post subject: setting up a nat box Reply with quote

Hello,

I'm setting up a nat box for the first time, I was just wondering if anyone saw any potential problems with the rules I've used, My externel is eth0, internel eth1, I'm on a cable modem so my externel has to snag an ip with dhcp. Also does anyone see a problem with setting up samba and cups and limiting them to the internel interface? I was looking for a pretty cut and dry setup, anything that originates from inside the nat to be allowed through, only related and established connections from the outside are allowed in.

echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -P FORWARD DROP
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT iptables -A FORWARD -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -P INPUT DROP
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -A INPUT -i lo -p all -j ACCEPT
iptables -A INPUT -j ACCEPT -p all -s 192.168.1.0/24 -i eth1

iptables -P OUTPUT ACCEPT

Let me know if you don't see any problems too, or if you see room for improvement!
Any and all advice is greatly appreciated....
Back to top
View user's profile Send private message
100%hound_dog
n00b
n00b


Joined: 01 Oct 2003
Posts: 32

PostPosted: Tue Dec 09, 2003 5:15 am    Post subject: Reply with quote

Was connection tracking compiled into the kernel or are you loading it as a module? If you are loading it as a module you might want to add modprobe ip_conntrack to the begining of your script.
_________________
When hunting monsters one should take care not to become one.
Back to top
View user's profile Send private message
Moszer
n00b
n00b


Joined: 12 Aug 2003
Posts: 8

PostPosted: Wed Dec 10, 2003 3:22 am    Post subject: Reply with quote

I'm loading it at a module. An lsmod shows that it loads it's self when the script runs, so as far as I know it is working without me actually manually loading it. Thanks for the advice though!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum