Opennet per GRE: Unterschied zwischen den Versionen

Aus Opennet
Wechseln zu: Navigation, Suche
(Module / Packages =)
(GRE-Tunnel)
Zeile 59: Zeile 59:
  
 
== 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)

Version vom 15. März 2023, 21:20 Uhr

Inhaltsverzeichnis

Anwendungsfall 1

Layer-2-Tunnel 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

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'

Gre screen.png

Anwendungsfall 2

Zwei Accesspoints sind über ein LAN verbunden und sollen gleichzeitig eine Opennet-Verbindung übers LAN haben.

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

GRE-Tunnel

Das ist ein Layer-3-Tunnel.

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

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

OLSR auf Accesspoint A aktivieren:

Interface "oni"                                
{                                              
       Ip4Broadcast 172.16.0.2                
}

OLSR auf Accesspoint B aktivieren:

Interface "oni"                                
{                                              
       Ip4Broadcast 172.16.0.1
}

Aktivierung auf einem AP mit neuer Opennet-Firmware

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)

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)

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

Meine Werkzeuge
Namensräume

Varianten
Aktionen
Start
Opennet
Kommunikation
Karten
Werkzeuge