Shorewall rule to allow traffic

Shorewall rule to allow traffic

Postby sojkovec » Jun 17th, '22, 08:30

Hello,

after days of googling and trying hopelessly, I need to configure firewall as such:

Network scheme as follows:
Code: Select all

Internet -> NAT -> WAN 10.0.0.0/24 -> NAT -> LAN 192.168.1.0/8 (my LAN)



How do I allow traffic from WAN to dest. port 80 on 192.168.1.2 (my server)? Port redirection on the router is configured properly (tested with Windows machine). Thanks for the answer.
Last edited by isadora on Jun 17th, '22, 09:49, edited 1 time in total.
Reason: Topic moved into appropriate sub-forum
sojkovec
 
Posts: 13
Joined: Feb 3rd, '21, 21:58

Re: Shorewall rule to allow traffic

Postby JoesCat » Jun 18th, '22, 19:56

Hi sojkovec,
First, configure computer 192.168.1.2:80 so that it does what you expect it to do with port 80.
Try with another computer connected on the same LAN, example, 192.168.1.3 or 192.168.1.4
If you cannot connect to 192.168.1.2 using another computer on the same 192.168.1.0/8 LAN, then fix 192.168.1.2:80 until it works.
If it works at this stage, then you move to the WAN to LAN connection.

These steps needs to be done at the router, not your computer.
1. You need an ethernet cable connection from the router to computer 192.168.1.2, wifi isn't good enough.
2. Update your router to latest firmware.
3. Ensure you cannot login into the router from the WAN side and ensure your router is not one with a compromised backdoor entry.
4. Configure your router to do "Forward" port 80 from 10.0.0.0/24 -> 192.168.1.2

Depending on what you are doing with 192.168.1.2, port 80 (http) might not be enough, and you may also need to port forward other ports on the router to 192.168.1.2
User avatar
JoesCat
 
Posts: 177
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada

Re: Shorewall rule to allow traffic

Postby sojkovec » Jun 19th, '22, 08:55

Hello JoesCat,

thank you.

Ad 1. Yes, it's wired 1gbit Ethernet.
Ad 2. I always keep my FW current (I might have try Merlin's asusWRT anyway)
Ad 3. I never expose web admin interface to WAN side, it's also on different port than default 80 and SSL enabled with my own CA.
Ad 4. Already done (checked just to be sure).

The default page "It Works!" from Apache is accessible from LAN by other devices, but not from WAN.

Any suggestions appreciated.
sojkovec
 
Posts: 13
Joined: Feb 3rd, '21, 21:58

Re: Shorewall rule to allow traffic

Postby defwxyz » Jun 22nd, '22, 10:22

Hi,

I post this message although I know it does no match precisely you request but can help people.
I was searching to enable ssh so that I can connect to my virtualbox vm installed with mageia from my host.
I did add one line in /etc/shorewall/rules

ACCEPT net $FW tcp 22

For you case you need to read the doc at shorewall.org and search for shorewall-rules and shorewall-zones
net source is defined in zones file and defines all ipv4 adresses which is not restrictive at all.
defwxyz
 
Posts: 2
Joined: Jun 22nd, '22, 10:09

Re: Shorewall rule to allow traffic

Postby doktor5000 » Jun 22nd, '22, 19:13

You don't need to do that manually, this can be done easily via MCC: https://doc.mageia.org/mcc/8/en/content ... akfirewall
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Shorewall rule to allow traffic

Postby sojkovec » Jun 22nd, '22, 21:06

I have already done that before posting.
Last edited by isadora on Jun 23rd, '22, 09:41, edited 1 time in total.
Reason: Quoting the former message is not appropriate
sojkovec
 
Posts: 13
Joined: Feb 3rd, '21, 21:58

Re: Shorewall rule to allow traffic

Postby doktor5000 » Jun 22nd, '22, 22:58

That was a direct reply to defwxyz.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest