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

#1

┌───────────────────────────────────┐
│ Firewall 1                        │
│            ┌───────────┐          │
│     ┌──────┤ vlan0.0.50├──┐  ┌────┤
│     │      └───────────┘  └──┤eth0├────────────────────────┐
│ ┌───┴───┐                    └────┤                        │
│ │       │                         │                        │
│ │bridge0│                         │                        │
│ │       │                         │                        │
│ └───┬───┘                    ┌────┤                        │
│     │      ┌───────────┐  ┌──┤eth1├──────────┐             │
│     └──────┤ vlan0.1.50├──┘  └────┤          │             │
│            └───────────┘          │          │             │
│                                   │     ┌────┴─────┐  ┌────┴─────┐
└───────────────────────────────────┘     │          │  │          │
                                          │  switch1 │  │  switch0 │
┌───────────────────────────────────┐     │          │  │          │
│ Firewall 2                        │     └────┬─────┘  └────┬─────┘
│            ┌───────────┐          │          │             │
│     ┌──────┤ vlan0.0.50├──┐  ┌────┤          │             │
│     │      └───────────┘  └──┤eth0├──────────┼─────────────┘
│ ┌───┴───┐                    └────┤          │
│ │       │                         │          │
│ │bridge0│                         │          │
│ │       │                         │          │
│ └───┬───┘                    ┌────┤          │
│     │      ┌───────────┐  ┌──┤eth1├──────────┘
│     └──────┤ vlan0.1.50├──┘  └────┤
│            └───────────┘          │
│                                   │
└───────────────────────────────────┘


Hello, I have a problem with a loop that I get with an HA configuration over two OPNsense firewalls. I have a bridge on each firewall, and each bridge is bridged to a VLAN via two paths. As can be seen from the diagram, a loop must occur here, unfortunately I need this setup exactly like this. As soon as I set up the setup like this, I have a loop and everything comes to a standstill. Even various attempts to activate STP have not clue, which I also don't really understand.
In terms of HA, I have built myself a sys hook: /usr/local/etc/rc.syshook.d/carp/10-handle-briges.
This script does an ifconfig bridge0 up/down according to the CARP status (MASTER or not MASTER). Basically, this works quite well, but unfortunately not when I restart the firewall. When booting up, CARP takes effect and the bridge is shut down, unfortunately in the following boot process it is detected that the bridge has dependencies, it is configured and thereby brought back up, and I am back to my loop.

Ideally, I should be able to counteract all of this with STP, but it's not working. Does anyone have any idea why not? The attempt to bypass the whole thing using a hook and bringing the bridge up and down is just a workaround; here, I would still need an idea of how to immediately bring the bridge back down in case it is brought back up, depending on the CARP status. My current approach is to write a file (/tmp/carp-status.flag) to check in another script whether the bridge should be up or down, and then to correct this immediately if necessary. Unfortunately, I haven't found a hook yet that I could use as soon as the bridge is brought back up. Maybe with the devd stuff? But I haven't figured out yet how to register for an event here, maybe somewhere in /usr/local/etc/inc/plugins.inc.d/?

Perhaps someone can give me an idea or question everything again and guide me in the right direction?

Greetings, Volker
#2
Hello Community,

I'm facing a problem with OPNsense configuration, and I'm hoping someone in the community can help me out.

Here's my setup:

- OPNsense with a WAN interface without a fixed IP address.
- Multiple virtual IPs from a /29 subnet are bound to the WAN interface using CARP.

The problem arises when more than one IP is bound to the WAN interface. Packets originating directly from the firewall have an "0.0.0.0" source address. Since the firewall no longer knows which IP to use for internet communication (as the default route only defines the interface), confusion arises.

I attempted to address this by creating an outbound NAT rule, specifying "any" to "!bougen" via the WAN interface. However, this rule only takes effect when "any" is selected as the source. When I set the source as "this firewall," the NATing doesn't work.

Does anyone have a solution or the correct approach to address this issue?

Thank you in advance for your assistance!

