LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setting up firewall / nat server (https://www.linuxquestions.org/questions/linux-networking-3/setting-up-firewall-nat-server-349354/)

da644 08-02-2005 04:41 PM

Setting up firewall / nat server
 
Hi All.

We have a small business network and have a Cisco ADSL Router and I would like to set up a firewall using FC4 between that and the rest of the network. What do I need to do to get it to act as nat server?

The server has two network cards, eth0 connected to the router and eth1 connected to the network switch. The configuration is as follows:

Cisco Router <--> [eth0] FC4 server [eth1] <--> LAN Network

Thanks

Andrew.

comprookie2000 08-02-2005 08:22 PM

This should get you started;
http://tldp.org/HOWTO/Masquerading-Simple-HOWTO/
Here is mine, like yours eth0=WAN eth1=LAN
Code:

# iptables -F; iptables -t nat -F; iptables -t mangle -F
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
# iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT
# iptables -A INPUT -p icmp -j ACCEPT
# iptables -P INPUT DROP

and to enable stuff;
Code:

# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# iptables -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
# iptables -A INPUT -p tcp -m tcp --dport 20 -j ACCEPT

or this may be for fedora not sure;
# echo 1 > /proc/sys/net/ipv4/ip_forward


All times are GMT -5. The time now is 11:29 PM.