Opennet per GRE: Unterschied zwischen den Versionen
(Die Seite wurde neu angelegt: „= Anwendungsfall = Zwei Accesspoints sind über ein LAN verbunden und sollen gleichzeitig eine Opennet-Verbindung übers LAN haben. ==Ausgangskonfiguration== Acc…“) |
Thm (Diskussion | Beiträge) (→Anwendungsfall 1) |
||
(4 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
− | = Anwendungsfall = | + | = Anwendungsfall 1 = |
+ | |||
+ | Layer-2-Tunnel auf eth0 ohne Verschlüsselung (GRE TAP) durch "fremdes Gebiet" an eth1. | ||
+ | |||
+ | == Module / Packages == | ||
+ | |||
+ | * kmod-gre | ||
+ | * kmod-gre6 (bei Bedarf) | ||
+ | * gre | ||
+ | * luci-proto-gre (bei Bedarf) | ||
+ | |||
+ | == /etc/config/network == | ||
+ | |||
+ | <pre> | ||
+ | config device | ||
+ | option name 'eth1' | ||
+ | option mtu '1600' | ||
+ | |||
+ | config device | ||
+ | option name 'eth0' | ||
+ | |||
+ | config interface 'on_gretap' | ||
+ | option proto 'gretap' | ||
+ | option peeraddr '10.6.0.2' | ||
+ | option network 'on_br' | ||
+ | option mtu '1500' | ||
+ | |||
+ | config interface 'on_lan' | ||
+ | option proto 'static' | ||
+ | option device 'eth1' | ||
+ | option ipaddr '10.6.0.1' | ||
+ | option netmask '255.255.255.0' | ||
+ | |||
+ | config device | ||
+ | option type 'bridge' | ||
+ | option name 'br-gre' | ||
+ | list ports 'eth0' | ||
+ | option mtu '1500' | ||
+ | |||
+ | config interface 'on_br' | ||
+ | option proto 'static' | ||
+ | option device 'br-gre' | ||
+ | option ipaddr '192.168.5.71' | ||
+ | option netmask '255.255.0.0' | ||
+ | </pre> | ||
+ | |||
+ | [[Bild:Gre screen.png|480px]] | ||
+ | |||
+ | = Anwendungsfall 2 = | ||
Zwei Accesspoints sind über ein LAN verbunden und sollen gleichzeitig eine Opennet-Verbindung übers LAN haben. | Zwei Accesspoints sind über ein LAN verbunden und sollen gleichzeitig eine Opennet-Verbindung übers LAN haben. | ||
Zeile 12: | Zeile 60: | ||
== GRE-Tunnel == | == GRE-Tunnel == | ||
+ | |||
+ | Das ist ein Layer-3-Tunnel. | ||
+ | |||
===Tunnel auf Accesspoint A aufbauen:=== | ===Tunnel auf Accesspoint A aufbauen:=== | ||
(kernel-modul gre laden) | (kernel-modul gre laden) | ||
Zeile 83: | Zeile 134: | ||
'''und nun das ganze auf dem anderen AP mit vertauschten IP-Adressen, und das wars''' | '''und nun das ganze auf dem anderen AP mit vertauschten IP-Adressen, und das wars''' | ||
+ | |||
+ | |||
+ | [[Kategorie:Konfiguration]] |
Aktuelle Version vom 15. März 2023, 21:21 Uhr
Inhaltsverzeichnis |
[Bearbeiten] Anwendungsfall 1
Layer-2-Tunnel auf eth0 ohne Verschlüsselung (GRE TAP) durch "fremdes Gebiet" an eth1.
[Bearbeiten] Module / Packages
- kmod-gre
- kmod-gre6 (bei Bedarf)
- gre
- luci-proto-gre (bei Bedarf)
[Bearbeiten] /etc/config/network
config device option name 'eth1' option mtu '1600' config device option name 'eth0' config interface 'on_gretap' option proto 'gretap' option peeraddr '10.6.0.2' option network 'on_br' option mtu '1500' config interface 'on_lan' option proto 'static' option device 'eth1' option ipaddr '10.6.0.1' option netmask '255.255.255.0' config device option type 'bridge' option name 'br-gre' list ports 'eth0' option mtu '1500' config interface 'on_br' option proto 'static' option device 'br-gre' option ipaddr '192.168.5.71' option netmask '255.255.0.0'
[Bearbeiten] Anwendungsfall 2
Zwei Accesspoints sind über ein LAN verbunden und sollen gleichzeitig eine Opennet-Verbindung übers LAN haben.
[Bearbeiten] Ausgangskonfiguration
Accesspoint A:
- Lan-IP: 172.16.0.1/24
- Opennet-IP: 192.168.1.1/16
Accesspoint B:
- Lan-IP: 172.16.0.2/24
- Opennet-IP: 192.168.1.2/16
[Bearbeiten] GRE-Tunnel
Das ist ein Layer-3-Tunnel.
[Bearbeiten] Tunnel auf Accesspoint A aufbauen:
(kernel-modul gre laden) ip tunnel add oni mode gre remote 172.16.0.2 local 172.16.0.1 ttl 255 ip link set oni up ip addr add 192.168.11.1 dev oni ip route add 192.168.1.2 dev oni
[Bearbeiten] Tunnel auf Accesspoint B aufbauen:
(kernel-modul gre laden) ip tunnel add oni mode gre remote 172.16.0.1 local 172.16.0.2 ttl 255 ip link set oni up ip addr add 192.168.11.2 dev oni ip route add 192.168.1.1 dev oni
[Bearbeiten] OLSR auf Accesspoint A aktivieren:
Interface "oni" { Ip4Broadcast 172.16.0.2 }
[Bearbeiten] OLSR auf Accesspoint B aktivieren:
Interface "oni" { Ip4Broadcast 172.16.0.1 }
[Bearbeiten] Aktivierung auf einem AP mit neuer Opennet-Firmware
[Bearbeiten] Schnittstelle anlegen
Im Webinterface unter Administration->Netzwerk->Schnittstellen
- neue Schnittstelle hinzufügen (ganz unten)
- Name der neuen Schnittstelle: "on_eth_1" (noch nicht vergebene Schnittstelle nach Schema on_eth_X)
- Protocol of the new interface: "Static"
- benutzerdefinierte Schnittstelle: "oni"
--> absenden
- IPv4 address: 192.168.11.1 (noch nicht vergebene IP nach Schema 192.168.(n)X.Y
- IPv4 netmask: 255.255.0.0
--> Firewall-Einstellungen
- zuordnen zu "opennet"
(speichern)
[Bearbeiten] OLSR konfigurieren
Im Webinterface unter Administration->Dienste->OLSR
- hinzufügen (ganz unten)
- Netzwerk: on_eth_1 (wie oben)
- Tab IP-Adressen: IPv4 Broadcast: "172.16.0.2"
(speichern)
[Bearbeiten] GRE aktivieren
kmod-gre auf dem AP installieren (bspw. per Webfrontend oder von http://www.absorb.it/software/opennet/on_firmware/0.4-1/ar71xx/packages/kmod-gre_2.6.32.27-1_ar71xx.ipk laden und mit opkg installieren)
Im Webinterface unter Administration->System->Systemstart
Lokales Startskript ergänzen:
# Put your custom commands here that should be executed once # the system init finished. # execute potential opennet configuration parts [ -f /etc/rc.local_on-core ] && sh /etc/rc.local_on-core [ -f /etc/rc.local_on-openvpn ] && sh /etc/rc.local_on-openvpn [ -f /etc/rc.local_on-usergw ] && sh /etc/rc.local_on-usergw insmod ip_gre ip tunnel add oni mode gre remote 172.16.0.2 local 172.16.0.1 ttl 255 exit 0
und nun das ganze auf dem anderen AP mit vertauschten IP-Adressen, und das wars