Best regards,
volker
#3
23.7 Legacy Series / Filter DHCP Requests on Bridge
October 27, 2023, 11:28:24 AM
Hi,
I want to ensure that the DHCP traffic from clients 1 and 2 doesn't get forwarded to clients 3 and 4. I've created a rule on the bridge to block everything with a destination port of 67, but this rule is being ignored, and it's not exactly what I want. Ideally, I would like to apply this only to packets coming in on interface 1. Does anyone have an idea on how I could achieve this?


             +-----------------------+
             |Third-Party DHCP Server|
             +-------------+---------+
+--------+                 |
|Client 1+--------------+  |
+--------+              |  |
                      +-+--+-+
                      |Switch|
                      +-+--+-+
+--------+              |  |
|Client 2+--------------+  |
+--------+                 |
                           |
                           |
     +---------------------+---------+
     |OpnSense             |         |
     |          +-------+--+--+---+  |
     |          |       |Intf1|   |  |
     |          |       +-----+   |  |
     |          |                 |  |
     |          |Bridge 1   +-----+  |
     |          |           |Intf2+--+----+
     |          +-----------+-----+  |    |
     |                               |    |
     +-------------------------------+    |
                                          |
                                          |
              +--------+                  |
              |Client 3+------+        +--+---+
              +--------+      +--------+Switch|
                                       +--+---+
                                          |
              +--------+                  |
              |Client 4+------------------+
              +--------+
#4
German - Deutsch / WAN PPPoE IPv6 only
June 22, 2023, 12:31:08 AM
Moin!
Ich habe ein Internetanschluss der IPv6 only ist und über PPPoE die Einwahl erfolgt. Bisher konnte ich diesen Zugang noch nicht wirklich zum fliegen bekommen. Habe etliche kombinationen am WAN Interface versucht, die PPPoE Einwahl ist erfolgreich, aber irgendwie bekommen ich keine IPv6 kram der von der opnsense sinnvoll verarbeitet werden kann.

anbei mein aktuelles setting, beim WAN interface habe ich schon alle kombinationen für "DHCPv6 client configuration" versucht. interessant ist, wenn ich "Use IPv4 connectivity" nutze, kommt der "DHCP:  DHCPv6" nicht "up" (siehe bild1.png).

ist alles recht seltsam. natürlich funzt das ganze mit der mitgelieferten fritzbox. gleicher ISP mit anderen zugangsdaten die IPv4 zugangsdaten sind läuft alles problemlos.

noch jemand eine idee für mich?
#5
General Discussion / OPNsense Rewrite Discussion
June 12, 2023, 03:55:47 PM
Hello, has there been any recent attempt to rewrite OPNsense? I wanted to enable the addition of gateways to the Gateway API and therefore took a closer look at the source code of OPNsense. I don't want to say that it's bad, but it does seem quite dated. Not that I want to open a "yet-another-open-source-firewall" fork of OPNsense right away, but at least discussing whether it would make sense?
#6
Hello, I have an existing ICS-DHCP configuration that I would like to use in the LAN-DHCPv4 GUI. I'm not sure how to read the configuration, so I'm unsure how to transfer it to the GUI. All of my previous attempts have been unsuccessful. The crucial point is that I need to correctly implement option 125 "option genexis.config "http://x.y.z.1:7567/file.conf";" Further up in the configuration, there are various definitions that describe the option, but I'm not entirely sure how to create the option 125 and how to generate the value, and possibly hex-code it into the GUI. Here's the configuration that has worked so far:

# Configuration via DHCP with "Option 125"
# OPTION 125
option space genexis;
option genexis.fw code 2 = text;
option genexis.config code 3 = text;
option space vivso code width 4;
option vivso.iana code 0 = string;
option vivso.iana 01:01:01;
option vivso.genexis code 25167 = encapsulate genexis;
option option125 code 125 = encapsulate vivso;

subnet x.y.z.0 netmask 255.255.255.0 {
  range x.y.z.10 x.y.z.240;
  option subnet-mask 255.255.255.0;
  option broadcast-address x.y.z.255;

#OPTION 125
# define config file
  option genexis.config "http://x.y.z.1:7567/file.conf";
}
#7
hi,
in my ha setup, i have to configure the public WAN ip as static, so i generate an CARP solution. but in case all is normal, my backup-node has no internet WAN ip and also no internet uplink. my problem is, i can not install updates or anthing else which is needed internet on backup-node?!
how can i use the master-node as internet/default uplink for the backup-node? in an automatic mode, of ourse.

