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

    OPT1 needs LAN DNS access

    Scheduled Pinned Locked Moved General pfSense Questions
    109 Posts 5 Posters 19.6k Views 6 Watching
    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.
    • johnpozJ Offline
      johnpoz LAYER 8 Global Moderator @lewis
      last edited by johnpoz

      @lewis well if you want to get to the internet - then yeah you would need that last rule ;)

      As to getting to lan address for dns, just like your top rule there. Create a rule before your block rfc1918 rule that allows access to your lan address for dns.. Not sure why you would need that if your already allowing access to opt2 address for dns.

      But if you mean some other address on lan, or then pfsense lan address - then yeah just put that rule above your block rfc1918 rule.

      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

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        lewis @johnpoz
        last edited by

        @johnpoz

        I must have been testing while having another rule wrong because doing as you said works. I replaced the opt2 dhcp dns servers with the lan ones, added two rules, restarted devices on opt2 and it all works now.

        Here's how it looks.

        opt2-01.jpg

        L 1 Reply Last reply Reply Quote 1
        • L Offline
          lewis @lewis
          last edited by

          One more thing while we're here...

          Opt2 is an ap for wireless.
          I can access it using a device connected to opt2 but I'd like to allow just one IP from LAN to access the ap which is at 192.168.254.2.

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

            @lewis said in OPT1 needs LAN DNS access:

            IP from LAN to access the ap which is at 192.168.254.2

            That rule would go on your lan.. And your AP would have to have a gateway. to understand how to get back to your lan. Or you would have to source nat the traffic.

            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

            L 1 Reply Last reply Reply Quote 0
            • L Offline
              lewis @johnpoz
              last edited by lewis

              Each interface has its own gateway IP.
              The WAN interface has an upstream.
              I also set the gateway on each network (lan,opt1,opt2) DHCP server if that's what you mean.

              I set gateways on each network because I want each to be isolated from each other, requiring rules to go from one network to another.

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

                @lewis said in OPT1 needs LAN DNS access:

                I also set the gateway on each network (lan,opt1,opt2) DHCP server if that's what you

                There is no reason to do that in your dhcp server, since it would auto set its interface IP as the gateway for clients in the lease it hands out.

                What I am talking about is many a soho router used as just an AP have no way to set a gateway on the LAN interface - so it has no idea where to send traffic to get any IP that is not its local network.

                If your setting a gateway on the interface you setup in pfsense your doing it wrong.. And now pfsense thinks those are wan connections.

                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

                L 1 Reply Last reply Reply Quote 0
                • L Offline
                  lewis @johnpoz
                  last edited by

                  @johnpoz I was just reading this as you responded.
                  https://docs.netgate.com/pfsense/en/latest/interfaces/wanvslan.html

                  I've removed the gateways from the DHCP servers.

                  I checked the AP (which is 192.168.254.2 on opt2) and it does not have a gateway. It does have a static route option where I could add the gateway.

                  All devices on opt1 seem to have a proper gateway.

                  johnpozJ 1 Reply Last reply Reply Quote 0
                  • stephenw10S Offline
                    stephenw10 Netgate Administrator
                    last edited by stephenw10

                    If you can add a static route to the AP so it knows how to reach the LAN then it will be able to reply to the LAN client when it tries to access it.

                    Otherwise it may only be accessible from hosts in it;s own subnet. You can work around that with outbound NAT but it's better not to.

                    Steve

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

                      @lewis route prob not going to work.. Maybe - would depend on the soho software, but I doubt it.

                      But what you can do is just source nat your traffic so that the AP thinks when your coming from your lan, that you are actually the IP address of pfsense on your AP network. So the AP just thinks your some device on its local network talking to it.

                      This is done via the outbound nat.. I have gone over it multiple times over the years - lets see if I can dig up one of the old threads.

                      edit: Here you go - went over it back in 2019, put up pretty pictures and everything ;)
                      https://forum.netgate.com/post/868337

                      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

                      L 1 Reply Last reply Reply Quote 0
                      • L Offline
                        lewis @johnpoz
                        last edited by lewis

                        Wait now, this will get all confused soon :).
                        Let me explain what I'm up to first as a reminder.

                        I already have a setup and it's mostly working. I've tested from remote as well and can see what I need to see from specific remote locations and see nothing from others that should see nothing.
                        Each network is isolated at the moment, where each has Internet access but no access to each other. This is where I'd like to be but some things aren't working so I don't want to go changing everything to start over unless I really messed something up.

                        I have lan, opt1 and opt2.
                        I want those networks to be isolated so that I can use pfsense rules to allow specific traffic between the networks. All networks should have Internet access and I have some rules to allow incoming to specific networks.

                        I want opt1 and opt2 to be allowed to use the two DNS servers on the LAN, ports 53 tcp/udp only.
                        I want LAN to have access to the AP device (192.168.254.2) on opt2.
                        I want to prevent opt1 and opt2 from seeing the pfsense gui.

                        I don't want to do anything fancy or complicated, just want to better understand what I'm doing but see so many recipes/methods that it's hard to learn from them since they aren't always the same.

                        johnpozJ 1 Reply Last reply Reply Quote 0
                        • L Offline
                          lewis @stephenw10
                          last edited by

                          @stephenw10 said in OPT1 needs LAN DNS access:

                          If you can add a static route to the AP so it knows how to reach the LAN then it will be able to reply to the LAN client when it tries to access it.

                          Otherwise it may only be accessible from hosts in it;s own subnet. You can work around that with outbound NAT but it's better not to.

                          Steve

                          Correct, that's what is happening now. Only devices on that network are able to reach the ap but they also reach its management page which I'd like to prevent.
                          I looked at the ap and those static options don't seem to be for the LAN ports but still looking.

                          I can add a static route, destination network, mask, gateway and that's it.

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

                            @lewis said in OPT1 needs LAN DNS access:

                            I want LAN to have access to the AP device (192.168.254.2) on opt2.

                            That rule would go on the lan, above any rule that prevents access to your other networks/rfc1918

                            But if your AP doesn't know how to get back to your lan network, ie no gateway. Then you need to be able to give it a gateway, or if static route work - not sure if will because don't think it uses that for traffic from its lan interface. Or you would need to do the source natting I showed in that other thread. You can for sure limit that to specific IPs on your lan you want to do that for and specific destination. Still need a rule on lan to allow it.

                            To block access to firewall IPs from any vlan/network just use the "this firewall" alias - this is built in alias that includes all IPs of pfsense, even the wan. So this is great for preventing access to the web gui where rules allow any for internet, since the wan IP is normally public and would be allowed via an internet allowing rule of any. And the alias will update if your wan rule changes, or you change or add any other pfsense IPs, etc.

                            also reach its management page which I'd like to prevent.

                            As to access to AP gui from devices on the same network as AP.. yeah good luck with that - most soho devices have no way to prevent that.. But they normally allow blocking wifi access to the gui, so that would limit it to only wired devices on that same network your AP is on.

                            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

                            L 1 Reply Last reply Reply Quote 0
                            • L Offline
                              lewis @johnpoz
                              last edited by lewis

                              Yes, that's why it's not working. I had put the rule above the block but nothing. Looking at the wifi device, there is no way to add a gateway on the LAN side, only the WAN.
                              My only option would be to find another wifi device I can use so I can avoid source natting.

                              I do have a bunch of wireless hardware and some embedded PC's with wifi if I used the right OS. Maybe I can turn one into an AP or off to eBay.

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

                                @lewis or maybe just use 3rd party firmware on the device?

                                Most of the 3rd party I have used, ddwrt, openwrt allow for putting a gateway for your lan so you can talk to it from other vlans.

                                But source nat is not the end of the world, and can be secured to only what you want to access the AP ip from on your lan. And is easy enough to setup.

                                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

                                L 2 Replies Last reply Reply Quote 1
                                • L Offline
                                  lewis @johnpoz
                                  last edited by

                                  This post is deleted!
                                  1 Reply Last reply Reply Quote 0
                                  • L Offline
                                    lewis @johnpoz
                                    last edited by

                                    @johnpoz Agreed but I'd like to find a real AP at this point or turn that AC1750 I have into an openwrt device that I would use as an AP. Just don't have enough time to do it all which is why I thought ebay but be a good place to find something cheap.

                                    1 Reply Last reply Reply Quote 0
                                    • L Offline
                                      lewis
                                      last edited by

                                      I finally got back to this so my apologies for not updating in a while. Lots going on all at once.

                                      I converted that AC 1750 to an openwrt AP but I have yet to complete the gateway part of this to allow an IP from LAN to access the AP on OPT2.

                                      I did assign a gateway on the AP and from the shell on pfsense I can ping the 192.168.254.1 (OPT2) gateway but that's about as far as I've gotten.

                                      I have to review this thread to see what rule I need since what I tried so far has not worked.

                                      L 1 Reply Last reply Reply Quote 0
                                      • L Offline
                                        lewis @lewis
                                        last edited by

                                        @lewis

                                        I really really hate to ask but I have yet to be able to reach a device on OPT2 from LAN.

                                        Can someone please share how I would do this.
                                        I made sure to give the AP its own IP and gateway and I added a gateway IP of 192.168.254.1 to the OPT2 DHCP server on that network.

                                        I can ping 192.168.254.1 and .2 from the CLI on pfsense but no matter how I add the rule, I can never reach anything on OPT2 from LAN.

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

                                          @lewis said in OPT1 needs LAN DNS access:

                                          I can never reach anything on OPT2 from LAN.

                                          So your opt2 interface on pfsense is what 192.168.254.1 ?

                                          What is your lan inerface?

                                          What are the rules on your lan - common mistake users make is setting a policy route where they force traffic out say wan or vpn gateway. This does not allow any traffic to any other pfsense networks - since your forcing traffic out some gateway, that can not get to your opt2 network.

                                          If your pfsense lan rules are default, not setting any gateway in the rules. Which are any any.,

                                          Then you would be able to ping 192.168.254.1 from the lan, this is the IP you set on pfsense opt2 interface (NO GATEWAY set on this interface)..

                                          Now if you setup a client on this opt2 network, and it points to pfsense IP 192.168.254.1 as its gateway. This is default what would be handed out by pfsense dhcp server on opt2

                                          If you set your AP with its lan IP to be say 192.168.254.2, and gateway on the AP to 192.168.254.1 you would be able to ping it from lan..

                                          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

                                          L 1 Reply Last reply Reply Quote 0
                                          • L Offline
                                            lewis @johnpoz
                                            last edited by lewis

                                            I'm definitely missing something because I can't reach anything on OPT2 yet I can reach devices on OPT1. I tried following the same rules for OPT2 but never works.

                                            LAN is 192.168.1.1. OPT1 is 10.0.0.1 and OPT2 (192.168.254.x) is what I set up the AP on using 192.168.254.2.

                                            These are the LAN rules.

                                            2021-12-27_145740.jpg

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