Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Callahan

#1
Hi,

I recently moved away from a FTTC connection to a FTTP connection. This has meant that my OPNSense WAN connection has now changed. It looks like this is now a NATed address as the interface IP is now on a 172.16.11.X address. The address that I actully have from an outside perspective is an expected Internet routeable IP. 2 issues have arisen from this new setup.

1. I'm interested, from a technical perspective, how this is working as I'm struggling to make the routing config they have in place make sense in my head. They are NATing and external IP behind an internal IP. I guess that makes sense, just never thought about it being done in reverse I guess.

2. More importantly, my Dynamic DNS setup on the firewall is, while technically working, and reporting my Internet routable IP as the IP to report into my Dynamic DNS provider (no-ip), devices on the outside of my network can't reach them. This, I suspect is because I use the WAN interface IP in the FW rule and the WAN interface IP is this 172 address.

This has essentially cut off all access to my internal web services. I'm not sure how I can resolve this. I've removed the default option to block private networks on my WAN interface as essentially all traffic inbound from the supplier provided modem will be coming from and RFC1918 address but this, I suspect is only half the solution.

Sure this must be a common problem so if anyone can share any pointers, I'd appreciate it.

Thanks.
#2
23.1 Legacy Series / Aliases names now invalid?
March 05, 2023, 12:47:59 AM
With the latest update, I no longer seem able to use underscores in my alias names. See attached.

Anyone have the same issue?
#3
20.1 Legacy Series / Monit examples
May 08, 2020, 12:49:58 AM
Hi,

I'd like to start using Monit but I'm really struggling to find good examples and walkthroughs to explain in detail how the components plug together. Granted, there is the FTP server restart example here: https://docs.opnsense.org/manual/monit.html but that only addresses restarting a failed service on OPNSense.

My initial requirement was that I wanted to monitor if a VPN had gone down and alert me via email if it had. I managed to find an official script that seems to do the job here: https://github.com/opnsense/core/pull/3025/files which I guessed I had to set up as a Custom Service Setting pointing to that script within OPNSense with a Test Setting of "ChangedStatus" (no idea if that's right as there is no guidance anywhere). Having done that, I now see it in the Monit Status page stating that the status is "OK". I'm not sure what exactly is "OK" as I've not asked it to monitor any gateway yet as far as I can tell.

