Code Select
Stupid netmask error.
Sorry for the noise,
ajr
[quote author=ajr link=msg=266678 date=1778348248]
inet 192.168.178.12 netmask 0xffffffff broadcast 192.168.178.12
[/quote]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 MenuQuote from: ajr on May 10, 2026, 06:47:42 PMQuote from: viragomann on May 10, 2026, 10:46:22 AMQuote from: ajr on May 10, 2026, 09:41:54 AMtcpdump does not show any packets on the WAN interface so I do not know the sender address.Any source address in packets stemming from 127.0.0.0/8 is translated to the CARP VIP on the WAN due to your rule. So it's obvious the you cannot see any IP of this subnet.^^
So I try this:root@opn1:~ # pfctl -s nat192.168.178.11 is the interface address and 192.168.178.2 is the VIP.
no nat proto carp all
nat on igb1 inet from ! <opn1_igb1_plus_lo_addr> to any -> 192.168.178.2 port 1024:65535
nat on igb1 inet from <opn1_igb1_plus_lo_addr> to any -> <opn1_igb1_address> port 1024:65535 round-robin
root@opn1:~ # pfctl -T show -t opn1_igb1_address
192.168.178.11
root@opn1:~ # pfctl -T show -t opn1_igb1_plus_lo_addr
127.0.0.0/8
192.168.178.11
Any comments ?
# pfctl -s nat
no nat proto carp all
nat on igb1 inet from ! <opn2_igb1_plus_lo_addr> to any -> 192.168.178.2 port 1024:65535
nat on igb1 inet from <opn2_igb1_plus_lo_addr> to any -> <opn2_igb1_address> port 1024:65535 round-robin
root@opn2:~ # pfctl -T show -t opn2_igb1_address
192.168.178.12
root@opn2:~ # pfctl -T show -t opn2_igb1_plus_lo_addr
127.0.0.0/8
192.168.178.12
root@opn2:~ # ping 192.168.178.1
PING 192.168.178.1 (192.168.178.1): 56 data bytes
ping: sendto: Invalid argument
Quote from: viragomann on May 10, 2026, 10:46:22 AMQuote from: ajr on May 10, 2026, 09:41:54 AMtcpdump does not show any packets on the WAN interface so I do not know the sender address.Any source address in packets stemming from 127.0.0.0/8 is translated to the CARP VIP on the WAN due to your rule. So it's obvious the you cannot see any IP of this subnet.^^
root@opn1:~ # pfctl -s nat
no nat proto carp all
nat on igb1 inet from ! <opn1_igb1_plus_lo_addr> to any -> 192.168.178.2 port 1024:65535
nat on igb1 inet from <opn1_igb1_plus_lo_addr> to any -> <opn1_igb1_address> port 1024:65535 round-robin
root@opn1:~ # pfctl -T show -t opn1_igb1_address
192.168.178.11
root@opn1:~ # pfctl -T show -t opn1_igb1_plus_lo_addr
127.0.0.0/8
192.168.178.11
192.168.178.11 is the interface address and 192.168.178.2 is the VIP.Quoteauthor=viragomann link=msg=266681 date=1778350489]Exactly that is addressed by the 2 NAT rules.
You nat any traffic on WAN to the CARP VIP apart from the interface address. But the CARP VIP is naturally occupied by the master node, and the backup cannot use it.
QuoteTraffic from OPNsense itself might rather come from 127.0.0.0/8, however. So you have to nat this subnet to the WAN interface address.tcpdump does not show any packets on the WAN interface so I do not know the sender address.
root@opn2:~/admin # ping 192.168.178.1
PING 192.168.178.1 (192.168.178.1): 56 data bytes
ping: sendto: Invalid argument
ping: sendto: Invalid argument
root@opn2:~ # ifconfig igb1
igb1: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
description: WAN (wan)
options=4802028<VLAN_MTU,JUMBO_MTU,WOL_MAGIC,HWSTATS,MEXTPG>
ether 00:0d:b9:4f:fd:a1
inet 192.168.178.12 netmask 0xffffffff broadcast 192.168.178.12
inet 192.168.178.2 netmask 0xffffff00 broadcast 192.168.178.255 vhid 1
inet6 fe80::20d:b9ff:fe4f:fda1%igb1 prefixlen 64 scopeid 0x2
inet6 some_DTAG_IP6 prefixlen 64 autoconf pltime 1280 vltime 7200
inet6 fd77:8819:994b:0:20d:b9ff:fe4f:fda1 prefixlen 64 autoconf pltime 3600 vltime 7200
carp: BACKUP vhid 1 advbase 1 advskew 100
peer 224.0.0.18 peer6 ff02::12
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
root@opn2:~ # pfctl -s nat
no nat proto carp all
nat on igb1 inet from ! <opn2_igb1_address> to any -> 192.168.178.2 port 1024:65535
nat on igb1 inet from <opn2_igb1_address> to any -> <opn2_igb1_address> port 1024:65535 round-robin
no rdr proto carp all
no rdr on igb0 proto tcp from any to (igb0) port = http
no rdr on igb0 proto tcp from any to (igb0) port = 44221
no rdr on igb0 proto tcp from any to (igb0) port = 44441
root@opn2:~ # tcpdump -nvs 300 -i igb1 not vrrp
tcpdump: listening on igb1, link-type EN10MB (Ethernet), snapshot length 300 bytes
16:20:29.133096 5c:6a:80:f5:84:a0 > ff:ff:ff:ff:ff:ff, Realtek unknown type 0x25
root@opn2:~ # route get 193.99.144.80
route to: redirector.heise.de
destination: default
mask: default
gateway: 192.168.178.1
fib: 0
interface: igb1
flags: <UP,GATEWAY,DONE,STATIC>
recvpipe sendpipe ssthresh rtt,msec mtu weight expire
0 0 0 0 1500 1 0
Quote from: viragomann on August 17, 2025, 06:38:31 PMYou have to nat outgoing traffic from OPNsense itself (127.0.0.0/8) to the WAN address.
All other traffic from networks behind has to be natted to the WAN VIP.
root@opn2:~ # pfctl -s nat
no nat proto carp all
nat on igb1 inet from ! <opn2_igb1_address> to any -> 192.168.178.2 port 1024:65535
nat on igb1 inet from <opn2_igb1_address> to any -> <opn2_igb1_address> port 1024:65535 round-robin
no rdr proto carp all
root@opn2:~ # ping heise.de
PING heise.de (193.99.144.80): 56 data bytes
64 bytes from 193.99.144.80: icmp_seq=0 ttl=249 time=7.748 ms
64 bytes from 193.99.144.80: icmp_seq=1 ttl=249 time=5.823 ms
ifconfig igb1 add alias 192.168.178.110/24
route add default 192.168.178.110 192.168.178.1
ping heise.de
64 bytes from 193.99.144.80: icmp_seq=0 ttl=248
QuoteQuote from: viragomann on July 24, 2025, 09:23:22 PMI seem to miss the attachment (still struggling with the formum GUI).
What do your outbound NAT rules look like?
See atachment.
Quote from: viragomann on July 24, 2025, 09:23:22 PMWhat do your outbound NAT rules look like?See atachment.
QuoteDid override its outbound behavior with a manual rule by any chance?I'm not aware of any.
igb1: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
description: WAN (wan)
options=4802028<VLAN_MTU,JUMBO_MTU,WOL_MAGIC,HWSTATS,MEXTPG>
ether 00:0d:b9:4f:fd:a1
inet 192.168.178.12 netmask 0xffffff00 broadcast 192.168.178.255
inet 192.168.178.2 netmask 0xffffff00 broadcast 192.168.178.255 vhid 1
inet6 fe80::20d:b9ff:fe4f:fda1%igb1 prefixlen 64 scopeid 0x2
inet6 2003:cb:170c:9700:20d:b9ff:fe4f:fda1 prefixlen 64 autoconf pltime 1799 vltime 7200
inet6 fd77:8819:994b:0:20d:b9ff:fe4f:fda1 prefixlen 64 autoconf pltime 3600 vltime 7200
carp: BACKUP vhid 1 advbase 1 advskew 100
peer 224.0.0.18 peer6 ff02::12
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
Ping to VDSL-Router (FB) shows:
root@opn2:~ # ping -S 192.168.178.12 192.168.178.1
PING 192.168.178.1 (192.168.178.1) from 192.168.178.12: 56 data bytes
^C
root@opn2:~ # tcpdump -nves 300 -i igb1 icmp
tcpdump: listening on igb1, link-type EN10MB (Ethernet), snapshot length 300 bytes
18:31:25.136468 00:0d:b9:4f:fd:a1 > cc:ce:1e:b3:75:7f, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 19554, offset 0, flags [none], proto ICMP (1), length 84)
192.168.178.2 > 192.168.178.1: ICMP echo request, id 17147, seq 0, length 64
root@opn2:~ # tcpdump -nves 300 -i pflog0 icmp
tcpdump: listening on pflog0, link-type PFLOG (OpenBSD pflog file), snapshot length 300 bytes
18:27:33.276553 rule 200/0(match): block in on igb1: (tos 0x0, ttl 63, id 56317, offset 0, flags [none], proto ICMP (1), length 84)
192.168.178.2 > 192.168.178.12: ICMP echo reply, id 49522, seq 6, length 64
Quote from: ajr on March 01, 2025, 09:33:52 PMUnfortunately this breaks connectivity of the backup system and
needs some hack (route through master system) to do firmware update.