Netgate SG-1000 microFirewall

Author Topic: Blocking inter vlan traffic blocks access to website  (Read 318 times)

0 Members and 1 Guest are viewing this topic.

Offline sb2

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Blocking inter vlan traffic blocks access to website
« on: December 20, 2017, 11:53:38 pm »
Hi,

I have 4 vlans, only 2 of which are in question in this situation. I have a guest vlan (vlan 200) and a server vlan (vlan 306).

By nature I want to block guest vlan access to the server vlan. However, there are websites hosted on the server vlan that users of the guest vlan may need access to. The websites are port forwarded and accessible via the wan. However, when I reject access from the guest vlan to server vlan, users on guest vlan cannot access the websites. This doesnt make sense to me because the website is accessible via the wan and dns records are on a public dns server. The traffic to access the websites shouldnt be going through the vlans, but through the wan. This is making me pull my hair out.


Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10269
  • Karma: +1177/-313
    • View Profile
Re: Blocking inter vlan traffic blocks access to website
« Reply #1 on: December 21, 2017, 12:05:35 am »
You have to pass traffic to the private addresses and ports you want passed before blocking access to the server VLAN on the firewall rules on the GUEST interface.

NAT happens before firewall rules are checked.

So if your web server is 192.168.1.100 ports 80 and 443 you would do something like this on the GUEST interface:

pass tcp source GUEST net dest 192.168.1.100 port 80
pass tcp source GUEST net dest 192.168.1.100 port 443
reject any source GUEST net dest SERVER net

As a trailer I would also say it would be better to pass traffic to "this firewall" that they need access to (like DNS) then block everything else to "this firewall" instead of just blocking the management ports.

That way things can change (like changing the webgui port) and you are still secure without having to remember to change that alias.
« Last Edit: December 21, 2017, 12:10:53 am by Derelict »
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline sb2

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Blocking inter vlan traffic blocks access to website
« Reply #2 on: December 21, 2017, 12:31:00 am »

As a pretty advanced admin, I must say, that is a pretty simple fix and almost seemed too obvious so I didnít bother trying it before. Oops.

In regards to blocking traffic to the firewall, clients only need it for captive portal- not even dns. So Iíll reject all traffic to if except for the portal


Thanks and Merry Christmas

Offline sb2

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Blocking inter vlan traffic blocks access to website
« Reply #3 on: December 21, 2017, 11:58:55 am »
I found that this only works when you then allow traffic:

GUEST net -> SERVER net     80
GUEST net -> SERVER net     443
GUEST net -> SERVER net     8443

It doesnt work for me using a single ip of the host. Especially because unifi uses 8443, I would like to allow 8443 just to unifi instead of the entire vlan but it still rejects it using aliases?

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10269
  • Karma: +1177/-313
    • View Profile
Re: Blocking inter vlan traffic blocks access to website
« Reply #4 on: December 21, 2017, 12:03:21 pm »
If it works with SERVER Net and not specific addresses I would posit you are using the wrong addresses.

You might want to post the actual port forwards and firewall rules. Should only be necessary to post the GUEST rules.

Configure it to something you think should work but doesn't and post that.
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline sb2

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Blocking inter vlan traffic blocks access to website
« Reply #5 on: December 21, 2017, 12:11:52 pm »
I added an alias for "exchange". It is only resolvable by internal dns. Pfsense is pointed to the internal dns servers.

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10269
  • Karma: +1177/-313
    • View Profile
Re: Blocking inter vlan traffic blocks access to website
« Reply #6 on: December 21, 2017, 12:16:20 pm »
Does Diagnostics > Tables look sane when you examine the exchange table?

Is the DNS answer the public WAN address or the inside address?

What does the port forward on WAN look like?
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline sb2

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Blocking inter vlan traffic blocks access to website
« Reply #7 on: December 21, 2017, 12:22:21 pm »
exchg1.ds.smith114.com is resolvable to the 10.3.20.x local address by ALL machines on the network when no restricting firewall rules are present.

Pfsense cannot resolve that address for some reason. It is pointed to the dns servers holding the record for exchg1

I assume the firewall is using itself as dns before the other servers. This is probably the issue but I am not sure how to fix it.

I also assume I can enter the ip of the server instead of the local fqdn, but I prefer to do it with dns (if it will work)
« Last Edit: December 21, 2017, 12:29:37 pm by sb2 »

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10269
  • Karma: +1177/-313
    • View Profile
Re: Blocking inter vlan traffic blocks access to website
« Reply #8 on: December 21, 2017, 01:07:37 pm »
Well, yeah. There's your problem.

What DNS servers do you want pfSense itself to use to resolve names?

Do any clients rely on pfSense for DNS server functionality?
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline sb2

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Blocking inter vlan traffic blocks access to website
« Reply #9 on: December 21, 2017, 01:25:14 pm »
No clients use pfsense for dns

The servers I use are listed in one of the above screenshots but 127.0.0.1 is listed before them

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10269
  • Karma: +1177/-313
    • View Profile
Re: Blocking inter vlan traffic blocks access to website
« Reply #10 on: December 21, 2017, 01:47:15 pm »
If you do not need any DNS services on pfSense:

Set the DNS servers you want pfSense itself to use in System > General

Make sure DNS server override is unchecked

Check Disable DNS Forwarder (removes 127.0.0.1 from the list of nameservers)

Disable both DNS Forwarder and DNS Resolver in Services.
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline sb2

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Blocking inter vlan traffic blocks access to website
« Reply #11 on: December 21, 2017, 05:05:58 pm »
Perfect