Hallo,
ich habe mir auf einem Raspberry den PI-hole mit Unbound eingerichtet und in der .json-Datei folgende Konfiguration erstellt:
{
"service":{
"nat":{
"rule":{
"1":{
"description":"DNS Anfragen aus VLAN 10 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.10",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"2":{
"description":"DNS Anfragen aus VLAN 20 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.20",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"3":{
"description":"DNS Anfragen aus VLAN 30 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.30",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"4":{
"description":"DNS Anfragen aus VLAN 40 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.40",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"5":{
"description":"DNS Anfragen aus VLAN 50 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.50",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"6":{
"description":"DNS Anfragen aus VLAN 60 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.60",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"7":{
"description":"DNS Anfragen aus VLAN 70 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.70",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"8":{
"description":"DNS Anfragen aus VLAN 80 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.80",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
}
}
}
}
}
Alles anzeigen
Diese Konfiguration funktioniert soweit ganz gut. Jetzt möchte ich noch eine VPN-Verbindung zwischen meiner USG und Hidemyname herstellen. Diese soll nur von VLAN 90 genutzt werden,
Die ovpn-Datei habe ich in der USG hinterlegt und folgenden Code eingefügt:
{
"firewall":{
"modify":{
"PBR_VPN":{
"rule":{
"20":{
"action":"modify",
"description":"traffic from VLan 90 to VPN Tunnel",
"modify":{
"table":"20"
},
"source":{
"address":"192.168.90.0/24"
}
}
}
}
},
"source-validation":"disable"
},
"interfaces":{
"ethernet":{
"eth1":{
"vif":{
"90":{
"firewall":{
"in":{
"modify":"PBR_VPN"
}
}
}
}
}
},
"openvpn":{
"vtun0":{
"config-file":"/config/user-data/openvpn/vpn.ovpn",
"description":"OpenVPN Tunnel"
}
}
},
"protocols":{
"static":{
"table":{
"20":{
"interface-route":{
"0.0.0.0/0":{
"next-hop-interface":{
"vtun0":"''"
}
}
}
}
}
}
},
"service":{
"nat":{
"rule":{
"1":{
"description":"DNS Anfragen aus VLAN 10 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.10",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"2":{
"description":"DNS Anfragen aus VLAN 20 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.20",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"3":{
"description":"DNS Anfragen aus VLAN 30 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.30",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"4":{
"description":"DNS Anfragen aus VLAN 40 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.40",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"5":{
"description":"DNS Anfragen aus VLAN 50 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.50",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"6":{
"description":"DNS Anfragen aus VLAN 60 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.60",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"7":{
"description":"DNS Anfragen aus VLAN 70 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.70",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"8":{
"description":"DNS Anfragen aus VLAN 80 umleiten",
"destination":{
"port":"53"
},
"inbound-interface":"eth1.80",
"inside-address":{
"address":"192.168.100.2",
"port":"53"
},
"source":{
"address":"!192.168.100.2"
},
"log":"disable",
"protocol":"tcp_udp",
"type":"destination"
},
"5020":{
"description":"OpenVPN Clients",
"log":"disable",
"outbound-interface":"vtun0",
"source":{
"address":"192.168.90.0/24"
},
"type":"masquerade"
}
}
}
}
}
Alles anzeigen
Nach der Provisionierung konnte ich aus VLAN90 heraus die IP-Adresse der VPN-Verbindung abfragen. Also der Aufbau und die Verbindung funktioniert.
Allerdings hatten die anderen VLANs keine Internetverbindung mehr.
Kann sich jemand die json-Konfiguration anschauen, wo der Fehler liegen könnte?
Ich beschreibe nochmal meine Netze und Funktionen die ich haben möchte:
- Netz Management: 192.168.1.0/24 (Unifi-Geräte)
- Netz VLAN 10: 192.168.10.0/24 (Familie 1 kabelgebundene Geräte)
- Netz VLAN 20: 192.168.20.0/24 (Familie 2 kabelgebundene Geräte)
- Netz VLAN 30: 192.168.30.0/24 (Familie 3 kabelgebundene Geräte)
- Netz VLAN 40: 192.168.40.0/24 (Haussteuerung -- SPS, HMI, PV-Wechselrichter...)
- Netz VLAN 50: 192.168.50.0/24 (VOIP Familie 1+2+3)
- Netz VLAN 60: 192.168.60.0/24 (WLAN Netz Familie 1+2+3)
- Netz VLAN 70: 192.168.70.0/24 (Gäste-WLAN)
- Netz VLAN 80: 192.168.80.0/24 (Testnetzwerk WLAN)
- Netz VLAN 90: 192.168.90.0/24 (VPN WLAN)
- Netz VLAN 100: 192.168.100.0/24 (DNS-Server PI-hole)
Wenn die VPN-Verbindung abbricht, dürfen die Geräte im VLAN90 nicht mehr ins Netz kommen (kein Fallback!)