Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to setup a rule that allows internal systems to ping the firewall and the firewall to ping the internal systems.
If I try pinging the firewall internally with a windows laptop I keep getting "Request Timed Out" errors. This also happens when I try to ping www.google.com
If I try and ping the internal interface on the firewall I get "Destination Port Unreachable" errors.
The firewall can ping out to the internet though. Although it can't be pinged from the outside which is what I want
Here are the rules I have setup for ping, please correct
Code:
# Allow firewall to ping out
$IPT -A OUTPUT -o $EXTIF -p icmp --icmp-type 8 -m state --state NEW -j ACCEPT
# Allow internal systems to ping out
$IPT -A FORWARD -i $INTIF -p icmp --icmp-type 8 -m state --state NEW -j ACCEPT
# Allow firewall to ping internal systems
$IPT -A OUTPUT -o $INTIF -s $INTNET -p icmp --icmp-type 8 -m state --state NEW -j ACCEPT
# NOTE I've ALSO TRIED THE ABOVE CODE LIKE THIS
#$IPT -A OUTPUT -o $INTIF -d $INTNET -p icmp --icmp-type 8 -m state --state #NEW -j ACCEPT
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379
Rep:
Your rule seems to be not correct.
I think in your following rule --icmp-type 8 creats problem, so you need NOT use that.
$IPT -A OUTPUT -o $EXTIF -p icmp --icmp-type 8 -m state --state NEW -j ACCEPT
I'm not sure if this will do for you but here's how it looks in a script I use.....
Code:
# This rule will accept connections from local machines.
$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A INPUT -s 192.168.0.0/24 -d 0/0 -p all -j ACCEPT
# DROP bad packets.
$IPTABLES -A INPUT -p tcp --tcp-flags ALL FIN,URG,PSH -j LOG --log-prefix "TCP_FLAGS1 "
$IPTABLES -A INPUT -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
$IPTABLES -A INPUT -p tcp --tcp-flags ALL ALL -j LOG --log-prefix "TCP_FLAGS2 "
$IPTABLES -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
$IPTABLES -A INPUT -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j LOG --log-prefix "TCP_FLAGS3 "
$IPTABLES -A INPUT -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
$IPTABLES -A INPUT -p tcp --tcp-flags ALL NONE -j LOG --log-prefix "TCP_FLAGS4 "
$IPTABLES -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
$IPTABLES -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -j LOG --log-prefix "TCP_FLAGS5 "
$IPTABLES -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
$IPTABLES -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN -j LOG --log-prefix "TCP_FLAGS6 "
$IPTABLES -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
# DROP icmp, but only after letting certain types through.
$IPTABLES -A INPUT -p icmp --icmp-type 0 -j ACCEPT
$IPTABLES -A INPUT -p icmp --icmp-type 3 -j ACCEPT
$IPTABLES -A INPUT -p icmp --icmp-type 11 -j ACCEPT
$IPTABLES -A INPUT -p icmp --icmp-type 8 -m limit --limit 1/second -j ACCEPT
$IPTABLES -A INPUT -p icmp -j LOG --log-prefix "ICMP_TYPE "
$IPTABLES -A INPUT -p icmp -j DROP
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.