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 - Dragonfly

#1
I'm trying to set the tos flag in the IP header for certain traffic using normalization rules. Basically I have a VPN tunnel from a home server (192.168.1.2) connecting to a public VPN server UDP/443. What I want is this traffic to be marked with CS1 (background).

I've made a rule like this:
Interface: LAN_1
Proto: UDP
Direction: any
Source: 192.168.1.2:any
Dest: any:443
ToS: CS1

However, the strange thing is that all return traffic get tos 0x20:

10:40:06.548763 IP (tos 0x20, ttl 58, id 32042, offset 0, flags [DF], proto UDP (17), length 133)
    1.2.3.4.443 > 192.168.1.2.57135: UDP, length 105

but all outgoing traffic remains on 0x00:

10:40:06.549125 IP (tos 0x0, ttl 64, id 10416, offset 0, flags [DF], proto UDP (17), length 105)
    192.168.1.2.57135 > 1.2.3.4.443: UDP, length 77

These are packets from a simple tcpdump -vni igb1 host 192.168.1.2 and udp port 443 -c 10. I've tried removing the state as well as simply restarting the tunnel several times.

I've also tried making an opposite rule, with srcport 443 dst 192.168.1.2:any, as well as include my WAN interface (pppoe0) but to no avail.

Does anyone know what's going on or how to solve this? Much appreciated!

edit: when I just create a blanket rule with my LAN interface selected and then everything else set to "any", outgoing traffic is still 0x00 whilst the incoming traffic is 0x20. What am I missing?
#2
Hello,

I'm busy partitioning my network into VLANs. I started by allowing all traffic between the VLANs and am now starting to pull up walls between them. I'll give a simple example as to the source of my confusion:

Say I have 2 VLANs: 10 and 20. Both are set up as normal LAN interface with their own subnet and DHCP enabled. The subnet is 10.10.10.0/24 and 10.10.20.0/24, respectively.

OPNsense hands out the proper IP and internet access works. I can also reach resources on all subnets, regardless of VLAN, so it's safe to assume I didn't misconfigure my switches (which are managed L2 only).

My confusion is here: what I want is to deny all traffic from VLAN 20 to VLAN 10. VLAN 10 is allowed to access VLAN 20, however.

So I figured I should make a top rule with the following specs:

QuoteAction: reject
Quick: true
Interface: vlan_10
Direction: In
Source: vlan_20 net
Destination: *

The rest is all default

However, I could still reach VLAN 10 from VLAN 20. I even tried changing source to *. And I set an opposite rule with the following specs:

QuoteAction: reject
Quick: true
Interface: vlan_20
Direction: Out
Source: *
Destination: vlan_10 net

To no avail.

Then I found out that if I switch the direction in any rule from Out to In or vice versa, it does exactly what I want it to. Setting a reject rule for "in" traffic also blocks internet access and access to all other subnets through that interface, even though all "out" traffic has been whitelisted in an earlier rule.

What am I missing here? It seems that OPNsense does connection tracking, so stateless rules aren't necessary. Is my background in Linux/iptables playing tricks on me? What I want is the equivalent of:

iptables -i vlan10 -A INPUT -s 10.10.20.0/24 -j REJECT

and

iptables -o vlan20 -A OUTPUT -d 10.10.10.0/24 -j REJECT

Any help is appreciated!
#3
20.1 Legacy Series / VLAN+dhcp won't work
June 12, 2020, 10:40:03 PM
Hello!

Recently I've decided to buy a mini PC to use as a router, with OPNsense on it. It's a Qotom with 6 i211 Intel NICs. Setting up routing, bridging, NAT and DHCP was a breeze. I'll try to explain what I have, what I want and what I tried:

What I have
- cable modem in bridge mode
- OPNsense box with 1 WAN interface in DHCP
- bridge0 created out of all interfaces (including WAN, because the modem has a web interface to monitor Docsis signal values) with subnet 192.168.0.1/24 and DHCP enabled. All LAN interfaces are set to enabled but have no configuration. In the firewall settings, I've allowed all in and out traffic for now.
- 2 ports are connected to two different Ubiquity EdgeSwitch 10X switches.
- My Linux NAS is connected to one switch and has an untagged default VLAN with a static IP in 192.168.0.1/24.
- In addition, it has a VLAN interface, let's say eth0.10 with 802.1q tag 10. The EdgeSwitch is set up to accept tagged VLAN 10 frames to and from this port. It has a static ip 10.0.10.2/24 on this interface
- The other EdgeSwitch has an almost similar Linux HTPC connected with a static IP in 192.168.0.1/24 and a VLAN 10 interface with a static ip 10.0.10.3/24.

I can ping and connect to various TCP ports from 10.0.10.3 and 10.0.10.2, so it works. I also set up a tagged VLAN 10 interface on my Macbook and this also works (wired). This also already worked before I bought the OPNsense box and everything was still connected to my ISP's modemrouter in router mode. This situation still works with my OPNsense box.

What I want
- A DHCP server for VLAN 10 for 10.0.10.0/24

What I tried
- Create a VLAN with tag 10 and parent interface bridge0
- Assign the new interface and set a static ipv4 of 10.0.10.1/24
- Apply the interface changes
- Enable the DHCPd4 service for the interface vlan_10 with a range of 10.0.10.100-10.0.10.200
- Apply the dhcpd changes
- Allow all traffic in and out the vlan_10 interface in the firewall.
- Apply firewall changes

Yet when execute sudo dhclient -v eth0.10 on either box, it won't get any kind of response. It just keeps doing a DHCPDISCOVER on an increasing interval until it gives up.

Does anyone have any idea what I've omitted/forgotten/misconfigured? Any help would be appreciated!