• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Using a GRE Tunnel to route VMs network and IP to external network.

Scheduled Pinned Locked Moved General pfSense Questions
36 Posts 2 Posters 4.7k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    stephenw10 Netgate Administrator
    last edited by Oct 4, 2022, 5:52 PM

    Ok the 1:1 NAT rule should be on WAN with the external IP being the public IP VIP and the internal IP being the private IP of the server.

    X 1 Reply Last reply Oct 4, 2022, 5:55 PM Reply Quote 0
    • X
      Xuap @stephenw10
      last edited by Oct 4, 2022, 5:55 PM

      @stephenw10 So, like this?
      c6187a6d-ca16-44d6-a4e3-28daa7645360-image.png

      And on the VM, like this?
      489184d9-f0b5-4787-b6f7-3734c69eb06f-image.png

      1 Reply Last reply Reply Quote 0
      • S
        stephenw10 Netgate Administrator
        last edited by Oct 4, 2022, 5:57 PM

        No the external IP should be the public IP. The internal IP should be the server IP in 192.168.1.0/24.

        The VM gateway needs to be in the subnet so it should be the local pfSense VLAN interface IP. Probably 192.168.1.1

        X 1 Reply Last reply Oct 4, 2022, 6:41 PM Reply Quote 0
        • X
          Xuap @stephenw10
          last edited by Oct 4, 2022, 6:41 PM

          @stephenw10 So, my networks on local pfsense are like this:

          7167937f-2f66-45c0-834b-a080d152ce26-image.png

          My WAN is the 192.168.1.10 which is on the main gateway of the router 192.168.1.254

          I use the VLAN as a bridge for the VMs, but should I use something else both on pfsense or on the VMs?

          X 1 Reply Last reply Oct 4, 2022, 6:49 PM Reply Quote 0
          • S
            stephenw10 Netgate Administrator
            last edited by Oct 4, 2022, 6:47 PM

            Hmm, where is the VM at 192.168.1.86 then?

            I expect all the VMs to be in the VLAN subnet and all the routing the NAT setup to be to and from the VLAN subnet.

            Steve

            X 1 Reply Last reply Oct 4, 2022, 6:51 PM Reply Quote 0
            • X
              Xuap @Xuap
              last edited by Oct 4, 2022, 6:49 PM

              I also did a pcap on both the GRE and VLAN of the local pfsense

              GRE:
              d14dbcf6-36b0-4e74-bf2d-eb48e440fa4e-image.png

              VLAN:
              f19055c3-ebf6-4091-b462-8ac72173b942-image.png

              So, as I understood it is sending the ping to the 1.1.1.1 but it is not receiving any traffic..

              S 1 Reply Last reply Oct 4, 2022, 6:51 PM Reply Quote 0
              • S
                stephenw10 Netgate Administrator @Xuap
                last edited by Oct 4, 2022, 6:51 PM

                Right, well it won't if traffic from 192.168.1.86 is coming in on the wrong interface!

                If you run a pcap on WAN you will see all the replies going back that way because that's where the 192.168.1.0/24 subnet is.

                How exactly is the VM connected?

                X 1 Reply Last reply Oct 4, 2022, 6:55 PM Reply Quote 0
                • X
                  Xuap @stephenw10
                  last edited by Oct 4, 2022, 6:51 PM

                  @stephenw10 The VM is in the proxmox with the IP on 192.168.1.86 and gateway 192.168.2.1 like I showed above

                  The VM is with the bridge of the VLAN (192.168.2.1) which is the Linux Bridge 1 on proxmox (vmbr1) that will (supposedly) be attached to all VMs so it can tunnel the traffic to the remote pfsense

                  1 Reply Last reply Reply Quote 0
                  • X
                    Xuap @stephenw10
                    last edited by Oct 4, 2022, 6:55 PM

                    @stephenw10 16249c88-5c5c-499c-8067-7e1321555bac-image.png

                    This is the only 1.1.1.1 ping I have on the WAN of the local pfsense

                    1 Reply Last reply Reply Quote 0
                    • S
                      stephenw10 Netgate Administrator
                      last edited by Oct 4, 2022, 7:02 PM

                      There is an ARP request for 192.168.1.86 though because it's trying to find it on the WAN. And failing.

                      The VMs should be in the VLAN subnet, 192.168.2.0/24.

                      The static route at the remote end should be for that subnet.

                      The 1:1 NAT rules at the remote side should also be for host in that subnet.

                      Steve

                      X 1 Reply Last reply Oct 4, 2022, 7:14 PM Reply Quote 0
                      • X
                        Xuap @stephenw10
                        last edited by Oct 4, 2022, 7:14 PM

                        @stephenw10 So, like this?

                        8d412b2e-cc2e-4ae2-af56-207db7d0cc09-image.png
                        2e9705b1-00cb-4abb-825d-211ac6e37fa8-image.png
                        9a1a6a0a-5063-4887-9df4-4ba4b4ead7ce-image.png

                        X 1 Reply Last reply Oct 4, 2022, 7:24 PM Reply Quote 0
                        • X
                          Xuap @Xuap
                          last edited by Oct 4, 2022, 7:24 PM

                          Ok, so It looks like I was using a 192.168.1.86 on a .2 subnet, I changed it to 192.168.2.86 and it now pings 1.1.1.1 and 8.8.8.8 and the tunnel, but doesn't have internet access to like ifconfig.me or google.com. I'll do a bit more testing, but it's closer than never to work out.

                          1 Reply Last reply Reply Quote 0
                          • S
                            stephenw10 Netgate Administrator
                            last edited by Oct 4, 2022, 7:40 PM

                            Yeah you need to be using 192.168.2.X everywhere.

                            You are probably seeing pings work but no other traffic because there is some asymmetry somewhere. Once all the rules and routes are changed to the VLAN subnet it should work.

                            X 1 Reply Last reply Oct 4, 2022, 7:49 PM Reply Quote 0
                            • X
                              Xuap @stephenw10
                              last edited by Oct 4, 2022, 7:49 PM

                              @stephenw10 Ok, it is pinging now. I can ping everything on IP addresses, except domains. Like, If I ping my Home Public IP address, I get a ping of 20ms or something, when the tunnel's ping is about 9ms.

                              But is it normal the ping state is 0:0 on both ends?

                              Local:
                              1cb08819-1b8b-4ac5-a45b-dfbe311348f1-image.png

                              Remote:
                              80fcbc34-bdfe-4b60-b3d2-91adf9b2b878-image.png

                              Also the only NAT rules I have are on the remote pfsense, which are:
                              ff35e59a-2ab5-4dfb-a6b2-81dc147ac867-image.png

                              On the local pfsense I have the NAT disabled.

                              What rules should I change/add?

                              X S 2 Replies Last reply Oct 4, 2022, 7:52 PM Reply Quote 0
                              • X
                                Xuap @Xuap
                                last edited by Oct 4, 2022, 7:52 PM

                                Also, traceroutes only give * * * * back:

                                27620e86-8dd4-4046-bfaa-bb66713b3f4d-image.png

                                1 Reply Last reply Reply Quote 0
                                • S
                                  stephenw10 Netgate Administrator @Xuap
                                  last edited by Oct 4, 2022, 9:02 PM

                                  @xuap said in Using a GRE Tunnel to route VMs network and IP to external network.:

                                  But is it normal the ping state is 0:0 on both ends?

                                  Yes. icmpv4 doesn't have a state.

                                  You should still have 1:1 NAT rules on the remote pfSense. With that you wouldn't need the outbound NAT rule, the 1:1 does that already.
                                  And you need the 1:1 rule if you want inbound connections the VM to work. Or add port forwards for each connection you need but 1:1 does it all.

                                  Steve

                                  X 1 Reply Last reply Oct 4, 2022, 9:04 PM Reply Quote 0
                                  • X
                                    Xuap @stephenw10
                                    last edited by Oct 4, 2022, 9:04 PM

                                    @stephenw10 So, I can remove the NAT Rules and set NAT as automatic because 1:1 Mapping does all those rules already?

                                    Also, I want to use inbound connections too, for that, I do need that rule mentioned above, or what should I do?

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      stephenw10 Netgate Administrator
                                      last edited by Oct 4, 2022, 9:10 PM

                                      Yes, if you have the 1:1 NAT rule in place it NAT's all traffic inbound and outbound between those IPs, 1:1.
                                      So you can remove/disable the outbound NAT rule. No harm in leaving it in hybrid mode though.

                                      For inbound traffic you still need firewall rules to allow that on the remote side WAN. And they re applied after NAT so the destination will be the internal private IPs of the VMs.

                                      X 1 Reply Last reply Oct 4, 2022, 9:21 PM Reply Quote 0
                                      • X
                                        Xuap @stephenw10
                                        last edited by Oct 4, 2022, 9:21 PM

                                        @stephenw10 I putted NAT in auto mode
                                        b0647163-4fde-462a-90da-995f9ebce5e5-image.png
                                        and in the WAN rules I have this
                                        c9dc6e49-f282-4b31-ab0c-2a8f703dc952-image.png

                                        you were referring to those rules I just created right?

                                        I can ping any IP address, but I can't ping any URL
                                        20acf6c1-66b6-405a-bdf7-d8a834301eb0-image.png

                                        I have the nameservers 8.8.8.8 and 8.8.4.4 on the VM

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          stephenw10 Netgate Administrator
                                          last edited by Oct 4, 2022, 9:34 PM

                                          It looks like you have something that's only passing ICMP then.

                                          Look for any state to 8.8.8.8 when you try to ping by FQDN. You should see the DNS traffic from the VM opening states on all 4 interfaces.

                                          Steve

                                          X 1 Reply Last reply Oct 4, 2022, 9:39 PM Reply Quote 0
                                          21 out of 36
                                          • First post
                                            21/36
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received