IPv4 und IPv6 einem Host zuweisen

Started by Tealk, July 12, 2025, 01:32:20 PM

Previous topic - Next topic
July 12, 2025, 01:32:20 PM Last Edit: July 12, 2025, 01:33:58 PM by Tealk
Hallo zusammen,

ich bin gerade dabei mein estes mal eine OPNsense einzurichten. Mein aktuelles Konstrukt sieht so aus:
Proxmox Server auf dem eine VM mit OPNsense läuft.
Ich leite alle IPv4 an die OPNsense weiter um dort dann per NAT die Anfragen entsprechen aufzuteilen.

Die VM's bekommen per Dnsmasq DNS & DHCP ihre IPv4 Adresse und jetzt dachte ich ich könnte im gleiche Eintrag auch dei IPv6 dem Server übergeben.
Bei dem Host habe ich folgendes eingetragen:
Host: proxy
Domain: proxy.example.com
IP addresses: 192.168.100.11,2a01:4f8:261:52db::c0a8:640b
Hardware addresses: MAC

DIe IPv4 bekommt die VM aber nicht die v6. Kann ich IPv4 und IPv6 nicht in einem Host Eintrag abarbeiten?


July 12, 2025, 03:55:14 PM #2 Last Edit: July 12, 2025, 04:06:03 PM by Tealk
Danke für die Links, trotz aller Einstellungen komme ich nicht weiter; in der Log steht:
2025-07-12T16:05:11   Informational   dnsmasq-dhcp   DHCPREPLY(vtnet1) 2a01:4f8:261:52db::1 00:01:00:01:2a:0e:ea:84:4a:07:57:86:8f:ae proxy   
2025-07-12T16:05:11   Informational   dnsmasq-dhcp   DHCPCONFIRM(vtnet1) 00:01:00:01:2a:0e:ea:84:4a:07:57:86:8f:ae   
2025-07-12T16:05:10   Informational   dnsmasq-dhcp   RTR-ADVERT(vtnet1) 2a01:4f8:261:52db::   
2025-07-12T16:05:10   Informational   dnsmasq-dhcp   RTR-SOLICIT(vtnet1) 4a:07:57:86:8f:ae   
2025-07-12T16:05:09   Informational   dnsmasq-dhcp   DHCPACK(vtnet1) 192.168.100.11 4a:07:57:86:8f:ae proxy   
2025-07-12T16:05:09   Informational   dnsmasq-dhcp   DHCPREQUEST(vtnet1) 192.168.100.11 4a:07:57:86:8f:ae   
2025-07-12T16:05:09   Informational   dnsmasq-dhcp   DHCPOFFER(vtnet1) 192.168.100.11 4a:07:57:86:8f:ae   
2025-07-12T16:05:09   Informational   dnsmasq-dhcp   DHCPDISCOVER(vtnet1) 192.168.100.11 4a:07:57:86:8f:ae   
2025-07-12T16:05:08   Informational   dnsmasq-dhcp   DHCPRELEASE(vtnet1) 192.168.100.11 4a:07:57:86:8f:ae

Die IP die ich in den Hosts zugewiese hab wird aber nicht angewendet

July 12, 2025, 04:08:16 PM #3 Last Edit: July 12, 2025, 04:10:19 PM by Monviech (Cedrik)
Wie sieht denn deine /usr/local/etc/dnsmasq.conf aus?

Zeig mal wie dort die dhcp-range für IPv6 aussieht, und den dhcp-host der angelegt wurde.
Hardware:
DEC740

July 12, 2025, 04:44:49 PM #4 Last Edit: July 12, 2025, 05:53:26 PM by Tealk
Kann ich grad nicht sagen, ich kann mich per root nicht mehr auf dem server anmelden. Webinterface geht aber das Terminal sagt immer Login incorrect

So nach einem PW resetz übers installationmedium, hier die cfg:

# DO NOT EDIT THIS FILE -- OPNsense auto-generated file
#

rebind-localhost-ok
stop-dns-rebind

port=53053

# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.
interface=vtnet1



dhcp-fqdn
domain=rollenspiel.network
# This tells dnsmasq that a domain is local and it may answer queries from /etc/hosts
# or DHCP but should never forward queries on that domain to any upstream servers.
local=/proxy.rollenspiel.network/
local=/rollenspiel.network/
local=/lan.internal/



enable-ra














# host entries flushed via dnsmasq_watcher.py [isc] and a dump of the static reservations
addn-hosts=/var/etc/dnsmasq-hosts
addn-hosts=/var/etc/dnsmasq-leases

dns-forward-max=5000
cache-size=10000
local-ttl=1

conf-dir=/usr/local/etc/dnsmasq.conf.d,*.conf

dhcp-range=tag:vtnet1,192.168.100.200,192.168.100.255,86400

domain=lan.internal,192.168.100.200,192.168.100.255
dhcp-range=tag:vtnet1,2a01:4f8:261:52db::1,2a01:4f8:261:52db::ffff,slaac,64,86400

domain=lan.internal,2a01:4f8:261:52db::1,2a01:4f8:261:52db::ffff
ra-param=vtnet1,60,1200


dhcp-host=id:00:01:00:01:2a:0e:ea:84:4a:07:57:86:8f:ae,4a:07:57:86:8f:ae,[2a01:4f8:261:52db::11],192.168.100.11,proxymanager

dhcp-option=tag:vtnet1,3,192.168.100.1
dhcp-option=tag:vtnet1,6,192.168.100.1
dhcp-option=tag:vtnet1,option6:23,[::]

# default dns mapped to this server (0.0.0.0)
dhcp-option=6,0.0.0.0


no-ident

Sieht eigendlich gut aus.

Könnte vielleicht hieran liegen, die IPv6 DHCP Regeln könnten fehlen, das war noch nicht im release drin:

https://github.com/opnsense/core/issues/8916



Hardware:
DEC740

Oh das wäre natürlich möglich, ich habe gerade mal zu testzwecken eine Regeln any to any für IPv4+6 gemacht, das klappte jedenfalls nicht.

Bekommen die Hosts:

- Gar keine IPv6 Adresse
- Eine SLAAC IPv6 Adresse
- Eine SLAAC und eine zusätzliche zufällige DHCPv6 IPv6 Adresse
Hardware:
DEC740

Lezteres:
2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 4a:07:57:86:8f:ae brd ff:ff:ff:ff:ff:ff
    altname enp0s18
    inet 192.168.100.11/24 brd 192.168.100.255 scope global dynamic ens18
       valid_lft 86242sec preferred_lft 86242sec
    inet6 2a01:4f8:261:52db::46fe/128 scope global dynamic
       valid_lft 7345sec preferred_lft 7045sec
    inet6 2a01:4f8:261:52db:4807:57ff:fe86:8fae/64 scope global dynamic mngtmpaddr
       valid_lft 86356sec preferred_lft 86356sec
    inet6 fe80::4807:57ff:fe86:8fae/64 scope link
       valid_lft forever preferred_lft forever