Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
pfSense Forum
pfSense English Support
»
Firewalling
»
Which direction do rules apply to? incoming or outgoing.. both?
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: Which direction do rules apply to? incoming or outgoing.. both? (Read 1481 times)
0 Members and 1 Guest are viewing this topic.
thorrr
Newbie
Offline
Posts: 4
Which direction do rules apply to? incoming or outgoing.. both?
«
on:
February 03, 2012, 05:16:55 pm »
I am trying to wrap my head around the way firewall rules are applied, but i am getting really confused.
according to:
http://doc.pfsense.org/index.php/Example_basic_configuration#Example_of_a_basic_lock_down_of_the_LAN_and_DMZ_out_going_rules
Always remember that rules are matched on the INCOMING Interface.
but then they go on to add ruled for outgoing LAN.
I was trying to get my 2 subnets talking to each other, and it only seemed to work when i added a LAN rule --> source LAN, dest opt1 and a rule on opt1 --> source opt1, dest LAN
To me this is saying that the rules are applying to outgoing traffic.
If someone could take a few seconds to set me straight i would appreciate it. Thanks!
Logged
ericab
Full Member
Offline
Posts: 198
Re: Which direction do rules apply to? incoming or outgoing.. both?
«
Reply #1 on:
February 03, 2012, 06:09:07 pm »
the rules apply to both incoming and outgoing traffic depending on what you set as the source and/or destination.
since you have 2 subnetted networks, you've divided a single network into two or more similar, but different networks. in this case this is why you *do* need rules to allow incoming and outgoing traffic on each interface to allow communication between the two, otherwise they it will be blocked, since the default behavior on each interface it to drop packets that aren't otherwise specifically allowed with rules.
traffic that originated /and/ is destined to a client within the same subnet, is passed, as long as there isnt a rule on that interface that specifically prohibits communication, and as long as the clients own firewall (if applicable) allows it as well
Logged
mdpugh
Jr. Member
Offline
Posts: 89
Re: Which direction do rules apply to? incoming or outgoing.. both?
«
Reply #2 on:
February 03, 2012, 10:22:32 pm »
Are you sure about this? I wondered about outgoing traffic myself. I think it's passed by default. Otherwise, I'd need a rule to let LAN traffic out to the Internet and I don't. When I wanted to preclude the possibility of crosstalk on disparate LANs (henceforth, LAN means LAN
and
OPTs), but still let traffic through to the WAN, I had to use an allow rule on the LAN interfaces (plural) that passed all incoming traffic except that bound for the LANs (the allow is necessary since incoming traffic is blocked by default). Blocking outgoing traffic on LAN interfaces with LAN source addresses did not work (but I may have done something wrong).
In answer to thorrr's original question, a rule on the LAN interface that affects packets with LAN source addresses and other-than-LAN destination addresses is an inbound rule (likewise on any interface). The traffic comes from the LAN, is allowed through (or blocked) at the LAN interface by the rule, and then, if passed, sent on the next hop to its destination. Theoretically, it could be passed or blocked at the outgoing interface as well. In this case, a rule on the interface for Network X that affects packets bound for Network X and originating from other-than-Network X is an outbound rule (traffic comes from wherever and must pass through the interface en route to Network X) . For whatever reason, I could never get this to work.
A point of clarification: here,
inbound
(incoming) means
entering
[
outbound
(outgoing) means
leaving
]
the pfSense router/firewall
on
any
interface. Do not confuse this with entering or leaving the local area network(s) in general.
«
Last Edit: February 03, 2012, 11:51:04 pm by mdpugh
»
Logged
mdpugh
Jr. Member
Offline
Posts: 89
Re: Which direction do rules apply to? incoming or outgoing.. both?
«
Reply #3 on:
February 03, 2012, 10:35:09 pm »
I knew I'd read this somewhere. According to section 6.5 of The Book, outbound traffic (
on an interface
) is
not
filtered. I don't know whether this changed in 2.0...
«
Last Edit: February 03, 2012, 10:44:37 pm by mdpugh
»
Logged
mdpugh
Jr. Member
Offline
Posts: 89
Re: Which direction do rules apply to? incoming or outgoing.. both?
«
Reply #4 on:
February 04, 2012, 03:51:27 pm »
Actually, floating rules--new to 2.0--appear to be bidirectional.
Logged
KurianOfBorg
Newbie
Offline
Posts: 17
Re: Which direction do rules apply to? incoming or outgoing.. both?
«
Reply #5 on:
May 16, 2012, 10:47:06 am »
The interface rules only apply to packets physically entering the firewall on that interface. If you have a rule on LAN1 allowing "Any to Any" then clients on LAN1 can browse the internet. You do NOT need any rules on WAN (since the packets originated from within the firewall itself after routing and did not physically enter the WAN interface). However if you create a floating rule on WAN, it will process the packets from LAN1 as it leaves WAN for the internet. An interface rule on WAN will not process any internet bound packets from LAN1 even if you set the source address to LAN1.
In a nutshell, all incoming is blocked by default and all outgoing is allowed by default. By default, it will only appear to LAN clients that outbound is blocked whereas in reality their packets are being blocked from entering the firewall. In this state if you use the firewall's physical console, you will be still able to access the internet through WAN without any rules since firewall traffic doesn't originate on a physical interface.
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...