OPNsense Forum

Archive => 23.7 Legacy Series => Topic started by: greenhorn on April 21, 2024, 09:32:15 PM

Title: Access from the Internet to the web server on the LAN side.
Post by: greenhorn on April 21, 2024, 09:32:15 PM
Hello everyone.

It's possible that this topic has already been discussed, but I'm so confused that I can't find anything.
Namely, I have installed OPNsense, and on the interface (igc3) I have a server based on Apche2 connected, where I have a website in HTML.

The website runs on the local network, but how do I configure OPNsense so that I can view the website from the public network (I don't have a domain purchased at the moment). Currently, I would like to use the (permanent) public IP address assigned to me by the operator.

The (igc1) WAN interface has the address: 10.220.88.144
Interface (igc3) LAN I have the address: 192.168.100.22

I have configured: Firewall: NAT: Port Forward in such a way that from the internal WAN address: 10.220.88.144 - port (81) I can access the website at: 192.168.100.22

I enter 10.220.88.144:81 in the browser and a website opens on the Apache2 server.
What should I do to access this website from the Internet?

Please help.  :)
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: Maurice on April 22, 2024, 01:38:04 AM
10.220.88.144 is not a public IPv4 address. Does your ISP use CGNAT? Or is there another router (with NAT) involved on your side?


Cheers
Maurice
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: greenhorn on April 22, 2024, 06:36:45 AM
Hello Maurice :)

I have provided an example IP on the WAN port.
Does it matter what IP address I entered on the forum?

PS. Maurycy, I hope you weren't offended by my answer.  :)
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: greenhorn on April 22, 2024, 07:12:55 AM
Maurice, I'll give you the details.  :)

I have access to the Internet via a wireless modem.
The public IP is 37.48.152.178
The IP on the WAN port is as specified above.

Firewall: NAT: Port Forward

Interface: HUAWEI
Proto: TCP
Source Address: *
Ports: *
Destination Address: HUAWEI address: 81
NAT IP: 192.168.100.22
Ports: 80(HTTP)
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: Maurice on April 22, 2024, 06:18:11 PM
Using an RFC1918 as a placeholder for a public IP address was confusing, yes.

Your port forward rule looks fine. Does your ISP allow inbound connections? You could try a packet capture on the WAN interface to check for incoming packets to port 81.
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: Patrick M. Hausen on April 22, 2024, 07:12:04 PM
Also:

Filter rule association: Pass
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: greenhorn on April 22, 2024, 08:33:23 PM
Maurycy - thank you for your answer.
I need to check if my ISP allows incoming connections.

QuoteYou can try capturing packets on the WAN interface to see if the packets are coming to port 81.

Maurycy, can you describe in more detail where I can check if packets are coming to port 81.

Patrick M. Hausen, I have a question for you.
I'm not very familiar with OPNSENSE, can you elaborate on your answer?

Gentlemen, I have a common question for you: does Firewall: NAT: Outbound play any role in my problem?
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: Patrick M. Hausen on April 22, 2024, 09:01:58 PM
The NAT Port Forward Rule you set up - down there is a field labelled "Filter rule association". Set that to "Pass", save and apply.
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: greenhorn on April 22, 2024, 10:02:48 PM
Patricki OK, I understood, thanks for the tip!

Regards
Peter
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: Patrick M. Hausen on April 22, 2024, 10:05:55 PM
My name is Patrick and Maurice's name is Maurice. You are extraordinarily rude.
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: greenhorn on April 23, 2024, 12:25:44 AM
Patrick M. Hausen, I didn't think you were so sensitive about yourself.
Besides, the Germans are famous for this - Masters and subhumans - you probably know this from History?
Moreover, your year of birth does not impress me because I am 4 years older than you, Herr Baron von Hausen!

PS.
My typos were due to the fact that I used a translator.
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: greenhorn on April 23, 2024, 12:28:56 AM
Maurice (if I offended you), I'm sorry that I misspelled your name (NICK).
It wasn't intentional.


PS.
My typos were due to the fact that I used a translator.
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: Patrick M. Hausen on April 23, 2024, 08:54:08 AM
Insinuating I was a closet nazi sure makes it better. Consider this conversation ended.
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: greenhorn on April 23, 2024, 10:59:35 AM
Jawohl Herr General - 88
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: franco on April 23, 2024, 11:12:21 AM
Temp-banned greenhorn for posting (very far) off-topic.
Title: Re: Access from the Internet to the web server on the LAN side.
Post by: chemlud on April 23, 2024, 11:36:41 AM
Deleting this thread would be more than appropriate...