thx, volker.
#8
Hi! i have an dummy network, an loopback interface with assigned IP (192.168.200.1/24). also an running IPSEC tunnel (non routed, non VTI). so i want my local LAN to NAT over this dummy network, so that any request from my local LAN is NATed by 192.168.200.1:



                                      ┌────────────────────────┐
                                      │                        │
┌───────────────────┐                 │ ┌────────────────────┐ │
│                   │                 │ │                    │ │
│  Remote Network   │   IP-SEC-Tunnel │ │  Dummy Network     │ │
│  10.22.248.0/21  ─◄─────────────────►─┼─ 192.168.200.0/24  │ │
│                   │                 │ │                    │ │
└───────────────────┘                 │ └─────────▲──────────┘ │
                                      │           │            │
                                      │           │            │
                                      │  ┌────────┴─────────┐  │
                                      │  │                  │  │
                                      │  │  Outbound NAT    │  │
                                      │  │                  │  │
                                      │  │   10.50.0.0/24   │  │
                                      │  │        │         │  │
                                      │  │        ▼         │  │
                                      │  │  192.168.200.1   │  │
                                      │  │                  │  │
                                      │  └────────▲─────────┘  │
                                      │           │            │
                                      └───────────┼────────────┘
                                                  │10.50.0.2
                                                  │
                                                  │
  ┌───────────┐                       ┌───────────┴───────────┐
  │           │                       │                       │
  │  Machine  │                       │  Local LAN            │
  │           │10.50.0.107            │  10.50.0.0/24         │
  │           ├──────────────────────►│                       │
  └───────────┘                       │                       │
                                      └───────────────────────┘


i have just add an outbound NAT, and try to ping from an machine like 10.50.0.107 to 10.22.250.1 ... the machine knows the right route (10.22.248.0/21 via 10.50.0.2 dev eth0) but no success. there is no NAT ing and no packet is arriving the IPSEC remote network.
is it possible like this to NAT the traffic to an IPSEC tunnel?
#9
hi!
i'm trying to establish an ipsec tunnel (routed VTI) between my fortigate (v7.0.6) and an opnsense (22.1.9). my problem is already in phase 1, my fortigate call me an error like "peer SA proposal not match local policy" :( my current config is attached as images.

any hints or additionals info request?

thx, volker.
#10
General Discussion / VXLAN via Wireguard
August 17, 2021, 09:59:21 AM
Hi,
i have set up a VXLAN tunnel over a wireguard connection. unfortunately i don't get any data over the VXLAN tunnel, according to my research it already fails at the ARP request. if i send a ping at host1 towards host2, an ARP request arrives at host2 but unfortunately it is never answered?! what could be the reason for this?

a second VXLAN tunnel that goes directly over the LAN interface runs without problems, only when I put wireguard below it I have the ARP problems.

regards, volker.
#11
hi, this is my current site-site layer 2 setup:


                             xxxxxxxxxxxx
                ┌──────┐     x          x       WAN via PPPoE
                │Router├─────x INTERNET x─────────────┐
                └──┬───┘     x          x             │
                   │         xxxxxxxxxxxx             │
                WAN│                                  │
┌──────────────────┴─┐                ┌───────────────┴──────┐
│OpnSense I          │                │OpnSense II           │
│                    │ WireGuard VPN  │                      │
│ ┌────────┐         │================│         ┌────────┐   │
│ │ BRIDGE ├─────────┼────────────────┼─────────┤ BRIDGE │   │
│ └┬───────┘  VXLAN  │================│  VXLAN  └────┬───┘   │
│  │                 │                │              │       │
│  │                 │                │          │   │VLAN100│
│  │                 │                │          ├───┘       │
└──┼─────────────────┘                │          │           │
   │                                  └──────────┼───────────┘
   │LAN                                       LAN│
                                                 ├───┐
                                                 │   │VLAN100


