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

    Setting up a home lab- need NAT to have internal virtual switch to go into the internet

    Scheduled Pinned Locked Moved Virtualization
    42 Posts 3 Posters 7.0k 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.
    • K
      korr2221 @johnpoz
      last edited by

      @johnpoz clients behind it doesn't have internet.... Any ideas?

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by johnpoz

        Can clients ping pfsense IP? Is this what is set for their gateway?

        Lets see a traceroute to 8.8.8.8 for example

        First hop should be pfsense IP on your VM lan you setup. Do I really have to fire up hyper-v to show you how simple this is?

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        K 1 Reply Last reply Reply Quote 0
        • K
          korr2221 @johnpoz
          last edited by korr2221

          @johnpoz

          can ping 10.0.0.1 (LAN interface), 192.168.1.11 (WAN interface) fine no problem with no loss
          can not ping 192.168.1.1 which used to be the ASA FW, which I am now putting in a normal Netgear Nighthawk hoping it wasn't the firewall.

          After doing a tracert looks like it don't know what to do with the traffic from 10.0.0.1? This is what I get:

          C:\Users\User>tracert 8.8.8.8

          Tracing route to 8.8.8.8 over a maximum of 30 hops

          1 2 ms 9 ms 4 ms 10.0.0.1
          2 2 ms 9 ms 9 ms 10.0.0.1
          3 6 ms 8 ms 6 ms 10.0.0.1
          4 4 ms 9 ms 7 ms 10.0.0.1
          5 * * * Request timed out.
          6 * * * Request timed out.
          7 * * * Request timed out.
          8 * * * Request timed out.
          9 * * * Request timed out.
          10 *

          I would like to note a couple things though before I leave for work:

          pfsense has the following set:
          DNS server(s)
          127.0.0.1
          75.75.75.75
          Version 2.4.4-RELEASE-p2 (amd64)
          built on Wed Dec 12 07:40:18 EST 2018
          FreeBSD 11.2-RELEASE-p6

          LAN Interface Config
          Static IPv4 Configuration
          10.0.0.1

          NAT > Outbound Rules
          Automatic Rules:
          Interface Source Source Port Destination Destination Port NAT Address NAT Port Static Port Description
          WAN 127.0.0.0/8 ::1/128 * * 500 WAN address * Auto created rule for ISAKMP
          WAN 127.0.0.0/8 ::1/128 * * * WAN address * Auto created rule
          LAN 127.0.0.0/8 ::1/128 * * 500 LAN address * Auto created rule for ISAKMP
          LAN 127.0.0.0/8 ::1/128 * * * LAN address * Auto created rule

          WAN Rules
          0 /270 KiB

          • RFC 1918 networks * * * * * Block private networks
            0 /22 KiB
          • Reserved
            Not assigned by IANA * * * * * Block bogon networks

          LAN Rules
          Rules (Drag to Change Order)
          States Protocol Source Port Destination Port Gateway Queue Schedule Description Actions
          1 /16.65 MiB

              • LAN Address 443
                80 * * Anti-Lockout Rule
                5 /892 KiB
                IPv4 * LAN net * * * * none Default allow LAN to any rule
                0 /0 B
                IPv6 * LAN net * * * * none Default allow LAN IPv6 to any rule

          GATEWAY
          WAN_DHCP (default) WAN 192.168.1.1 192.168.1.1 Interface WAN_DHCP Gateway
          GW_LAN LAN 10.0.0.1 10.0.0.1 Interface lan Gateway

          edit-
          also want to mention I realized Hyper V created this weird Default Switch which is greyed out it state the Default network switch automatically gives virtual machines access to the computer's network using NAT. Any idea if I should be doing this for anything? When I look at it from the host it has a 172.18.19.255 255.255.255.240 network.

          1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator
            last edited by

            And you did a clean install of pfsense with a wan and lan switch in hyper-v?

            Here this is how freaking drop dead simple this is..

            Created my wan external switch, connected to nic on my host machine.
            Created an internal vswitch (only for vms)

            Did a pfsense vm, 2 nic 1 on wan switch, other on lan switch. even set my lan IP to be the same as yours 10.0.0.1/24

            Fired up test vm on the internal switch.. It got IP from pfsense dhcp, can access the gui, internet.. If it takes you more than 5 minutes to set this all up you have something wrong..

            You can see pfsense sees there is update available - so it can get to the internet.. client can get to the internet through pfsense.. See the traceroute.

            0_1548851327990_pfsenseonhyperv.png

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator
              last edited by johnpoz

              @korr2221 said in Setting up a home lab- need NAT to have internal virtual switch to go into the internet:

              LAN 127.0.0.0/8 ::1/128 * * 500 LAN address * Auto created rule for ISAKMP
              LAN 127.0.0.0/8 ::1/128 * * * LAN address * Auto created rule

              That is Never going to work!!! Where is your local network? 10.0.0/24

              Here is mine just setup

              0_1548851556596_outboundnat.png

              You got something broke if its not creating the automatic NAT for your lan network.

              You set a GATEWAY on your LAN interface didn't you to what its OWN address... Pfsense clearly NOT to do that!!!!

              GW_LAN LAN 10.0.0.1 10.0.0.1 Interface lan Gateway

              How could you think that would work???

              0_1548851859050_lannogateway.png

              I just went through the wizard again... It doesn't even give you a option to set the gateway on the LAN... You have to go OUT OF YOUR WAY to do that... And then NOT read the info that clearly says NOT to set a gateway if its the local network and not your wan..

              0_1548852251732_wizard.png

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

              K 1 Reply Last reply Reply Quote 0
              • K
                korr2221 @johnpoz
                last edited by korr2221

                @johnpoz Bro it must be my pfsense image. lol..... I did not configure THAT! I set everything back to default.

                1 Reply Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator
                  last edited by johnpoz

                  Sorry but NO its not the pfsense image..... Out of the box the IP Lan for pfsense is 192.168.1.1/24 with NO GATEWAY.. For it to be 10.x.x.x you had to have changed it... It sure and the F would not have set a gateway to itself.. It just wouldn't!!! Its NOT possible.. You saw my setup, I just ran through it in like 5 minutes... The longest part was downloading the quick VM for ubuntu in hyper-v ;)

                  Did you download this image of pfsense from somewhere other then pfsense/netgate? Is it some hyper-v image you got from somewhere?

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.8, 24.11

                  K 1 Reply Last reply Reply Quote 0
                  • K
                    korr2221 @johnpoz
                    last edited by korr2221

                    @johnpoz i downloaded the image long ago and not from netgate lol.... i forgot where.... but now i'm starting to question myself.........but good find i knew something was weird i cna't wait to go home and get this working lol

                    1 Reply Last reply Reply Quote 0
                    • johnpozJ
                      johnpoz LAYER 8 Global Moderator
                      last edited by johnpoz

                      Huh? Dude grab the current ISO from netgate and install it and you will be up and running in 5 minutes.

                      2.4.4-p1
                      https://www.pfsense.org/download/

                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                      If you get confused: Listen to the Music Play
                      Please don't Chat/PM me for help, unless mod related
                      SG-4860 24.11 | Lab VMs 2.8, 24.11

                      K 2 Replies Last reply Reply Quote 0
                      • K
                        korr2221 @johnpoz
                        last edited by

                        @johnpoz yeah i dunno why i'm fighting with the old image. lol

                        1 Reply Last reply Reply Quote 0
                        • K
                          korr2221 @johnpoz
                          last edited by

                          @johnpoz UPDATE. Issue has been resolved. PHEW. I can't believe it.

                          1 Reply Last reply Reply Quote 0
                          • DerelictD
                            Derelict LAYER 8 Netgate
                            last edited by

                            For posterity, do you know what the solution was?

                            Chattanooga, Tennessee, USA
                            A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                            DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                            Do Not Chat For Help! NO_WAN_EGRESS(TM)

                            K 1 Reply Last reply Reply Quote 0
                            • K
                              korr2221 @Derelict
                              last edited by korr2221

                              @derelict johnpoz most likely got the solution right. on the LAN interface the ipv4 upstream gateway should've been none. but I got a fresh iso and did an update and had another fresh start with default configs and paid attention to make sure not to put anything in the upstream gateway. I was also able to figure out a number of other issues why the dc acted weird. it was all networking related. lol

                              1 Reply Last reply Reply Quote 0
                              • johnpozJ
                                johnpoz LAYER 8 Global Moderator
                                last edited by johnpoz

                                @korr2221 said in Setting up a home lab- need NAT to have internal virtual switch to go into the internet:

                                paid attention to make sure not to put anything in the upstream gateway.

                                It never even ASKS you for that in the gui wizard... And if you do it at the console it clearly states NONE for lan. You really have to go out of your way to mess it up like that! ;)

                                How would the gateway be its own freaking IP... See this error quite a bit over the years - and it never makes any sense what someone was thinking when they do that..

                                Glad you got it sorted - another one to chalk up to pebkac ;)

                                An intelligent man is sometimes forced to be drunk to spend time with his fools
                                If you get confused: Listen to the Music Play
                                Please don't Chat/PM me for help, unless mod related
                                SG-4860 24.11 | Lab VMs 2.8, 24.11

                                K 1 Reply Last reply Reply Quote 1
                                • K
                                  korr2221 @johnpoz
                                  last edited by korr2221

                                  @johnpoz just for learning sake, if this was a cisco router, how would one set the NAT? anyone happen to know the command? is it

                                  enable
                                  configure terminal
                                  ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length }
                                  access-list access-list-number permit source [source-wildcard ]
                                  ip nat inside source list access-list-number pool name
                                  interface type number
                                  ip address ip-address mask
                                  ip nat inside
                                  exit
                                  interface type number
                                  ip address ip-address mask
                                  ip nat outside
                                  end

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post
                                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.