pfSense Gold Subscription

Author Topic: Port Forwarding Ping from WAN to LAN--- does not work?  (Read 290 times)

0 Members and 1 Guest are viewing this topic.

Offline Hudson8

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Port Forwarding Ping from WAN to LAN--- does not work?
« on: October 22, 2017, 08:41:23 am »
We are using v2.40 with a simple WAN LAN configuration that port forwards (and 1:1 NAT) other protocols perfectly.
But we are unable to ping a computer on the LAN from a source on the WAN.

We created a virtual IP on the WAN side, and port forward TCP to a corresponding computer on the LAN-- this works fine for TCP.

If we create a firewall rule that forwards ICMP from the same virtual IP on the WAN to the same computer on the LAN, pinging the virtual IP gets no response.
(pfSense creates the appropriate firewall rule automatically).

If I disable the ICMP port forwarding and create a firewall rule that allows ICMP from any source to destination WAN net or restrict it to the Virtual IP on the WAN, ping works from the WAN network.
But the ping response is not coming from the corresponding computer on the LAN, it is coming directly from the virtual IP on the WAN.  If I turn off the computer on the LAN, the virtual IP still responds to pings.

Turn the ICMP port forwarding on again for the virtual IP, and ping responses stop.

I have read in this forum that you cannot use 1:1 NAT to forward ICMP.
Does port forwarding also not work for ICMP?

Elsewhere in this forum some have questioned the security risk of allowing PING from WAN to LAN.  This is required (temporarily) by our institution for their security scans to prove that the computers on our LAN are operational when the security scans are running.  I can't change this requirement.

Thanks in advance.
Hudson


Offline Hudson8

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #1 on: October 22, 2017, 08:55:43 am »
And I have checked the suggestions in the Port Forward Troubleshooting post.

The firewall is off on the LAN computer for testing.  The LAN computer IS using pfSense as its gateway.

Offline viragomann

  • Hero Member
  • *****
  • Posts: 2502
  • Karma: +264/-1
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #2 on: October 22, 2017, 10:04:12 am »
Works flawlessly here.

Offline Hudson8

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #3 on: October 22, 2017, 02:58:43 pm »
And Ping forwarding works if 1:1 NAT is enabled as well?

If you have time, would you mind writing out the steps you used exactly?

Offline viragomann

  • Hero Member
  • *****
  • Posts: 2502
  • Karma: +264/-1
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #4 on: October 22, 2017, 03:48:11 pm »
Yes, it works with port forwarding, port forwarding + NAT 1:1 (to the same internal host) and with NAT 1:1 only in combination with a firewall rule allowing ICMP.

Use Packet capture from the diagnostic menu to see if the ICMP packets are forwarded to the LAN interface and if you get responses from the internal host.

Offline Hudson8

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #5 on: October 22, 2017, 04:04:41 pm »
With port forwarding off, the virtual IP sees the packets and responds-- and packet sniffer shows this.

17:00:51.322376 IP xxx.111.150.104 > xxx.145.101.51: ICMP echo request, id 1, seq 645, length 40   this is displayed 6 times, for a single set of 3 pings.

But as soon as port forwarding for ICMP is turned on, packet sniffer shows nothing at the Virtual IP and nothing at the LAN IP that it is forwarded to.

Hudson


Offline Hudson8

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #6 on: October 22, 2017, 04:11:57 pm »
Are you pinging a Windows box on the LAN or a Linux box?
I can't imagine it would make a difference.

Offline viragomann

  • Hero Member
  • *****
  • Posts: 2502
  • Karma: +264/-1
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #7 on: October 22, 2017, 04:21:02 pm »
It was a Windows machine. But it should also work with Linux.

Offline Hudson8

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #8 on: October 22, 2017, 04:24:36 pm »
What firewall rules are you using to allow this to function?
The default firewall rules created by pfSense must be blocking something.

My port forwarding rule is
WAN
Protocol ICMP
Destination IP is the virtual IP on the WAN
redirection IP is the LAN IP for the Windows box.

Just like for any other port forward.

Hudson8


Offline viragomann

  • Hero Member
  • *****
  • Posts: 2502
  • Karma: +264/-1
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #9 on: October 22, 2017, 04:25:38 pm »
17:00:51.322376 IP xxx.111.150.104 > xxx.145.101.51: ICMP echo request, id 1, seq 645, length 40   this is displayed 6 times, for a single set of 3 pings.
xxx.145.101.51 seems to be a public IP. Are you using public IPs in LAN network?

Offline viragomann

  • Hero Member
  • *****
  • Posts: 2502
  • Karma: +264/-1
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #10 on: October 22, 2017, 04:30:50 pm »
What firewall rules are you using to allow this to function?
I let pfSene crate an associated rule.

When trying with NAT 1:1 only I created a pass rule manually with:
Interface = WAN
Protocol = ICMP
Source = any
Destination = internal IP

Offline Hudson8

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #11 on: October 22, 2017, 04:33:18 pm »
That is the WAN network.
xxx.145.101.x

The virtual IP was created on the WAN network and is xxx.145.101.51
It is being routed to an IP on the LAN
192.168.0.10

All the other ports redirect perfectly from WAN to LAN (remote desktop, etc.)

But not ICMP

Offline Hudson8

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #12 on: October 22, 2017, 04:38:52 pm »
And yes, I have that rule
WAN
ICMP
All sources
Destination is the IP on the LAN

Offline Hudson8

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Port Forwarding Ping from WAN to LAN--- does not work?
« Reply #13 on: October 28, 2017, 09:51:20 pm »
For closure the answer is--

Windows 10  and Server 2016 (and probably other versions) automatically disable ping at the inbound firewall when the Windows device has a local IP (like 192.168 etc).
This is true, even if the active network profile is domain.  This was my issue.  Once I enabled echo at the Windows inbound firewall, ping forwarding worked Wan to LAN.

Ping is defaulted ON in Windows for the domain network profile in non-local IP situations, so I didn't check the Windows firewall until evidence from pfSense tcpdump showed the echo requests successfully arriving at the Windows box on the LAN.

ICMP from the WAN to local network is included in 1:1 NAT and can also be enabled through Port Forwarding (by selecting ICMP).  Both methods work.

Thanks to viragomann for leading me in the right direction.