What's new

Forwarding ICMP ping requests from Internet to a PC behind router

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

MKANET

Regular Contributor
Does anyone know if it's possible to configure my Asus RT-AC5300 (Merlin Firmware) to forward ICMP ping requests from the Internet (meant for the router's public IP) to a my PC behind the router instead?

If so, could someone please be kind of enough to show me working commands I would need to copy and paste when I'm SSH'ed into my router's console? Something that would work even after a router reboot.

Supposing:
Asus Router's public IP: 206.12.1.233
LAN PC behind router: 192.168.1.200

Thanks so much in advance!
 
1. Go to Firewall > General and set Respond to ping request from WAN = No.

2. SSH into router and do the following:

Code:
cat << EOF > /jffs/scripts/nat-start
#!/bin/sh
iptables -t nat -I VSERVER -p icmp -j DNAT --to-destination 192.168.1.200
EOF

chmod 777 /jffs/scripts/nat-start

reboot
Note: You can do step 2 in the GUI instead as follows:
Untitled.png


@john9527 Is the "OTHER" parameter documented somewhere, I can't seem to find a reference to it in the changelog? NVM, it's in Merlin's as well - I just never noticed it. :rolleyes:
 
Last edited:
@john9527 Is the "OTHER" parameter documented somewhere, I can't seem to find a reference to it in the changelog?
I don't remember ever having changed anything on the port forwarding setup. I had to look at the code to see what OTHER actually did.
It takes the value of port range and uses it as the protocol number in the iptables rule. (to be safe, the code actually parses the value to the first ':', so '1:' would also work, and you CANNOT use the ':' as a separator for a range)
 
Thank Colin! Worked like a charm. Much easier than I expected (once you showed me how to do it LOL).
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top