Problem accessing internal webservers via external addresses
-
@johnpoz said in Problem accessing internal webservers via external addresses:
you have to purposely tell it, hey pfsense I like to do things the Fโd way
But to be honest, I also use it for some purposes.
For me, it's the short way to reach my goal. -
@viragomann For some reason I see with my inner eye a tall lady with strange clothing leading a naked queen down the street shouting "shame, shame"!
Oh, and I have no idea what happened, but suddenly my OpenVPN tunnel, which passes through the pfSense box to the server, stopped working! It links my cabin and house together and is an essential part of my system. Can any of the changes made here be responsible, or is it correlation and not causation?
Edit: I've of course restarted everything, but nothing helps.
-
Activating NAT reflection and changing the the web interface port can not bring the vpn down as long as you use another port as the vpn instance.
Don't know if you did some further changes except that. -
I was sort of expecting that answer... ;) I guess my learning curve with pfSense is a bit steeper then I thought. I have been using M0n0wall since forever, and I thought that the fork would be quite similar. At least it's very stable...or stably annoying, mostly since I don't know what I'm doing!
-
About the reverse proxy thing. Can Pound do reverse proxy and add ports? So when the address www.automation.com comes to pfSense and Pound, it will be translated to 192.168.1.20:1234? Because that is of course a better way, I just know that DNSMasq can't do port adding.
-
It sounds like it could work, here's a bit from the manual:
BackEnd A back-end is a definition of a single back-end server Pound will use to reply to incoming requests. All configuration directives enclosed between BackEnd and End are specific to a single service. The following directives are available: Address address The address that Pound will connect to. This can be a numeric IP address, or a symbolic host name that must be resolvable at run-time. If the name cannot be resolved to a valid address, Pound will assume that it represents the path for a Unix-domain socket. This is a mandatory parameter. Port port The port number that Pound will connect to. This is a mandatory parameter for non Unix-domain back-ends.
-
Why want you use different ports? Why not different IP addresses?
You can assign multiple IPs to a single server and assign each to a specific service. So each service can listen on its default port. -
@viragomann said in Problem accessing internal webservers via external addresses:
Activating NAT reflection and changing the the web interface port can not bring the vpn down as long as you use another port as the vpn instance.
Don't know if you did some further changes except that.Feel like an idiot... Now I found out why it didn't work. The previous setup was all ports forwarded to the server, which worked. Then I split it up into series of ports to have the home automation webservers directly accessible from pfSense, instead of via my server. At that time the tunnel was still up. I forwarded the standard OpenVPN port to the server, but forgot one thing: A few years ago I had two tunnels up and running, on different ports! And the one that I still use is on the non-standard port that I had the secondary tunnel on. But it was still working because the tunnel was already up, until I activated Nat reflection, since activating that probably triggered some kind of a reset that broke all connections. So now my tunnel's up and running again.
-
@viragomann said in Problem accessing internal webservers via external addresses:
Why want you use different ports? Why not different IP addresses?
You can assign multiple IPs to a single server and assign each to a specific service. So each service can listen on its default port.Not completely sure I follow you there. I need to have everything running on the same VM. And the services are http, but it's of course not possible to have more than one http service listening on the same port on one computer, as far as I know.
I could split up the webservers on six VM's (I thought a bit wrong about the number of servers I run, each address has two servers, so I'd need to have six VM's for this to work), but it just seems like crazy overkill when it has to be at least Windows 7 running them. I already have five VM's on my server, three of them Windows 7. So I'd have to get a more powerful server to do it. I stated earlier that I'd had to by several sets of hardware for the home automation, but I could of course set up a system with tcp commands between the VM's. Still it's very convoluted.
But I do have one possible idea. The problem is that I don't know if this would work. Maybe some of you can tell me that? pfSense is very lightweight compared to a Windows installation, so running several of those is no problem. And I have two unused network ports on a server NIC. So maybe I could send the address www.automation1.com to the main pfSense, use NAT reflection to send that to internal pfSense 1 that does NAT wich converts www.automation1.com to 192.168.1.20:1234 and passes it on to the automation VM? And then www.automation2.com would be sendt to internal pfSense 2 that converts that to 192.168.1.20:12345, www.automation3.com would go to internal pfSense 3 that converts that to 192.168.1.20:12346 and so on.
Can I have several pfSenses in parallel in this way, as long as I run the DHCP service on only one of them? Or wouldn't it work because the answer would be "confused" as to what pfSense it should go out on? or maybe that doesn't matter because routing out from LAN to WAN (in this case WAN is the outer LAN) always works? It would be two levels of pfSense, the outer level with one and the inner level with six.
-
-
What kind of nonsense rabbit whole you going down??
Do you think you could complex up something more? I have gone over the correct way to do this.. Have fun with such nonsense.
-
I've already told you several times why your way isn't possible with the necessary port setup of the home automation software I use and have several years of development sunk into. But if this is your way of saying "no, that is not possible", then please say that. If it's your way of saying "I have no idea if that's possible", then please say that too, in that case I will experiment with it. I just didn't want to experiment with something that wasn't possible.
Edit: I actually thought that anything that M0n0wall could easily do would be just as easy to do with pfSense, but I was probably wrong.
-
Then you the ports int he url! why do you even need to use different domains... Just use the same one with the different ports on the end.. Its pointless calling out auto1 and auto2.com
You can use whatever ports you want in your reverse proxy.. If you want to send auto1.com to ipaddress:1234 and auto2.com to ipaddress:4567 have at it.
Hitting some outside url, to get sent to your public IP:port - and nat reflect then in if you want will work.. You just need nat reflection setup.
be way simpler to just use the url with port in.. Then you could do split dns and not have to do any of this nonsense.
-
No, I don't (as I explained earlier) want to use ports in the URL because telling guests to tap in :1234 after the URL when they are going to access it (Airbnb guests that I rent my house out to in the summer and cover much of my mortgage with, much because it's a combination of a 1700's house with 2000's tech) is confusing them. I tried that first, that's why I started using webhops that adds the port.
-
Oh, and the auto1 and so on is just examples, so I don't put my actual addresses out here. ;) I have addresses that are directly
connectedrelated (that was ambigous when talking about networks) to the house and easy to understand (somewhat like www.whitehouse.com). -
johnpoz, I was looking for the answer to another question (splitting into different severs from WAN, I thought that wasn't reverse proxy, but it seems it is), and I stumbled over an old post by you where you actually use the same argument as me:
You can not run 30 http servers behind 1 public IP. Unless you use different ports on the 1 public IP you have. public.IP.80 โ> private.1.80 public.IP.81 --> private.2.80 public.IP.81 --> private.3.80 But that method BLOWS because from the public side you would have to put the port in your url like http://www.domainA.tld:80 or http://www.domainB.tld:81, etcโฆ
Exactly like you I think putting ports in an URL BLOWS!
-
If you had 30 server putting in ports blows yes.. Get 30 IPs, or use a reverse proxy where did I say use a freaking webhop and then nat reflection??
You want to make it simple for your guest. Then send them to a bookmark page with the urls listed for them - they don't have to see the ports, they down even have to see the full urls - you have a link that says
Light
Fireplace
BlindsOr whatever it is your wanting to control
Other option is if you have 30 servers, then get 30 public IPs
-
Well, it was mostly the ports on the public side. And no, I can't use one address simply because it's to confusing. Three different zones in the house, and rental guests use one or the other, never the third, and never both the two first. ;) But I am going to work on my freakshow next week and see if I can get HA Proxy to work the way I'd like. I never give up until it's proven impossible. Oh, this is what my web radio page looks like. Pressing any button means that you start playing that radio channel in that zone, and the zones only have speakers, nothing more. Amps are all in the technical room. It's possible to use AirPlay and Bluetooth streaming on the same system, that's in another page. I can't really imagine how to make it more selfexplanatory. On a phone or another screen that can't show everything at once you scroll to the right, and the first column (were the room names are) follows.
-
Today I had time to mess around with this, and it worked better than I thought it would. I have now converted the webhops to regular hosts, and I don't have to mess with ports at all. I have split the DynDNS hosts into auto.com/auto2.com, anotheraddress.com/anotheraddress2.com and so on. The first is always EventGhost, and 2 is always Girder. From both outside and inside this goes to the frontend of HA proxy on my pfSense box, 192.68.1.1 (from the inside I think it's going directly, but I haven't yet pulled the plug on the Internet connection to verify that). There the pages are split according to name (host matches auto.com and so on), into one of six pfSense VM's with one NIC in (from the 1.1 pfSense) and one pure host NIC (VMWare's virtual network cards that don't need a physical card) to 192.168.1.50-56, which has the internal networks 192.168.3.x-8.x
These virtual NICs are also connected to the automation VM, so it has now 8 NICs (the two physical for contact with the hardware, and those to the VM pfSense). Only the VM pfSenses mess with ports, converting 80 to the necessary port for the webserver instances that are running inside.
This actually works perfectly, with much faster response than before, when I had it hairpin through one M0n0wall and one Asus router.
Dirty? Probably. Working? Indeed. I'm satisfied. ;)
-
@mastiff said in Problem accessing internal webservers via external addresses:
I have now converted the webhops to regular hosts, and I donโt have to mess with ports at all.
There you go - almost there.. Why are you bouncing your internal off your ha proxy? Why not just resolve to whatever the internal IP is?