The Service Test Settings for "ChangedStatus" are already configured to "Alert" so I assumed it would then pass it to the Alert stage and fire off an alert to the email address I have configured in my one and only alert (and yes, I have configured my email relay agent in the General tab and also set it up and tested it with Sensei so I know it's working).

Within the Alert config I have a drop down box of Events. I have no idea where these are pulled from. For example, there is an option in the Events drop-down for "Connection Failed" which its name would suggest is what I need but ultimately, I'm just blindly clicking on options hoping I'll get lucky (*I didn't get lucky...).

I'm sure those of you that have experience with Monit outside of OPNSense and have been tinkering for a while might think these questions are a bit amateur but coming into it blind, it is really not clear which options are supposed to tied to which component.

Thanks.
#4
Hi,

I have a 2 interface box, LAN and WAN and a DMZ as a virtual interface configured as a VLAN hanging off the LAN interface. Rules are in place and all seems to be working well say for one thing, the only host on the DMZ (192.168.50.0/24) is my Linux Proxy Server sat at 192.168.50.2. I've allowed the DMZ to get anywhere except for the LAN (192.168.100.0/24), allowing the DMZ host out to the web but keeping it from getting inside my LAN other than to the specified ports/IPs of internal resources.

However, the DMZ host (192.168.50.2) can still mount NFS shares on my ReadyNAS (192.168.100.4) which makes no sense because it can't get to any other host on the internal LAN. I'm been fiddling with this for 4 hours and I can't make any sense of it. I've even disabled all the DMZ rules to see which one it was firing on. I could still access my NAS on the LAN. I don't see how any other rule can be allowing this as the host is in the DMZ.

There is nothing in the FW logs with the IP of my NAS in it despite switching on logging for every rule I have.

Totally baffled as to how this is happening. so if anyone has any suggestions, it'd be appreciated.
#5
Hi,

I have a working OPNSense setup, 3 VPNs, and a DMZ hanging off the only LAN interface. Everything works but I'm confused how the DMZ hosts are getting out to the Internet and it's bothering me.


  • I have a single WAN connection, 3 VPNs, one to my Azure infrastructure, one to another site for backup and one that routes specific hosts over IPVanish (hence the need for Hybrid setup of Outbound NAT rules).

  • One DMZ hung off the LAN interface.

  • I have a selection of Outbound NAT rules to allow VPNs to function as well as the Outbound NAT for my LAN subnet (192.168.10.0/24). My DMZ sits on the subnet 192.168.20.0/24.

Hosts on the LAN and the DMZ can access the Internet (which was my intention), but I have no Outbound NAT rule for the 192.168.20.0/24 subnet. Obviously the traffic is leaving on the only WAN interface available but for other corp FWs I've used up to now, you would have to define your subnet in the Outbound NAT rules. If I defined 192.168.0.0/16, I could understand why it worked but as I've defined a smaller, non overlapping subnet, I'm confused as to how DMZ traffic gets out.

Anyone care to point out what I'm missing?  :)
#6
20.1 Legacy Series / Problems setting up DMZ VLAN
April 28, 2020, 02:50:50 AM
Hi there,

I was hoping I could get some help (as well as confirmation that I'm not missing anything obvious). I am setting up what is/should be, a relitively simple thing. Im running OPNSense on a NUC with 2 ports (not USB, I'm using the mini PCI-e - https://blog.fosketts.net/2015/06/05/adding-a-second-ethernet-port-to-an-intel-nuc-via-mini-pcie if you're interested). This box has served me well enough so far and I've had no real issues with it.

I wanted to set up a DMZ by adding a VLAN, assigning it's parent as the em0 (LAN port), add the interface, enable DHCP/DNS on the new interface with a range that isn't my main subnet (IP range for VLAN: 192.168.50.0/24), drop in a quick rule to allow anything on the DMZ out (testing phase) and I should be done.

So I bought a 24 port switch that has VLAN capability (TPLink TL-SG1024DE - this may be the mistake here) and set it up with the most minimal of configs (see attached image). I then plugged the ESXi box I'm testing from into port 24 of the switch. The LAN port of OPNSense is plugged into port 1 of the switch. I then added a port group in my ESXi host to the only physical NIC in there and assigned the new Port Group the VLAN ID 50. I then assigned the virtual NIC on a new test Linux VM to the new Port Group (VLAN 50).

All pretty standard straight forward stuff so far and exactly how we use this at work.

I reboot the VM after making the above changes expecting to see it grab an IP address from the 192.168.50.0/24 range but it gets nothing. I have seen it once grab an IP from OPNSense during a state of rebooting either the switch or OPNSense during a spate of trying to resolve this issue but never again. The logs in DHCP suggest the request for an IP never reaches OPNSense's DMZ virtual interface:

2020-04-28T01:06:55 dhcpd: Server starting service.
2020-04-28T01:06:55 dhcpd: Sending on Socket/fallback/fallback-net
2020-04-28T01:06:55 dhcpd: Sending on BPF/em0_vlan50/c0:3f:d5:69:1b:93/192.168.50.0/24
2020-04-28T01:06:55 dhcpd: Listening on BPF/em0_vlan50/c0:3f:d5:69:1b:93/192.168.50.0/24
2020-04-28T01:06:55 dhcpd: Wrote 0 leases to leases file.
2020-04-28T01:06:55 dhcpd: lease 192.168.50.5: no subnet.
2020-04-28T01:06:55 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
2020-04-28T01:06:55 dhcpd: All rights reserved.
2020-04-28T01:06:55 dhcpd: Copyright 2004-2020 Internet Systems Consortium.
2020-04-28T01:06:55 dhcpd: Internet Systems Consortium DHCP Server 4.4.2
2020-04-28T01:06:55 dhcpd: PID file: /var/run/dhcpd.pid
2020-04-28T01:06:55 dhcpd: Database file: /var/db/dhcpd.leases
2020-04-28T01:06:55 dhcpd: Config file: /etc/dhcpd.conf
2020-04-28T01:06:55 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
2020-04-28T01:06:55 dhcpd: All rights reserved.
2020-04-28T01:06:55 dhcpd: Copyright 2004-2020 Internet Systems Consortium.
2020-04-28T01:06:55 dhcpd: Internet Systems Consortium DHCP Server 4.4.2


And there it sits, not answering anything. I want to point the finger at this switch. I bought cheap and I think I'm now paying for that in more ways than one.

I'd really appreciate any advice on anything you think I've missed or equally if you think this all looks as it should and you think I shouldn't have cheaped out on a switch and thats my issue. I can swallow buying a better switch if I know it will resolve my issues. :-)

Thanks for your time.
#7
I'm having real issues with clients randomly being prevented from accessing the Internet. I'm forced to reboot the clients. This fixes the issue most of the time (sometimes multiple reboots are required) for anywhere between an hour and 1 day the I'm forced to rebott all my servers/clients to get them access to the Internet again.

Environment

  • 2 Windows 2012 Domain Controllers each running DNS & DHCP.
  • Windows/Mac clients.
  • Clients are a mix of hard wired Ethernet connected devices as well as wifi devices (the problem affects both).
  • DHCP served by a pair of load balanced Windows DHCP servers.
  • DNS forwarder on the DNS servers is pointing to a Pihole running on docker and secondary forwarder is the OPNSense firewall.
  • Default gateway is my OPNSense box running on an Intel NUC with additional NIC feed from the internal mini pci-e port. All has worked fine for about 8/9 months or more.
  • Running the latest stable version of OPNSense

Problem
Random selection of clients being denied access to the Internet

I can log onto the client machine and it picks up an address from the DHCP server along with the correct DNS servers/default gateway and correct subnet mask. I get no indication that there is any issue with the connection. I then try to browse the Internet and can't resolve any pages. I can ping and resolve every other host on the internal network and other hosts on the same subnet can get to the Internent.

  • Next, I try and ping google.com from the problem host. No reply. So I assume it's DNS and ping 8.8.8.8. No reply.
  • Top rule in FW LAN rules is to allow all LAN traffic out
The only change I have made of any significance in the last month is that I have set up a VPN to IPVanish via OpenVPN set up on OPNSense that I use with an Alias list to route certain hosts over the IPVanish OpenVPN/OPNSense gateway. In order to ensure that OPNSense doesn't just push traffic down the default gateway when the VPN to IPVanish is down, I enabled:

Firewall/Settings/Advanced
Gateway Monitoring
Skip rules when gateway is down = disable

Additionally, I have a route-based VPN to my Azure estate that has not given me any issues since I set it up months ago.

Oddly, (and this might be the most telling), the web GUI of OPNSense during this down time is not accessable from the problem hosts, is unaccessable until you wait out the 5/10 mins for the connection to be suddenly be restored. I make no changes to the FW to make this happen during this time. If I restart OPNSense during the time the newly booted hosts can't get Internet access, it fixes the issue (until the next machine fires up and needs Internet access). All other machines that have a working connection can access both the Internet and the OPNSense web GUI.

So from what I've seen so far:

  • It can't be firewall rules as the devices all sit on the same subnet
  • It can't be general routing issues as its specific to machines while others on same LAN are fine.
  • It can't be the connection to the Internet (suggesting modem issues) as the rest of the machines have active connections while the problem machines can't get out the Internet.
  • I am monitoring the default gateway and the connection does not drop
  • This isn't specific to wired or wifi connections as it happens to both.

I am at a loss to figure out why OPNSense is preventing access. I made the mode from pfsense on a whim and I'm thinking I might live to regret it.

Is there anywhere in the logs I should be looking that I haven't already checked?

If anyone has any idea as to what could be causing this, I'd really appreciate some pointers.

Thanks.
#8
So I've been living with this issue for about 2 weeks but it's really impacting things now. I've done lots of testing and my results are below.

Environment

  • 2 Windows 2012 Domain Controllers each running DNS & DHCP.
  • Windows/Mac clients.
  • Clients are a mix of hard wired Ethernet connected devices as well as wifi devices (the problem affects both).
  • DHCP served by a pair of load balanced Windows DHCP servers.
  • DNS forwarder on the DNS servers is pointing to a Pihole running on docker and secondary forwarder is the OPNSense firewall.
  • Default gateway is my OPNSense box running on an Intel NUC with additional NIC feed from the internal mini pci-e port. All has worked fine for about 8/9 months or more.
  • Running the latest stable version of OPNSense

Problem
Random disconnects of clients.

This almost always happens after a client machine has restarted. I can log onto the client machine and it picks up an address from the DHCP server along with the correct DNS servers/default gateway and correct subnet mask. I get no indication that there is any issue with the connection in the sense that Windows will generally tell you if it can't resolve any hosts on the Internet by showing a yellow exclamation mark against your network connection in the toolbar. I then try to browse the Internet and can't resolve any pages.

  • Next, I try and ping google.com. No reply. So I assume it's DNS and ping 8.8.8.8. No reply.
  • So next you would assume it's a FW rule (it's not as I'm allowing anything on the LAN out to the Internet on any port just while I get this working again).
The only change I have made of any significance in the last month is that I have set up a VPN to IPVanish via OpenVPN set up on OPNSense that I use with an Alias list to route certain hosts over the IPVanish OpenVPN/OPNSense gateway. In order to ensure that OPNSense doesn't just push traffic down the default gateway when the VPN to IPVanish is down (I still don't see how this is the acceptable default option, it does exactly the opposite of what anyone would expect), I enabled:

Firewall/Settings/Advanced
Gateway Monitoring
Skip rules when gateway is down = disable

I also enabled:

System/Settings/General
DNS Server Options
Do not use the local DNS service as a nameserver for this system

Now the weirdest part is that when a client machine fires up and I log on and the above issue happens, the existing clients that have already gone through the random wait time (upwards of 5 mins most of the time), remain online and working. Clients retain their allocated IP addresses from the DHCP server, the gateway (OPNSense) is still pingable, as is the DHCP/DNS servers. However, beyond that, I can't get anywhere on outside of my own network. Oddly, the web GUI of OPNSense during this down time, despite being pingable from the problem hosts, is unaccessable until you wait out the 5/10 mins for the connection to be suddenly restored. I make no changes to the FW to make this happen during this time. If I restart OPNSense during the time the newly booted hosts can't get Internet access, it fixes the issue (until the next machine fires up and needs Internet access).

So from what I've seen so far:

  • It can't be firewall rules as the devices all sit on the same subnet
  • It can't be general routing issues as its specific to machines that have just powered up (it also happens randomly throught the day).
  • It can't be the connection to the Internet (suggesting modem issues) as the rest of the machines have active connections while the problem machines can't get out the Internet.
  • This isn't specific to wired or wifi connections as it happens to both.

I am at a loss to figure out why OPNSense is preventing access. I want to point the finger at the modem connection but as I say, multiple devices are working when the problem devices don't.

Appreciate this is a long post but better to get as much detail in the first one than add the extra details over another 12. :-)

If anyone has any idea as to what could be causing this, I'd really appreciate some pointers.

Thanks.
#9
Hi,

As the title suggests, I have already configured 99% of this and it works fine. The issue I have is that if the VPN drops (using IPVanish), I want the hosts in the alias list to be prevented from accessing the Internet.

I have read that this can be achieved by tagging the packets and then using that tag to prevent outbound connections to the default WAN gateway. That doesn't work.

A simpler (or so I thought), way of achieving this would be an exact copy of the top rule forcing said clients out of the VPN, but as a deny rule preventing them from getting anywhere. That way, if the only rule allowing them out can't get to it's gateway, the 2nd rule prevents them from getting out.

This should be super simple but in reality, when the VPN gateway is down, the clients are allowed out ovet the default gateway despite having a specific rule that they should match on that would deny them outbound connections.

I'm at a loss as to figure out why.

I've added an attachment that shows exactly what I mean. Can anyone tell me what I'm missing to make this deny rule work?

Thanks!
#10
General Discussion / Live Log & odd entries
October 26, 2019, 03:55:54 PM
Hi,

So I was looking through the Live Log of one of my OPNSense FWs as I'm building Prometheus into the stack to monitor the FW stats via node_exporter and SNMP. I came accross a reoccuring entry in the Live Log as shown below:


Interface       Time                     Source                                               Destination     Protocol        Label
LAN             Oct 26 14:30:04          static.134.20.251.148.clients.your-server.de:42218   10.20.1.4:443   tcp       let out anything from firewall host itself


I do have a reverse proxy hosted on the 10.20.1.4 IP address so I'd expect INBOUND traffic to be showing up but this doesn't seem to be the case. This is showing as an OUTBOUND connection via my LAN. The source is an EXTERNAL IP which belongs to the Idaho National Laboratory in the US yet the FQDN seems to suggest that it's based out of Germany.

So, confused on more than one level.
1. The most important is why does the log tell me it's an outbound connection when the source is an external address?
2. What's with the confusing source address?

Any pointers gratefully received.
#11
Or at least, not working the way I'd expect them to... :)

Basic setup

  • 2 OPNSense FWs at either end of a site to site VPN tunnel.
  • VPN tunnel is up and running, traffic routing without issue.
  • FW 1 has 3 GWs, the LAN, the WAN and an OpenVPN client GW used for IPVanish traffic on hosts defined in an alias.
  • FW 2 has a standard setup, 2 GWs - LAN and WAN.
  • FW 1 curently has a simple rule:
IPv4 * LAN net * * * * * Default allow LAN to any rule


  • FW 2 has a simple IPsec FW rule that allows all traffic in to local LAN:
IPv4 * * * LAN net * * * Allow to LAN

I want to adjust this rule to prevent everything on the LAN of FW 1 from accessing everything on the remote VPN network. I understand that the standard way of doing this is with IPsec rules at the other end of the tunnel. My question is, what if the far end of the tunnel has an IPsec rule that allowed anything on the tunnel to their local LAN (as above), so I am forced to control the flow of my LAN traffic on FW 1? My expectation was that I could use an inverse rule so something like this:

IPv4 * LAN net * ! IPsec net * * * Default allow LAN to any rule

However, this has no effect. Any device on my LAN can still ping any device on the other end of the tunnel. Again, I understand that the normal way of doing this is a rule at the far end but if I have no control over that FW's rules, I'm forced to control traffic at the source.
On every other FW I've used, inverse rules work as you'd expect them to. So essentially, the above says, allow anything from my LAN to anywhere it wants to go except the IPsec network(s).

What am I missing?
#12
19.7 Legacy Series / Backing up config to Nextcloud
August 18, 2019, 11:08:23 PM
Hi,

I appreciate that this question has been asked a fair number of times. I've been searching through the boards for similar issues but none seem to apply to what I'm seeing.

My setup

  • Default gateway: OPNsense
  • Internal DHCP/DNS handled by a Windows server
  • Internal nginx reverse proxy which handles all requests in over ports 80 & 443
  • All services inside that are serviced by the reverse proxy run on a docker stack (including Nextcloud)
  • All attempts to access any services on 80 are auto forwarded by the reverse proxy to 443. Nextcloud has been configured to run on port 80 so I can use my reverse proxy to terminate the SSL.
  • Nextcloud mobile app works from both inside the network and from outside. I can upload/delete/create files and folders from the Nextcloud mobile app as well as in the web frontend.
  • Nextcloud is hosted at the root of it's own server block using host headers on the proxy to direct inbound connections to the correct service. It also contains location blocks for /.well-known/carddav & /.well-known/caldav

I have followed the guide here:
https://docs.opnsense.org/manual/how-tos/cloud_backup.html

I've also tried using just a standard user on my Nextcloud setup for the backup.

All attempts fail. The General log on OPNsense states:

config[68984]: {"url":"https:\/\/nextcloud.mydomain.net\/remote.php\/dav\/files\/opnsense-backup\/","content_type":null,"http_code":0,"header_size":0,
"request_size":0,"filetime":-1,"ssl_verify_result":0,"redirect_count":0,"total_time":60.001572,"namelookup_time":1.720676,"connect_time":0,
"pretransfer_time":0,"size_upload":0,"size_download":0,"speed_download":0,"speed_upload":0,"download_content_length":-1,"upload_content_length":-1,
"starttransfer_time":0,"redirect_time":0,"redirect_url":"","primary_ip":"","certinfo":[],"primary_port":0,"local_ip":"","local_port":0}

config[68984]: Error while fetching filelist from Nextcloud


If I try to access the URL that OPNsense is trying to access (https://nextcloud.mydomain.net/remote.php/dav/files/opnsense-backup), I'm prompted for a username and password. Once I enter those, I see the expected message: "This is the WebDAV interface. It can only be accessed by WebDAV clients such as the Nextcloud desktop sync client", so it's definitely up and running.

As far as I can tell, the logs aren't really giving me anything useful to follow.

Can anyone provide any pointers?

Thanks.