Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
pfSense Forum
pfSense English Support
»
General Questions
»
Lan,OPT1,OPT2 firewall rules
Username:
Password:
1 Hour
1 Day
1 Week
1 Month
Forever
Home
Help
Search
Login
Register
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Lan,OPT1,OPT2 firewall rules (Read 2660 times)
0 Members and 1 Guest are viewing this topic.
Bebopper
Newbie
Offline
Posts: 20
Lan,OPT1,OPT2 firewall rules
«
on:
April 10, 2012, 05:09:06 am »
Hello
Im gonna set up a guest vlan (opt1) and a server vlan (opt2) and I want no access between the VLAN`s . Im gonna juse these rules for my firewall settings:
http://blog.stefcho.eu/wp-content/uploads/2011/06/pfSense-2.0-RC1-Configure-Captive-Portal-for-Guests-FireWall-Rules-00.png
Is there more ports/rules I need to get a full isolation between lan,opt1, and opt2 (can I juse the same rules for opt2 to get this full isolated from lan,and opt1)?
Thanks
Logged
stephenw10
Hero Member
Online
Posts: 5079
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #1 on:
April 10, 2012, 08:36:24 am »
That's a strange set of rules, most of those are superfluous.
The default behaviour of the firewall is block everything. If you don't add rules to an interface then no traffic can enter.
The LAN interface has a default rule, allow traffic from LAN to any, which allows traffic from clients on LAN to anywhere. This includes your other subnets/interfaces OPT1, OPT2 etc. Therefore in order to have isolation between subnets you need to have rules that only allow traffic with destination: somewhere on the internet.
I have a similar setup. I have two interfaces with wifi AP attached to them that have internet access but cannot access the other local subnets.
Here is what I did.
First, to make the rules easier to read and modify, I created an alias that contains all my local subnets. See pic attached.
Then I created a firewall rule that allows traffic from the interface subnet with destination not LOCAL. See pic attached. I have the gateway set because I am using multi-wan but leave it as default if not. In addition to that rule I have a rule to allow access to the DNS forwarder on my pfSense box. If you aren't using the DNS forwarder you don't need that but by default you will be.
Similar rules on your OPT1 and OPT2 interfaces will achieve the isolation you require. You will also have to modify the default LAN to any rule accordingly.
Steve
Logged
Bebopper
Newbie
Offline
Posts: 20
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #2 on:
April 18, 2012, 05:56:42 am »
Hi
First thank you for your feedback.
That's a strange set of rules, most of those are superfluous.
1.The default behaviour of the firewall is block everything. If you don't add rules to an interface then no traffic can enter.
Without some form of firewall rules, I tried to access a machine on Lan from OPT1 this went through souldn this be disallowed as default?
2.The LAN interface has a default rule, allow traffic from LAN to any, which allows traffic from clients on LAN to anywhere. This includes your other subnets/interfaces OPT1, OPT2 etc. Therefore in order to have isolation between subnets you need to have rules that only allow traffic with destination: somewhere on the internet.
Ok, is the only thing I have to do is to use the last rule in your wifi2rules.jpg on all my LAN`S including default LAN to block acess between them?
3.I have a similar setup. I have two interfaces with wifi AP attached to them that have internet access but cannot access the other local subnets.
4.Here is what I did.
First, to make the rules easier to read and modify, I created an alias that contains all my local subnets. See pic attached.
Then I created a firewall rule that allows traffic from the interface subnet with destination not LOCAL. See pic attached. I have the gateway set because I am using multi-wan but leave it as default if not. In addition to that rule I have a rule to allow access to the DNS forwarder on my pfSense box. If you aren't using the DNS forwarder you don't need that but by default you will be.
With the rules I linked to in my first post I didnt need the DNS forward rule you have set up, it worked without!
5.Similar rules on your OPT1 and OPT2 interfaces will achieve the isolation you require. You will also have to modify the default LAN to any rule accordingly.
Do I use the last rule on deafult LAN (wifi2rules.jpg) to prevent deault Lan users to acess OPT1 and OPT2?
Why do I need rules for my default LAN when I have added a rule for my op1 and opt2 to not acess the defalut lan, shouldt the block work both ways?
6.Is there more rules I need to set a server on one of my OPT lans? Is it only to add the ports I want outside (wan) to the OPT lan interface afterwards?
7. I cant see that you have blocked acess to your web gui?
8. Why isnt pfense like smoothwall and ipcop, there is it possible to set up red,green (local lan) orange (servers) purple? (guest lan)
Thanks!
Logged
wallabybob
Hero Member
Offline
Posts: 4792
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #3 on:
April 18, 2012, 06:40:13 am »
Quote from: Bebopper on April 18, 2012, 05:56:42 am
5.Similar rules on your OPT1 and OPT2 interfaces will achieve the isolation you require. You will also have to modify the default LAN to any rule accordingly.
Do I use the last rule on deafult LAN (wifi2rules.jpg) to prevent deault Lan users to acess OPT1 and OPT2?
Why do I need rules for my default LAN when I have added a rule for my op1 and opt2 to not acess the defalut lan, shouldt the block work both ways?
I suggest you retain the default LAN firewall rule and add rules "above" the default to block unwanted access from LAN. In pfSense firewall rules are applied on the interface on which the connection is received and processed "top down" until the incoming connect matches a rule. A firewall rule on OPT1 can't block connections entering the firewall on the LAN interface. Secondly, "asymmetric" blocking behaviour is often required: for example, allow everything from LAN to WAN, block everything from WAN to LAN.
Quote from: Bebopper on April 18, 2012, 05:56:42 am
6.Is there more rules I need to set a server on one of my OPT lans? Is it only to add the ports I want outside (wan) to the OPT lan interface afterwards?
Perhaps you want port forwards to direct incoming connections on the WAN interface to a particular ports to particular port specific servers. Once such port forwards are setup appropriate firewall rules are also setup.
Logged
stephenw10
Hero Member
Online
Posts: 5079
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #4 on:
April 18, 2012, 07:33:23 am »
Quote from: Bebopper on April 18, 2012, 05:56:42 am
8. Why isnt pfense like smoothwall and ipcop, there is it possible to set up red,green (local lan) orange (servers) purple? (guest lan)
Ah good question!
Because pfSense is a far more scalable and flexible firewall.
In pfSense you are not limited to one 'orange' interface and one 'green'. Any interface can be a LAN or DMZ (or WAN) depending on how you configure it.
Would it be possible to edit your post above to separate my post from your responses? I am struggling to read it.
Steve
Logged
Bebopper
Newbie
Offline
Posts: 20
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #5 on:
April 19, 2012, 04:00:00 am »
Hi
First thank you for your feedback.
That's a strange set of rules, most of those are superfluous.
1.The default behaviour of the firewall is block everything. If you don't add rules to an interface then no traffic can enter.
Without some form of firewall rules, I tried to access a machine on Lan from OPT1 this went through souldn this be disallowed as default?
2.The LAN interface has a default rule, allow traffic from LAN to any, which allows traffic from clients on LAN to anywhere. This includes your other subnets/interfaces OPT1, OPT2 etc. Therefore in order to have isolation between subnets you need to have rules that only allow traffic with destination: somewhere on the internet.
Ok, is the only thing I have to do is to use the last rule in your wifi2rules.jpg on all my LAN`S including default LAN to block acess between them?
3.I have a similar setup. I have two interfaces with wifi AP attached to them that have internet access but cannot access the other local subnets.
4.Here is what I did.
First, to make the rules easier to read and modify, I created an alias that contains all my local subnets. See pic attached.
Then I created a firewall rule that allows traffic from the interface subnet with destination not LOCAL. See pic attached. I have the gateway set because I am using multi-wan but leave it as default if not. In addition to that rule I have a rule to allow access to the DNS forwarder on my pfSense box. If you aren't using the DNS forwarder you don't need that but by default you will be.
With the rules I linked to in my first post I didnt need the DNS forward rule you have set up, it worked without!
5.Similar rules on your OPT1 and OPT2 interfaces will achieve the isolation you require. You will also have to modify the default LAN to any rule accordingly.
Do I use the last rule on deafult LAN (wifi2rules.jpg) to prevent deault Lan users to acess OPT1 and OPT2?
Why do I need rules for my default LAN when I have added a rule for my op1 and opt2 to not acess the defalut lan, shouldt the block work both ways?
6.Is there more rules I need to set a server on one of my OPT lans? Is it only to add the ports I want outside (wan) to the OPT lan interface afterwards?
7. I cant see that you have blocked acess to your web gui?
8. Why isnt pfense like smoothwall and ipcop, there is it possible to set up red,green (local lan) orange (servers) purple? (guest lan)
Thanks!
Logged
Bebopper
Newbie
Offline
Posts: 20
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #6 on:
April 19, 2012, 04:16:16 am »
Quote from: stephenw10 on April 18, 2012, 07:33:23 am
Quote from: Bebopper on April 18, 2012, 05:56:42 am
8. Why isnt pfense like smoothwall and ipcop, there is it possible to set up red,green (local lan) orange (servers) purple? (guest lan)
Ah good question!
Because pfSense is a far more scalable and flexible firewall.
In pfSense you are not limited to one 'orange' interface and one 'green'. Any interface can be a LAN or DMZ (or WAN) depending on how you configure it.
Would it be possible to edit your post above to separate my post from your responses? I am struggling to read it.
Steve
Yes but it have been nice if it have been a extra option. pfense should make some "default" settings
pfsense should have different default settings remain in the software so that we novices could use these and set up the red, green, orange (separate network) autmatic!. It can not possibly take much room to put this in pfsense so that it supposedly fast and easy to get a "standard" firewall to the home. For example red: wan, green: isolated local network, blue: isolated guest net, orange: isolated server, so it could possibly several types of each set by how many network cards you then had available in the firewall! but believe most people are looking for the solution that I describe here! It should be mentioned that this should have every opportunity to just load the layout you want! Certainly someone on the forum would like to create something like this: P?
thanks
Logged
stephenw10
Hero Member
Online
Posts: 5079
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #7 on:
April 19, 2012, 06:44:45 am »
Quote from: Bebopper on April 18, 2012, 05:56:42 am
Without some form of firewall rules, I tried to access a machine on Lan from OPT1 this went through souldn this be disallowed as default?
If you have no firewall rules on OPT1 at all you should not be able to access anything from OPT1. Everything is blocked by default. If you have recently removed rules you may have to clear the state table or reboot.
Quote from: Bebopper on April 18, 2012, 05:56:42 am
Ok, is the only thing I have to do is to use the last rule in your wifi2rules.jpg on all my LAN`S including default LAN to block acess between them?
Yes that will block access between them because it only allows access to not LOCAL addresses.
Quote from: Bebopper on April 18, 2012, 05:56:42 am
With the rules I linked to in my first post I didnt need the DNS forward rule you have set up, it worked without!
That's because those rules do not block access to the DNS forwarder. In that case you are allowing access to everywhere that is not LAN, that includes the DNS forwarder at the GUEST address.
Quote from: Bebopper on April 18, 2012, 05:56:42 am
Do I use the last rule on deafult LAN (wifi2rules.jpg) to prevent deault Lan users to acess OPT1 and OPT2?
Why do I need rules for my default LAN when I have added a rule for my op1 and opt2 to not acess the defalut lan, shouldt the block work both ways?
You can use the same !LOCAL rule on LAN or as Wallabybob said above you can leave the default rules and add specific block rules above it. Personally I prefer to have as few rules as I can to achieve the same result.
The existing rules on OPT1-2 will not block traffic from LAN because the firewall rules only filter packets coming into the interface. Once a packet is inside pfSense it can exit on any interface.
Quote from: Bebopper on April 18, 2012, 05:56:42 am
6.Is there more rules I need to set a server on one of my OPT lans? Is it only to add the ports I want outside (wan) to the OPT lan interface afterwards?
As Wallabybob said if you want to run, for example, a web server and have it publically available you need to setup a
port forward
which will add the appropriate firewall rules for you.
Quote from: Bebopper on April 18, 2012, 05:56:42 am
7. I cant see that you have blocked acess to your web gui?
I have allowed access only to addresses which are not local (!LOCAL). Since the pfSense webGUI is a local address it is blocked.
It is very unlikely that you will every pfSense using 'colours' for interfaces. It is considered somewhat crude. A bit 'my first firewall'!
The default setup is one WAN and one LAN in which the firewall rules and DHCP server are all setup for you. I suppose it could be possible to choose from a number of common templates when you install to get you started. As I said pfSense is far more scalable, you can't please everyone all the time, colour coded interfaces just don't make sense on a box with 50 interfaces.
Steve
Logged
k6usy
Jr. Member
Offline
Posts: 29
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #8 on:
April 19, 2012, 06:44:28 pm »
It can also be useful to put Reject all rules at the end of the list of rules for internal interfaces. This is to catch packets not allows but another rule up the list. I do this so connection attempts to other interfaces are actively rejected and you don't have to wait for things to time out. The default blocking rules for traffic coming in from the internet is good; you don't want to send reject packets over the internet. Not saying everyone needs to do this; just what I prefer.
Logged
Bebopper
Newbie
Offline
Posts: 20
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #9 on:
April 22, 2012, 05:30:36 am »
Ok
Can I use this adresses for my isolated lans:
Lan:192.168.1.1/24 netmask 255.255.255.0
Opt1:192.168.2.1/24 netmask 255.255.255.0
Opt2:192.168.3.1/24 netmask 255.255.255.0
Or do I need to spread them more, and use different netmask?
Thanks
Logged
wallabybob
Hero Member
Offline
Posts: 4792
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #10 on:
April 22, 2012, 05:56:28 am »
If you expect to have more than about 250 computers on any of those LANs you will need to adjust the netmask to accommodate the additional computers and possibly adjust the base address of the network on some networks.
«
Last Edit: April 22, 2012, 06:00:50 am by wallabybob
»
Logged
Bebopper
Newbie
Offline
Posts: 20
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #11 on:
May 09, 2012, 05:30:54 am »
Ok
So the netmask cannot be hacked in anyways? Its "hidden" for the users and cannot transport anything?
Thanks!
Logged
stephenw10
Hero Member
Online
Posts: 5079
Re: Lan,OPT1,OPT2 firewall rules
«
Reply #12 on:
May 09, 2012, 06:15:15 am »
Nope.
I think you may have misunderstood what the netmask is.
The netmask is simply how the IP protocol defines the subnet that each machine is in, what other addresses it can talk to. See:
http://www.computerhope.com/jargon/n/netmask.htm
Steve
Logged
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Administrative
-----------------------------
=> Forum rules
=> Messages from the pfSense Team
=> Feedback
-----------------------------
pfSense English Support
-----------------------------
=> Installation and Upgrades
=> General Questions
=> 2.1 Snapshot Feedback and Problems
=> Post a bounty
===> Completed Bounties
===> Expired/Withdrawn Bounties
=> Hardware
=> Firewalling
=> NAT
=> CARP/VIPs
=> Routing and Multi WAN
=> Traffic Shaping
=> DHCP and DNS
=> IPv6
=> IPsec
=> PPTP
=> PPPoE Server
=> Captive Portal
=> webGUI
=> Wireless
=> SNMP
=> Packages
=> Virtualization installations and techniques
=> OpenVPN
=> Gaming
-----------------------------
Development/Documentation
-----------------------------
=> Documentation
=> Development
-----------------------------
General Category
-----------------------------
=> General Discussion
-----------------------------
International Support
-----------------------------
=> Indonesian
=> Deutsch
=> Español
=> Français
=> Italiano
=> Russian
=> Nederlands
=> Norwegian
=> Portuguese
=> Polish
=> Romanian
=> Swedish
=> Turkish
-----------------------------
Retired
-----------------------------
=> 1.2.3-PRERELEASE-TESTING snapshots - RETIRED
=> 1.2.1-RC Snapshot Feedback and Problems-RETIRED
=> 2.0-RC Snapshot Feedback and Problems - RETIRED
=> DNS Server testing area - RETIRED
Loading...