current speedtests (iperf) between bridge-to-bridge or vxlan-to-vxlan interfaces are round about 40MBit/s (up-/download), but my WAN-uplink supports 100/100MBit/s.
so, i think this problems relies on MTU/MSS miss configuration. all external links are default 1500 MTU values and can or should not change. i'm a bit confused about the "tunell in tunnel" (wireguard/vxlan) config and on the right hand side the PPPoE tunnel too :S
maybe someone can help me to define the right MTU/MSS values to bring mit layer2 site-to-site config in full speed!

thx, volker.
#12
German - Deutsch / Externes Captive-Portal
October 29, 2020, 03:43:00 PM
Moin,
ich würde gerne ein externes captive-portal verwenden und das session-management an der OPNsense via API steuern. wenn ich mir aber die API anschaue sehe ich nicht wie ich einzelne geräte den zugriff gestatten kann (https://docs.opnsense.org/development/api/core/captiveportal.html) ??? ich würde gerne sämtliche logik aus dem OPNsense raus ziehen und mittels RADIUS/API den zugriff steuern.

geht das so wie ich mir das vorstelle?
#13
moin, folgender aufbau:

+---------+
| SERVER 1|
+---------+
   |10.50.0.7
   |
   |LAN 10.50.0.0/24
   |
   |10.50.0.114
+--------------+
|OPNsense 1    |
+---+----------+
    |       |10.90.0.4
    |WAN    |
    |       |
    |       |Wireguard
    |       |VPN
    +       |10.90.0.0/24
INTERNET    |
   +        |
   |        |
   |        |
   |WAN     |
   |        |10.90.0.1
+-+--------+
|OPNsense 2|
+----------+
     |192.168.90.0.1
     |
     |LAN 192.168.90.0/24
     |
     |
+---+-----+
| SERVER 2| 192.168.90.50
+---------+


server 1 will server 2 erreichen. aktuell geht es nicht, kann kein ping von server 1 zu server 2 absetzen. setze ich den gleichen ping vom OPNsense 1 ab und gebe das wireguard interface als source an, geht der ping durch. gebe ich das LAN interface an, geht es nicht.

routing auf OPNsense 1 schaut so aus:


Proto Destination Gateway Flags Use MTU Netif Netif (name) Expire
ipv4 default 10.99.0.1 UGS 8852 1500 em0 wan
ipv4 10.50.0.0/24 link#2 U 1770 1500 em1 lan
ipv4 10.50.0.114 link#2 UHS 0 16384 lo0 Loopback
ipv4 10.90.0.0/24 wg0 US 0 1420 wg0 s2s
ipv4 10.90.0.1/32 wg0 US 0 1420 wg0 s2s
ipv4 10.90.0.4 link#8 UH 0 1420 wg0 s2s
ipv4 10.99.0.0/24 link#1 U 66252 1500 em0 wan
ipv4 10.99.0.10 link#1 UHS 0 16384 lo0 Loopback
ipv4 10.99.0.11 link#1 UHS 0 16384 lo0 Loopback
ipv4 127.0.0.1 link#5 UH 48 16384 lo0 Loopback
ipv4 192.168.90.0/24 wg0 US 12 1420 wg0 s2s


firewall rules auf dem OPNsense 1 habe ich für das LAN & s2s interface mal jeweils ein in und out wildcard rule gesetzt, damit sollte hier nichts im wege stehen.

auf dem server 1 habe ich eine entsprechende route gesetzt:


# ip route
default via 10.10.10.1 dev vmbr0 proto kernel onlink
10.10.10.0/24 dev vmbr0 proto kernel scope link src 10.10.10.53
10.50.0.0/24 dev vmbr50 proto kernel scope link src 10.50.0.7
10.90.0.0/24 via 10.50.0.114 dev vmbr50
100.64.0.0/24 dev vmbr1 proto kernel scope link src 100.64.0.53
192.168.90.0/24 via 10.50.0.114 dev vmbr50


das s2s interface erreiche ich vom server 1 aus:


# ping 10.90.0.4
PING 10.90.0.4 (10.90.0.4) 56(84) bytes of data.
64 bytes from 10.90.0.4: icmp_seq=1 ttl=64 time=0.656 ms
64 bytes from 10.90.0.4: icmp_seq=2 ttl=64 time=0.543 ms
64 bytes from 10.90.0.4: icmp_seq=3 ttl=64 time=0.444 ms
^C
--- 10.90.0.4 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 47ms
rtt min/avg/max/mdev = 0.444/0.547/0.656/0.090 ms


aber das remote s2s interface nicht mehr:


# ping 10.90.0.1
PING 10.90.0.1 (10.90.0.1) 56(84) bytes of data.
^C
--- 10.90.0.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 13ms


geschweige denn das eigentliche ziel:


# ping 192.168.90.50
PING 192.168.90.50 (192.168.90.50) 56(84) bytes of data.
^C
--- 192.168.90.50 ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 139ms


ist sicherlich was ganz triviales  ???, aber irgendwie macht es nicht click bei mir?! bin für jeden tip dankbar!

grüße,
volker.

EDIT1:

ein packed capture zeigt dass der ping am LAN & s2s interface vom OPNsense 1 vom server 1 ankommt, dann kann ich den ping nicht mehr sehen, am OPNsense 2 kommt am s2s interface nichts mehr an:


# OPNsense 1 - s2s interface, gibt aber kein response hier drauf...
Interface Capture output
s2s
wg0 08:11:53.865945 IP 10.50.0.7 > 192.168.90.50: ICMP echo request, id 64372, seq 427, length 64
#14
General Discussion / Dynamic Interface handling
June 18, 2020, 09:15:01 AM
moin,
i'm running an opnsense in a VM. every now and then i want to add new interfaces. the new interface is recognized after the reboot of the VM, but unfortunately it messes up the device names (vtnet1,vtnet2,vtnet3,...) given by the network driver, or puts them in a new order. this of course shatters all configs and makes the opnsense unusable.
on the basis of this statement i created scripts and wanted to rename the interfaces with devd according to the MAC. unfortunately nothing happens after a reboot, so my fix is not executed. what am i doing wrong?

/etc/fix-if-name.sh

#!/bin/sh
dev=$1
mac=$(ifconfig $dev | grep ether | awk '{print $2;}')
name=$(grep ^$mac /etc/ifmap | awk '{print $2;}')
if [ -n $name ]; then
    logger Rename interface $dev to $name
    ifconfig $dev name $name
fi


/etc/ifmap

fa:16:3e:04:XX:XX MGMT
fa:16:3e:f2:XX:XX EXT50
fa:16:3e:6f:XX:XX DEPLOY


/etc/devd/fix-if-name.conf

# notify 0 {
attach 0 {
        match "system"          "IFNET";
        match "type"            "ATTACH";
        media-type              "ethernet";
        action "/etc/fix-if-name.sh $device-name";
};


greez & thx,
volker
#15
German - Deutsch / Dynamisches interface handling
June 17, 2020, 04:44:33 PM
moin,
ich betreibe ein opnsense in einer VM. hier kommt es ab und zu mal vor, dass ich neue interfaces hinzufügen möchte. zwar wird nach dem reboot der VM das neue interface erkannt, leider bringt es die vom network-treiber herausgegebenen device-names (vtnet1,vtnet2,vtnet3,...) durcheinander, bzw in eine neue reihenfolge. das zerschießt natürlich sämtliche configs und macht das opnsense unbrauchbar.
auf basis dieser aussage habe ich entsprechende scripte angelegt und wollte nun mittels devd die interfaces anhand der MAC immer umbenennen. leider passiert nach einem reboot einfach nichts, also mein fix wird nicht ausgeführt. was mache ich falsch?

/etc/fix-if-name.sh

#!/bin/sh
dev=$1
mac=$(ifconfig $dev | grep ether | awk '{print $2;}')
name=$(grep ^$mac /etc/ifmap | awk '{print $2;}')
if [ -n $name ]; then
    logger Rename interface $dev to $name
    ifconfig $dev name $name
fi


/etc/ifmap

fa:16:3e:04:XX:XX MGMT
fa:16:3e:f2:XX:XX EXT50
fa:16:3e:6f:XX:XX DEPLOY


/etc/devd/fix-if-name.conf

# notify 0 {
attach 0 {
        match "system"          "IFNET";
        match "type"            "ATTACH";
        media-type              "ethernet";
        action "/etc/fix-if-name.sh $device-name";
};


greez & thx,
volker

EDIT: crossposting