Two gateways, two subnets, one internet, subnet connectivity issue
-
I will apologize about my lack of knowledge in this topic and I'm sure you guys hear this all the time. Anyways, I've been using pfSense for a few years now and love it. I've mostly been using it for basic purposes, but really like the idea behind it. I have had zero issues with it. Anyways, on to the setup.
I originally had two completely separate networks that are about 1/2 mile apart physically. I have lost internet at one location so I have joined them with a couple Ubiquiti nanostation M5s. I have internet access on both LANs now.
LAN1
ISP LAN
WRT320N Router with DDWRT
LAN IP: 192.168.1.1
WAN IP: Provided by ISPLAN2
pfSense Box Connected to WAN of LAN1 Router essentially through the wifi bridge using the Nanostation M5s (both M5s have IPs from 192.168.1.0 subnet).
LAN IP: 192.168.5.1
WAN IP: 192.168.1.112I can access each router from the other network, I have internet on both, and I can even run VNC to control a mac across the network too.
I am NOT able to access my server from LAN1 (subnet 192.168.1.0) that is located on LAN2 (subnet 192.168.5.0)On the DDWRT router on LAN1 (subnet 192.168.1.0) I have setup up static routes as follows:
Metric: 0
Destination LAN: 192.168.5.0
Subnet: 255.255.255.0
Gateway: 192.168.1.112
Interface: LAN & WLANOn the pfSense Router, I am not quite sure what to configure as it seems the firewall may be the part prohibiting the incoming connections. Remember, I can access the pfSense router from LAN1, but seems I can not get anything beyond the actual router (other clients) on the 192.168.5.0 subnet.
I tried checking this option in pfSense: Bypass firewall rules for traffic on the same interface It didn't seem to do anything.
I tried setting up WAN and LAN firewall rules with a source being 192.168.1.0 subnet and destination being 192.168.5.0 subnet. I know this may not make sense or perhaps I have it backwards, but I've been working on this for about a week and can't quite seem to get something right.
I also have a static route in pfsense setup as well. Destination LAN: 192.168.1.0, Subnet: 255.255.255, Gateway: WAN DHCP 192.168.1.1
I have also attempted to disable NAT as well and I didn't achieve anything AND I lost internet connectivity.I WANT to keep both networks in tact with their own gateways and subnets so that they will work independently if the wireless bridge is lost or has issues. Granted LAN2 won't have internet, but the actual network will still function internally.
Any input on this?
-
bump
-
Why not just use an IPSEC tunnel between the two sites?
-
IPSEC connects the networks over internet, correct? If so, I'd like to keep the connection local.
-
You can use IPSEC over any connection medium, not just internet links. In pfSense, you can select the interface for the local endpoint (which would be your wireless uplink interface).
The reason I'm suggesting you use IPSEC vs the way you're trying to do it is it allows you to make easy routing changes on both sides. For example, if you decide to add a VLAN on your local/remote site, all you'd have to do is specify another phase 2 entry on both sides to have it route between the two.
https://doc.pfsense.org/index.php/Routing_internet_traffic_through_a_site-to-site_IPsec_tunnel
-
Thanks for the input. I'll have to do some reading on this.
Will this work in conjunction with OpenVPN? I want to use OpenVPN with a VPN service for anonymity while online.
-
Gateway: 192.168.1.112
Not sure what this is.. ^^
If you are trying to reach the network behind your DDWRT router then you need to provide a path through that router.
As the WAN of the DDWRT is on the LAN of the pfsense box there would be no reason that your local LAN traffic ever passed through your pfsense box.
Will DDWRT run RIP?
Another thing you could do is set up the second LAN on an interface on the pfSense box and connect it to the wireless bridge to a simple switch on the other side. That would allow you to run the separate subnets yet control them easily from one box.
Or just combine the two locations on the same LAN.
-
The WAN of the Pfsense box is connected to the LAN of the DDWRT through the wireless bridge. The IP that is assigned to the WAN on the pfSense box is 192.168.1.112
I believe DDWRT will run RIP
-
Ah- Had to read that about 4 times before I got it.
WAN firewall rules? Whatcha got? Im looking for the rule that would allow the 192.168.1.x subnet access through the pfSense box to its LAN..
-
DDWRT box- Same thing. There is nothing that would flow to or though that box if your pfSense WAN was on its LAN. (except the built in switch of coarse)
-
If you take a step back, look at the design, and forget the fact that LAN2's WAN is in a reserved IP space, it becomes clear. It's not working because you are essentially trying to access 192.168.5.0/24 over the internet, which you are not going to be able to do without a port forward and firewall entry. You can remove your current static route on PFsense as reserved IP's are not routable over the internet, so that traffic will never egress a WAN interface. You will also need to uncheck the "Block private networks and loopback addresses" option on your WAN interface @ LAN 2.
As currently connected, you have two options:
-
Create port forwards for everything you want to connect to on LAN 2
-
Create a site-to-site tunnel between the two sites
You have a design issue that needs to be addressed. If you're connecting two sites via a direct connection, you want to connect the sites via LAN interfaces (not WAN). So, if you were going to keep both edge devices where they are, I would:
-
Add a 3rd NIC to PFsense on LAN 2 and assign it a static IP in the 192.168.1.1/24 range (e.g. 192.168.1.254)
-
@ LAN 2, patch your wireless bridge to the 3rd NIC
-
@ LAN 2, add an any/any rule to the 3rd NIC interface
-
@ LAN 1, add an any/any rule to the LAN interface (you can refine it later if needed)
-
@ LAN 1, add a static route to 192.168.5.0/24 with a gateway of 192.168.1.254
-
@ LAN 2, PFsense already knows how to get to 192.168.1.0/24 because of the locally connected interface, so no static route needed here
-
And you're done.
A design consideration, if you're keeping that DDWRT router, considering LAN 2 is routed thru LAN 1, ideally you want your firewall at the head end, so I would swap the edge devices. Otherwise, replace that DDWRT router with PFsense, so both edge devices are PFsense.
Another option would be to extend LAN 1's network over to LAN 2's location by simply plugging the wireless bridge into the switch @ LAN 2 and remove the edge device altogether. If you go this route, the same design consideration applies, I would stick PFsense at the head end.
-
-
Yes, the pfSense WAN is connected to the LAN of the DDWRT
For quick reference
–---------------------
DDWRT has LAN IP of: 192.168.1.1
DDWRT has WAN assigned by ISP
pfSense Box has WAN IP of 192.168.1.112
pfSense Box has LAN IP of 192.168.5.1WAN Firewall Rule on pfSense box:
Action: Pass
Interface: WAN
TCP/IP: IPv4
Protocol: TCP
Source: Set to Network - 192.168.1.0 /24
Destination: Set to Network - 192.168.5.0 /24
Destination Port: ANYLet me know what else to check. I'm completely stumped. I can get in to the pfsense config/admin from the 192.168.1.0 subnet, but can not access anything else behind the pfsense box.
-
I'd like to keep an edge router/gateway at each location to keep each network working independently if the wireless bridge fails. This way the networks can function by themselves with the exception of connectivity to the internet. Almost everything important is on LAN2 (pfsense side) and that is where work is done 99% of the time. I don't mind creating a firewall rule for the individual items in LAN1 that I want to have access to LAN2, that would be ok. The question here is would that use internet to create that connection or would it still function without internet connection? I'd like the networks to be able to talk if the internet is down or turned off.
-
This way the networks can function by themselves with the exception of connectivity to the internet.
What do you mean by this? Because hypothetically if you statically addressed everything on that remote site, your network would still function with just a switch and no router. With your current setup, what does the router add in an outage? DHCP? Local DNS resolution?
-
I don't mind creating a firewall rule for the individual items in LAN1 that I want to have access to LAN2, that would be ok. The question here is would that use internet to create that connection or would it still function without internet connection? I'd like the networks to be able to talk if the internet is down or turned off.
The two sites are connected via wireless bridges, so the internet is not involved in any communication between the two sites.
-
It adds DHCP.
Example. LAN1 –---------wifi Bridge --------------LAN2--devices on lan 2
If the wifi bridge goes down or there is an issue on the LAN1 hardware/software AND there is no DHCP on LAN2 then the entire LAN2 network will not function at all. I'd like to keep LAN2 function (except internet) regardless of what happens in LAN1.
-
A couple things. If I were to go with the route of connecting the two networks via LAN to LAN, could I simply reassign the WAN NIC to a LAN and not have a WAN port on the pfSense Machine and do what you have described?
For now, I'd like to properly setup a port forward in pfSense to allow an IP from LAN1 to access LAN2. The IP I'd like to give access is 192.168.1.115. pfSense port forward options under firewall-nat-port forward
Interface: WAN
Protocol: TCP
Source: What type of source? Wan IP, LanIP, Network etc…?
Source Port Range: ANY
Destination: LAN net: 192.168.5.0 /24 I think this is right, but let me know
Destination Port Range: Type/Number???
Redirect Target IP: ?
Redirect Target Port: ? -
If I were to go with the route of connecting the two networks via LAN to LAN, could I simply reassign the WAN NIC to a LAN and not have a WAN port on the pfSense Machine and do what you have described?
Good question, I suppose if you remove the gateway from the "WAN" interface and just rename it… it would then become a LAN interface... sure.
For now, I'd like to properly setup a port forward in pfSense to allow an IP from LAN1 to access LAN2. The IP I'd like to give access is 192.168.1.115. pfSense port forward options under firewall-nat-port forward
Interface: WAN
Protocol: TCP
Source: What type of source? Wan IP, LanIP, Network etc…?
Source Port Range: ANY
Destination: LAN net: 192.168.5.0 /24 I think this is right, but let me know
Destination Port Range: Type/Number???
Redirect Target IP: ?
Redirect Target Port: ?Port forwards are for redirecting external traffic to a specific internal resource on specific ports, so that's not going to work. For example, if you wanted to only allow 192.168.1.115 access to a web server on 192.168.5.100, you would enter this:
Interface: WAN
Protocol: TCP
Source: "Single host or alias" "192.168.1.115/32"
Source Port Range: ANY
Destination: "WAN address"
Destination Port Range: 80
Redirect Target IP: 192.168.5.100
Redirect Target Port: 80If you want to allow anyone to the web server, you would change your source back to "any"
Then, @ LAN 1, to access the web server @ LAN 2, you would enter the WAN address of LAN 2 in your browser…i.e. http://192.168.1.112 and the traffic will be redirected to 192.168.5.100 on port 80.
-
So the port forward doesn't really seem like the best way to go about it then.
I'm not really familiar with the site-site tunnel at all or IPSEC.
Seems like trying to change the WAN on the pfsense box to a LAN connection and attempt the following:
You have a design issue that needs to be addressed. If you're connecting two sites via a direct connection, you want to connect the sites via LAN interfaces (not WAN). So, if you were going to keep both edge devices where they are, I would:
Add a 3rd NIC to PFsense on LAN 2 and assign it a static IP in the 192.168.1.1/24 range (e.g. 192.168.1.254)
@ LAN 2, patch your wireless bridge to the 3rd NIC
@ LAN 2, add an any/any rule to the 3rd NIC interface
@ LAN 1, add an any/any rule to the LAN interface (you can refine it later if needed)
@ LAN 1, add a static route to 192.168.5.0/24 with a gateway of 192.168.1.254
@ LAN 2, PFsense already knows how to get to 192.168.1.0/24 because of the locally connected interface, so no static route needed here
And you're done. -
Good question, I suppose if you remove the gateway from the "WAN" interface and just rename it… it would then become a LAN interface... sure.
I'm not seeing where I can remove the gateway on the WAN interface.