SSH NAT to another network
I'm trying to remotely access the OpenWRT router.
I created a NAT in pfsense to redirect connections.
192.168.0.132:2222 -> 192.168.10.1:22
I try to connect my PC to the IP 192.168.0.132 and the port 2222. I have no success.
![SSH OPENWRT.dia.jpg](/public/imported_attachments/1/SSH OPENWRT.dia.jpg)
![SSH OPENWRT.dia.jpg_thumb](/public/imported_attachments/1/SSH OPENWRT.dia.jpg_thumb)
Wrong interface? I think you want LAN, not WAN.
Actually, it seems like you are just trouble-shooting incorrectly. You need to test from a remote/external IP, not a LAN IP, or enable NAT loopback.
I am changing settings in OpenWRT, but have not had success.
and also do not know if the problem is in OpenWRT.
follow my network settings.
the wan interface is connected to the router
the opt1 interface on OpenWRT
DHCP is done in the router and the OpenWRT.
OpenWRT does not have internet access, it is a router that I use for testing.
the cable connected to the OpenWRT is the LAN port
I read in some forums, that only works if the pfsense is the gateway.
that is the only way the ssh work with this connection mode.
This is true?
in my network, pfsense is not the gateway, on any network.
I disabled the dhcp in OpenWRT.
enable dhcp in opt1 interface in pfsense.
and got access by ssh, why I could not access the other way?
"in my network, pfsense is not the gateway, on any network."
If pfsense is not your gateway how would it work, do you have specific routing to go through pfsense depending on dest/source IP?
this setting is in my house.
It is not a corporate network.
the pfsense serves to VPN, and study.
I installed another router with OpenWRT to study, and I want to isolate this network from my private network.
So I put another IP range, and pfsense in the middle, but wanted to access the OpenWRT through my private network, only to set up.
dude draw your network.. Routing is routing no matter if the network is a home network or a work network ;) If your going to have downstream routers then you would need to use transit networks.
sorry, but I did not understand how to do this.
I have to make a routing on OpenWRT?
192.168.0.0/24 -> 192.168.10.109
So your pfsense natting and its network is behind a nat.
so you have this publicIP - wrt 192.168.0.? –- 192.168.0.? wan pfsense lan -- 192.168.10.? ---- 192.168.10.109 SSH Server?
So if you want to ssh in that sort of setup from where from the public internet then you would have to forward on wrt 22 to whatever that 192.168.0.x address is for pfsense wan, then on pfsense you would forward 22 to your 192.168.10.109 box.
Your going to have issues if your on the 192.168.0 network and want to nat reflect, ie hit the public IP with asymmetrical routing. In the case of wanting to ssh to 192.168.10.109 from boxes on the 192.168.0 network you would just hit your pfsense wan IP directly and let if forward.
If your trying to use pfsense behind a nat, and for an openvpn server into your network directly behind your wrt router your going to have all kinds of asymmetrical routing problems without source natting your openvpn connections.
OpenWRT does not use the network 192.168.0.X
router: 192.168.0.1 (DHCP Server)
OpenWRT: 192.168.10.1 (DHCP Server)
pfsense (VM Proxmox)
I think that the connection does not work because the OpenWRT not find the ip source.
will the OpenWRT seeks ip 192.168.0.100 to close the connection?
if I do a routing, every connection to network 192.168.0.0/24 be redirected to the IP 192.168.10.109?
What??? So your pfsense is a VM?
Dude grab the napkin and the crayons and draw this.. Makes ZERO sense..
What is connected to what? Where is your wan/internet?
in the first post I created a diagram
pfsense is not the gateway, and does dhcp, I use pfsense to vpn, and to isolate networks.
in this case it isolates the OpenWRT
I have another interface on pfsense, LAN interface ip 192.168.100.1, it does dhcp to other VMs to isolate game servers.
I did not put the LAN interface in the diagram, because it will be used in this case.
Ok.. So you want to get to this openssh from where? Your PC in you drawing or the internet? You still need to create a port forward on pfsense. to the openwrt IP. Do you have gateway setup on wrt. Is that connected to wrt wan? Why is openwrt your dhcp server in this setup? so 192.168.10.1 is openwrt LAN IP? And there is nothing behind openwrt - what purpose is it then? Wireless? It sure can not be the gateway off the 192.168.10 network.
So if you want to get to it from your PC you have to hit your pfsense wan IP on that port 2222, for openwrt to be able to talk back it needs to have a gateway setup that would be pfsense IP in that network 192.168.10.109
I got to change the settings, and set DHCP on opt1 interface, OpenWRT was set to get IP by DHCP.
that way it worked!
so I can let the dhcp on OpenWRT and set the 192.168.0.109 (pfsense) as the gateway.
What possible reason do you want/need wrt to be dhcp server?
because it is not always this router is in my house.
worked, set up the dhcp of the OpenWRT, I put the pfsense as gateway.
the dns I put 192.168.10.1 and 188.8.131.52
OpenWRT has internet access, and I can connect via "PC".
Thank you all
Why do you have wrt as dhcp server? Makes no freaking sense to me at all, why would you not have pfsense be your dhcp server for this 192.168.10 network?
sometimes I take this router to other places, it is not fixed in my house.
Ok… if you do that then turn on its dhcp server ;)
true, you're right.
I put the dhcp again in pfsense. 8)
I just do not want the network 192.168.10.0 to access the network 192.168.0.0
but I think this is for another topic.
I created a new topic to isolate the network 192.168.10.0