of 2

Configure Firewall

Published on January 2017 | Categories: Documents | Downloads: 2 | Comments: 0
70 views

Comments

Content

->

iptables setup <-

1. install fedora 5 minutes howto 2. setting network interfaces #external interface eth0=10.10.10.2 #lan interface eth1=192.168.0.5 3. create firewall file #cd /etc #mkdir kerber #cd /etc/kerber #touch firewall 4. add following lines to firewall file #vi /etc/kerber/firewall #!/bin/sh ipt=/sbin/iptables # clean tables first echo "cleaning tables…" $ipt -F $ipt -t nat -F $ipt -t mangle -F # enable ip forwarding to route across network interfaces echo "enabling ip forwarding…" echo 1 > /proc/sys/net/ipv4/ip_forward # set default policies echo "set drop as default policy…" $ipt -P INPUT DROP $ipt -P FORWARD DROP # setting NAT in POSTROUTING chain #if external ip is static use static nat $ipt -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 10.10.10.2 # if external ip is dynamic use masquerade # $ipt -t nat -A POSTROUTING -o eth0 -j MASQUERADE # INPUT chain $ipt -A INPUT -i lo -j ACCEPT $ipt -A INPUT -i eth1 -s 192.168.0.0/24 -j ACCEPT $ipt -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT $ipt -A INPUT -p tcp --destination-port 22 -j ACCEPT # FORWARD chain $ipt -A FORWARD -i eth1 -s 192.168.0.0/24 -j ACCEPT $ipt -A FORWARD -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

www.arondmessaging.ro www.facebook.com/aiolinux

5. give execute privileges to firewall file #chmod 755 firewall 6. run firewall #./firewall 7. see the tables #iptables –L 8. test from lan with ping

www.arondmessaging.ro www.facebook.com/aiolinux

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close