OPNsense Forum

International Forums => German - Deutsch => Topic started by: zitlo on December 05, 2018, 10:53:00 am

Title: Ipv6 über OpenVPN im Netzwerk verteilen, fehlende Route?
Post by: zitlo on December 05, 2018, 10:53:00 am
Moin,

ich hoffe hier kann mir jemand helfen, ich bin am verzweifeln.

Problem: Ich habe bei mir Zuhause noch kein ipv6, nur ein statisches v4.
Angedachte Lösung: Server für ein 10Eur/mtl mieten, mit einem /56 und die /64 über Openvpn mit OPNsense in meinem Netzwerk verteilen.

Mein Setup:
Ich habe einen Freebsd Server mit einem /56 bei einem Hoster, wo ein OpenVPN Server läuft:

ipv6 Subnetz: 2001:xxx:xxxx:1000::/56

OpenVPN Server config:

Code: [Select]
port 1194
proto udp
proto udp6
dev tun
ca /usr/local/etc/openvpn/pki/ca.crt
cert /usr/local/etc/openvpn/pki/issued/xxx.crt
key /usr/local/etc/openvpn/pki/private/xxx.key
dh /usr/local/etc/openvpn/pki/dh.pem
tls-auth /usr/local/etc/openvpn/ta.key 0
remote-cert-tls client
server 10.8.0.0 255.255.255.0
server-ipv6 2001:xxx:xxxx:1001::/64
ifconfig-pool-persist ipp.txt
keepalive 10 120
cipher AES-256-CBC
group nobody
user nobody
persist-key
persist-tun
status openvpn-status.log
log-append  openvpn.log
verb 6
explicit-exit-notify 1
mute 20
tun-ipv6
push "route-ipv6 2000::/3"

ifconfig:

Code: [Select]
igb0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=6403bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6>
ether 00:08:a2:0c:4f:b8
hwaddr 00:08:a2:0c:4f:b8
inet 195.xxx.xxx.229 netmask 0xffffff00 broadcast 195.xxx.xxx.255
inet6 fe80::xxx:xxx:xxxx:4fb8%igb0 prefixlen 64 scopeid 0x1
inet6 2001:xxx:xxxx:xxx:xxx:a2ff:fe0c:4fb8 prefixlen 64 autoconf
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
inet6 fe80::208:a2ff:fe0c:4fb8%tun0 prefixlen 64 scopeid 0x3
inet6 2001:xxx:xxxx:1001::1 prefixlen 64
inet 10.8.0.1 --> 10.8.0.2 netmask 0xffffffff
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: tun
Opened by PID 83237

ipfw openvpn Regeln:

Code: [Select]
  # make VPN work
  - "add 10 allow all from any to any via tun0"
  - "add 1000 allow udp from any to me dst-port 1194 keep-state"
  - "add 120 skipto 501 ip4 from any to any out via igb0 keep-state"
  - "add 501 nat 1 ip4 from any to any"
  - "nat 1 config if igb0"
 

Die VPN Verbindung client <-> Server, von meinem Mac via Tunnelblick funktioniert:

ex. ping google.com
Code: [Select]
➜  ~ ping google.com
PING google.com (172.xxx.xx.xx): 56 data bytes
64 bytes from 172.xxx.xx.xx: icmp_seq=0 ttl=53 time=62.707 ms

➜  ~ ping6 google.com
PING6(56=40+8+8 bytes) 2001:xxx:xxxx:1001::1000 --> 2a00:1450:4001:81c::200e
16 bytes from 2a00:1450:4001:81c::200e, icmp_seq=0 hlim=53 time=62.197 ms

OPNsense Konfiguration:

ifconfig:

