OpenVPN mit LEDE/OpenWRT oder „Bubbles“: Unterschied zwischen den Versionen

Aus FunkFeuer Wiki
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „ENTWURF - FEEDBACK WILLKOMMEN Diese Anleitung unterscheidet sich nicht besonders von dem, was wir für Debian oder für den EdgeRouter brauchen. Voraussetzung…“)
 
Zeile 9: Zeile 9:


Bridge anlegen über die Konsole:
Bridge anlegen über die Konsole:
uci set network.ff=interface
uci set network.ff=interface
uci set network.ff.ifname='ff'
uci set network.ff.ifname='ff'
uci set network.ff.type='bridge'
uci set network.ff.type='bridge'
uci set network.ff.proto='static'
uci set network.ff.proto='static'
uci set network.ff.ipaddr='[FUNKFEUER-IP-ADRESSE-AUS-REDEEMER]'
uci set network.ff.ipaddr='[FUNKFEUER-IP-ADRESSE-AUS-REDEEMER]'
uci set network.ff.netmask='255.255.255.255'
uci set network.ff.netmask='255.255.255.255'
uci commit
uci commit




Zeile 21: Zeile 21:


/etc/config/openvpn:
/etc/config/openvpn:
config openvpn 'Funkfeuer'
config openvpn 'Funkfeuer'
option enabled '1'
option enabled '1'
option config '/etc/openvpn/funkfeuer.conf'
option config '/etc/openvpn/funkfeuer.conf'


/etc/openvpn/funkfeuer.conf:
/etc/openvpn/funkfeuer.conf:
<nowiki>
dev            tap-ff
dev            tap-ff
dev-type        tap
dev-type        tap
proto          udp
proto          udp
remote          78.41.115.16
remote          78.41.115.16
port            [5XXX]
port            [5XXX]
up-delay
up-delay
down-pre
down-pre
up-restart
up-restart
# comp-lzo #lassen wir aus Kompatibilitätsgrunden aus
# comp-lzo #lassen wir aus Kompatibilitätsgrunden aus
script-security 2
script-security 2
nobind
nobind
ping 10
ping 10
ping-restart 60
ping-restart 60
ping-timer-rem
ping-timer-rem
fast-io
fast-io
sndbuf  524288  
sndbuf  524288  
rcvbuf  524288
rcvbuf  524288
mute 2
mute 2
verb 0
verb 0
secret /etc/openvpn/funkfeuer.secret
secret /etc/openvpn/funkfeuer.secret
auth none
auth none
cipher none
cipher none
up "/etc/openvpn/scripts/funkfeuer-ifupdown.sh"
up "/etc/openvpn/scripts/funkfeuer-ifupdown.sh"
down "/etc/openvpn/scripts/funkfeuer-ifupdown.sh"
down "/etc/openvpn/scripts/funkfeuer-ifupdown.sh"
 
</nowiki>


/etc/openvpn/funkfeuer.secret:
/etc/openvpn/funkfeuer.secret:
Zeile 57: Zeile 56:


/etc/openvpn/scripts/funkfeuer-ifupdown.sh:
/etc/openvpn/scripts/funkfeuer-ifupdown.sh:
#!/bin/sh
#!/bin/sh
logger "$dev $script_type"
logger "$dev $script_type"
br=br-ff
br=br-ff
case "$script_type" in
case "$script_type" in
      up)
        up)
              /sbin/brctl addif $br $dev
                /sbin/brctl addif $br $dev
              /sbin/ip link set $br promisc on
                /sbin/ip link set $br promisc on
              /sbin/ip link set $dev up
                /sbin/ip link set $dev up
      ;;
        ;;
      down)
        down)
              /sbin/ip link set $dev down  
                /sbin/ip link set $dev down  
              /sbin/ip link set $br promisc off
                /sbin/ip link set $br promisc off
              /sbin/brctl delif $br $dev
                /sbin/brctl delif $br $dev  


      ;;
        ;;
      *)
        *)
esac
esac
exit 0
exit 0

Version vom 16. Juni 2019, 01:24 Uhr

ENTWURF - FEEDBACK WILLKOMMEN

Diese Anleitung unterscheidet sich nicht besonders von dem, was wir für Debian oder für den EdgeRouter brauchen. Voraussetzung ist ein OpenWRT-Build mit bridge-utils, iproute2 und openvpn. Wir legen auf OpenWRT eine Bridge ohne Interfaces an, konfigurieren OpenVPN und legen ein ifup-down-Skript für den Tunnel an. OLSR läuft auf der Bridge.

Paketvorschlag: luci-app-openvpn luci-i18n-openvpn-de openvpn-mbedtls ip-full

Bridge anlegen über die Konsole:

uci set network.ff=interface
uci set network.ff.ifname='ff'
uci set network.ff.type='bridge'
uci set network.ff.proto='static'
uci set network.ff.ipaddr='[FUNKFEUER-IP-ADRESSE-AUS-REDEEMER]'
uci set network.ff.netmask='255.255.255.255'
uci commit


[Ergänzen ... OLSR mittels UCI konfigurieren ...]

/etc/config/openvpn:

config openvpn 'Funkfeuer'
	option enabled '1'
	option config '/etc/openvpn/funkfeuer.conf'

/etc/openvpn/funkfeuer.conf:

dev             tap-ff
dev-type        tap
proto           udp
remote          78.41.115.16
port            [5XXX]
up-delay
down-pre
up-restart
# comp-lzo #lassen wir aus Kompatibilitätsgrunden aus
script-security 2
nobind
ping 10
ping-restart 60
ping-timer-rem
fast-io
sndbuf  524288 
rcvbuf  524288
mute 2
verb 0
secret /etc/openvpn/funkfeuer.secret
auth none
cipher none
up "/etc/openvpn/scripts/funkfeuer-ifupdown.sh"
down "/etc/openvpn/scripts/funkfeuer-ifupdown.sh"


/etc/openvpn/funkfeuer.secret:


/etc/openvpn/scripts/funkfeuer-ifupdown.sh:

#!/bin/sh
logger "$dev $script_type"
br=br-ff
case "$script_type" in
       up)
               /sbin/brctl addif $br $dev
               /sbin/ip link set $br promisc on
               /sbin/ip link set $dev up
       ;;
       down)
               /sbin/ip link set $dev down 
               /sbin/ip link set $br promisc off
               /sbin/brctl delif $br $dev 
       ;;
       *)
esac
exit 0