Code: [Select]
igb0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=4400b8<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,TXCSUM_IPV6>
ether 00:0d:b9:4c:53:3c
hwaddr 00:0d:b9:4c:53:3c
inet6 fe80::20d:b9ff:fe4c:533c%igb0 prefixlen 64 scopeid 0x1
inet xxx.xxx.xxx.xx netmask 0xffffff00 broadcast xxx.xxx.xxx.xxx.
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
igb1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=4400b8<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,TXCSUM_IPV6>
ether 00:0d:b9:4c:53:3d
hwaddr 00:0d:b9:4c:53:3d
inet6 fe80::20d:b9ff:fe4c:533d%igb1 prefixlen 64 scopeid 0x2
inet6 2001:xxx:xxxx:1002::1000 prefixlen 64
inet 192.168.2.254 netmask 0xffffff00 broadcast 192.168.2.255
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
igb2: flags=8c02<BROADCAST,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=6403bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6>
ether 00:0d:b9:4c:53:3e
hwaddr 00:0d:b9:4c:53:3e
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect
status: no carrier
enc0: flags=0<> metric 0 mtu 1536
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: enc
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
pflog0: flags=100<PROMISC> metric 0 mtu 33160
groups: pflog
pfsync0: flags=0<> metric 0 mtu 1500
groups: pfsync
syncpeer: 0.0.0.0 maxupd: 128 defer: off
ovpnc1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
inet6 fe80::20d:b9ff:fe4c:533c%ovpnc1 prefixlen 64 scopeid 0x8
inet6 2001:xxx:xxxx:1001::1000 prefixlen 64
inet 10.8.0.6 --> 10.8.0.5  netmask 0xffffffff
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: tun openvpn
Opened by PID 22508

igb 1 ist mein LAN Netzwerk:
192.168.2.0/24
2001:xxx:xxxx:1002::/64

Ping OPNsense -> OpenVPN Endpunkt:

Code: [Select]
ping6 2001:xxx:xxxx:1001::1
PING6(56=40+8+8 bytes) 2001:xxx:xxxx:1001::1000 --> 2001:xxx:xxxx:1001::1
16 bytes from 2001:xxx:xxxx:1001::1, icmp_seq=0 hlim=64 time=27.439 ms

Ping6 OPNsense -> google.com
Code: [Select]
ping6 google.com
PING6(56=40+8+8 bytes) 2001:xxx:xxxx:1001::1000 --> 2a00:1450:4007:817::200e
16 bytes from 2a00:1450:4007:817::200e, icmp_seq=0 hlim=55 time=47.972 ms

Der OpenVPN-Tunnel funktioniert also auf der OPNsense.
Ich kann auch:
- von der OPNsense mein Notebook pingen (ipv6)
- vom Notebook ovpnc1 2001:xxx:xxxx:1001::1000 und das LAN Netzwerk interface igb1 2001:xxx:xxxx:1002::1000 pingen

Mir fehlt also eine Route die ipv6 Pakete vom LAN Netzwerk über ovpnc1 <-> zum OpenVPN Server Endpunkt 2001:xxx:xxxx:1001::1 weiterleitet oder?

Weil ein Ping6 vom Notebook auf google.com funktioniert nicht.

Code: [Select]
➜  ~ ping6 2001:xxx:xxxx:1001::1
PING6(56=40+8+8 bytes) 2001:xxx:xxxx:1002:f992:b66b:2062:3196 --> 2001:xxx:xxxx:1001::1

--- 2001:xxx:xxxx:1001::1 ping6 statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss
➜  ~ traceroute6 google.com     
traceroute6 to google.com (2a00:1450:4001:81c::200e) from 2001:xxx:xxxx:1002:f992:b66b:2062:3196, 64 hops max, 12 byte packets
 1  OPNsense  9.299 ms  8.749 ms  10.221 ms

➜  ~ ping6 google.com     
PING6(56=40+8+8 bytes) 2001:xxx:xxxx:1002:f992:b66b:2062:3196 --> 2a00:1450:4001:81c::200e

Title: Re: Ipv6 über OpenVPN im Netzwerk verteilen, fehlende Route?
Post by: zitlo on December 06, 2018, 10:16:43 am
Ok ich habe das Problem lösen können.

Für alle:

auf dem OpenVPN Server das v6 Subnetz in /usr/local/etc/openvpn/ccd eintragen
Einfach nach "client-config-dir ccd" googlen...

Sonst kann der OpenVPN Server die Pakete nicht routen und wirft die ganze Zeit "MULTI: bad source address from client" Fehler