Gesamten Fritz!Box LAN-Traffic über OpenVPN Tunnel ins Internet routen

Not as a static binary, but (hopefully) with all libraries (not tested)...
(and the makefile for freetz I used to build it)
 

Anhänge

  • ebtables_7390.tgz
    80.5 KB · Aufrufe: 44
  • make_ebtables.tgz
    1.2 KB · Aufrufe: 31
Thanks again! How did you get a version of freetz that supported the 7390? Is it in a separate repository/branch??
 
The 7390 is part of trunk version (and the upcomming version 1.2 stable branch)
 
Hi

Im try instaling iptables to my Fritzbox 7390 - international and Freetz svn 7690 - kernel 2.6.28.10

Maybe someone compiled driver and send me ??

Thank, very thanks

Regards
 
Hi Joerg, wie von Dir vorgeschlagen hier meine Frage im Forum.

Ziel:
1- Fritz Box als Client an VPN Dienst (Astrill) anmelden
2- Astrill unterstuetz OpenVpn (aber auch IPSec, L2TP, PPTP)
3- Einige Endgeraete (nicht alle, sagen wir z.B. nur fuer 192.168.20.111), die im Lan and der Fritzbox haengen ueber das VPN ins Internet (sind nicht alles Computer und koennen sich daher nicht selbst an VPN Server anmelden)

Ausgangssituation:
1- FB 7270 mit Freetz BETA 54.05.07freetz-devel-7891
2- Module in Freetz (siehe unten)
3- OpenVpn an Astill started (siehe unten)
4- Iptables funktioniert nicht richtig mit nhipt.cgi in Freetz (siehe unten)

Module in Freetz
Code:
Patches:	Pakete:	Module:	Libraries:
automount
> ext2
> ext3
> linuxswap
freetzmount
signed
vcc
avm_firewall
bridge_utils
haserl
inetd
iptables
> is_selectable
> kernel_modules
> save_restore
> shared_libs
> standard_modules
> xml
mod
> etcservices
modcgi
nhipt
openvpn
> enable_small
> with_lzo
vtun
> with_lzo
> with_shaper
> with_ssl
> with_zlib
ext2
ip_tables
ipt_LOG
ipt_REJECT
iptable_filter
mbcache
x_tables
xt_MARK
xt_iprange
xt_length
xt_limit
xt_mac
xt_mark
xt_multiport
xt_physdev
xt_pkttype
xt_tcpudp
ld_uClibc
libcrypt
libcrypto
libdl
libfreetz
libgcc_s
libip6t_icmp6
libipt_DNAT
libipt_LOG
libipt_MASQUERADE
libipt_REDIRECT
libipt_REJECT
libipt_SNAT
libipt_ULOG
libipt_addrtype
libipt_icmp
liblzo2
libm
libnsl
libpthread
librt
libssl
libuClibc
libxt_CLASSIFY
libxt_CONNMARK
libxt_MARK
libxt_TCPMSS
libxt_connbytes
libxt_connmark
libxt_iprange
libxt_length
libxt_limit
libxt_mac
libxt_mark
libxt_multiport
libxt_physdev
libxt_pkttype
libxt_standard
libxt_state
libxt_tcp
libxt_udp
libz
Entfernt:	CGI-Pakete:
branding_1und1
dtrace
syslogd

OpenVpn Log
Code:
Sun Oct 23 19:33:37 2011 OpenVPN 2.2.1 mipsel-linux [SSL] [LZO2] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Oct 22 2011
Sun Oct 23 19:33:37 2011 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Sun Oct 23 19:33:37 2011 WARNING: file '/tmp/flash/openvpn/Astrill_box.key' is group or others accessible
Sun Oct 23 19:33:37 2011 LZO compression initialized
Sun Oct 23 19:33:37 2011 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Sun Oct 23 19:33:37 2011 Socket Buffers: R=[178176->131072] S=[178176->131072]
Sun Oct 23 19:33:37 2011 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Sun Oct 23 19:33:37 2011 NOTE: chroot will be delayed because of --client, --pull, or --up-delay
Sun Oct 23 19:33:37 2011 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Sun Oct 23 19:33:37 2011 UDPv4 link local: [undef]
Sun Oct 23 19:33:37 2011 UDPv4 link remote: [AF_INET]207.126.94.3:8292
Sun Oct 23 19:33:38 2011 TLS: Initial packet from [AF_INET]207.126.94.3:8292, sid=4a8f1e5e aac8f21c
Sun Oct 23 19:33:39 2011 VERIFY OK: depth=1, /C=../ST=../L=../O=../OU=../CN=ASCA/emailAddress=..
Sun Oct 23 19:33:39 2011 VERIFY OK: nsCertType=SERVER
Sun Oct 23 19:33:39 2011 VERIFY OK: depth=0, /C=../ST=../L=../O=../OU=../CN=server-207.126.94.3/emailAddress=..
Sun Oct 23 19:33:42 2011 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sun Oct 23 19:33:42 2011 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Oct 23 19:33:42 2011 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sun Oct 23 19:33:42 2011 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Oct 23 19:33:42 2011 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Sun Oct 23 19:33:42 2011 [server-207.126.94.3] Peer Connection Initiated with [AF_INET]207.126.94.3:8292
Sun Oct 23 19:33:45 2011 SENT CONTROL [server-207.126.94.3]: 'PUSH_REQUEST' (status=1)
Sun Oct 23 19:33:45 2011 PUSH: Received control message: 'PUSH_REPLY,sndbuf 262144,rcvbuf 262144,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 5.5.0.1,ping 10,ping-restart 90,comp-lzo no,route-gateway 5.5.0.1,topology subnet,ifconfig 5.5.1.24 255.255.240.0'
Sun Oct 23 19:33:45 2011 OPTIONS IMPORT: timers and/or timeouts modified
Sun Oct 23 19:33:45 2011 OPTIONS IMPORT: LZO parms modified
Sun Oct 23 19:33:45 2011 OPTIONS IMPORT: --sndbuf/--rcvbuf options modified
Sun Oct 23 19:33:45 2011 Socket Buffers: R=[131072->356352] S=[131072->356352]
Sun Oct 23 19:33:45 2011 OPTIONS IMPORT: --ifconfig/up options modified
Sun Oct 23 19:33:45 2011 OPTIONS IMPORT: route options modified
Sun Oct 23 19:33:45 2011 OPTIONS IMPORT: route-related options modified
Sun Oct 23 19:33:45 2011 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Sun Oct 23 19:33:45 2011 TUN/TAP device tun0 opened
Sun Oct 23 19:33:45 2011 TUN/TAP TX queue length set to 100
Sun Oct 23 19:33:45 2011 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sun Oct 23 19:33:45 2011 /sbin/ifconfig tun0 5.5.1.24 netmask 255.255.240.0 mtu 1500 broadcast 5.5.15.255
Sun Oct 23 19:33:45 2011 NOTE: unable to redirect default gateway -- Cannot read current default gateway from system
Sun Oct 23 19:33:45 2011 chroot to '/tmp/openvpn' and cd to '/' succeeded
Sun Oct 23 19:33:45 2011 GID set to openvpn
Sun Oct 23 19:33:45 2011 UID set to openvpn
Sun Oct 23 19:33:45 2011 Initialization Sequence Completed

route -n nach OpenVpn start
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.180.1   0.0.0.0         255.255.255.255 UH    2      0        0 dsl
192.168.180.2   0.0.0.0         255.255.255.255 UH    2      0        0 dsl
192.168.179.0   0.0.0.0         255.255.255.0   U     0      0        0 guest
192.168.20.0    0.0.0.0         255.255.255.0   U     0      0        0 lan
87.201.195.0    0.0.0.0         255.255.255.0   U     2      0        0 dsl
5.5.0.0         0.0.0.0         255.255.240.0   U     0      0        0 tun0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 lan
0.0.0.0         0.0.0.0         0.0.0.0         U     2      0        0 dsl

Webbrowser nach Aufruf http://192.168.20.1:83/cgi-bin/nhipt.cgi
Code:
Parameter file not found in RAM-disk, loading boot settings
cat: can't open 'nhipt.par': No such file or directory
Stopping deamon iptlogger.sh
kill: you need to specify whom to kill
kill: you need to specify whom to kill
rm: can't remove '/var/tmp/debug.cfg': No such file or directory
STAGE0 - bootstrap reconfigured
cat: can't open 'nhipt.cfg': No such file or directory
modprobe: module ip_tables not found in modules.dep
iptables v1.4.11.1: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: module ip_tables not found in modules.dep
iptables v1.4.11.1: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: module ip_tables not found in modules.dep
iptables v1.4.11.1: can't initialize iptables table `mangle': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: module ip_tables not found in modules.dep
iptables v1.4.11.1: can't initialize iptables table `raw': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: module ip6_tables not found in modules.dep
ip6tables v1.4.11.1: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: module ip6_tables not found in modules.dep
ip6tables v1.4.11.1: can't initialize ip6tables table `mangle': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: module ip6_tables not found in modules.dep
ip6tables v1.4.11.1: can't initialize ip6tables table `raw': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
STAGE1 - complete bootfile written
STAGE4 - settings saved
rm: can't remove '/nhipt.*': No such file or directory
STAGE5 - housekeeping after transfer
###NHIPT-START###
Found Footer
cat: can't open '/var/tmp/debug.cfg': No such file or directory
STAGE0 - bootstrap reconfigured
cat: can't open 'nhipt.cfg': No such file or directory
modprobe: module ip_tables not found in modules.dep
iptables v1.4.11.1: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: module ip_tables not found in modules.dep
iptables v1.4.11.1: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: module ip_tables not found in modules.dep
iptables v1.4.11.1: can't initialize iptables table `mangle': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: module ip_tables not found in modules.dep
iptables v1.4.11.1: can't initialize iptables table `raw': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: module ip6_tables not found in modules.dep
ip6tables v1.4.11.1: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: module ip6_tables not found in modules.dep
ip6tables v1.4.11.1: can't initialize ip6tables table `mangle': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: module ip6_tables not found in modules.dep
ip6tables v1.4.11.1: can't initialize ip6tables table `raw': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
STAGE1 - complete bootfile written
STAGE4 - settings saved
rm: can't remove '/nhipt.*': No such file or directory
STAGE5 - housekeeping after transfer
Exit Code 0 - Saving Settings to /tmp/flash/...
Writing 9000 bytes to /var/flash/freetz ... done.

Fragen:
1- Hast Du alle infos die Du von mir brauchst um mir weiterzuhelfen?
2- Brauche ich ueberhaupt IPtables oder geht das auch mit Routes ueber das FB Webinterface?

Danke!
 
Zuletzt bearbeitet:
Moin,

da du ja nur einige Geräte "durch das VPN" schicken willst, würde ich kein "redirect-gateway" nutzen (das biegt das Routing so um, dass alle Geräte durch den Tunnel gehen).
Damit die Geräte das VPN nutzen können, musst du vermutlich die IP-Adressen aus deinem Netz hinter der VPN-IP (die die FB vom Server bekommt) "verstecken".
Dafür brauchst du schonmal unbedingt "iptables" auf der Box. Dann würde ich gleich auch das "Zwangsumleiten" der Clients damit machen. Mit "normalem" Routing geht das nicht, denn du willst ja "abhängig von der Absende-IP" routen...

Ich muss allerdings gestehen, dass ich nhipt nicht kenne/nutze.
Mache doch mal ein "lsmod", um zu sehen, ob die iptables-Module geladen sind.

Jörg
 
Hallo,

es sieht so aus als ob iptables nicht geladen wird. (nix nach lsmod was nach iptables aussieht zu sehen)

Hab aber das hier im Forum gefunden: http://www.ip-phone-forum.de/showthread.php?t=240728&highlight=iptables

Ich hoffe, ich kann das mit redirect-gateway beeinflussen, vermute es wird vom server gesendet.

Ergaenzung (das fand ich komisch, vielleicht ist es aber auch normal):

# find -name iptables
./usr/sbin/iptables
./var/mod/pkg/iptables

# find -name modules.dep
./lib/modules/2.6.32.21/modules.dep
./lib/modules/2.6.32.41/modules.dep
 
Zuletzt bearbeitet:
Das es einmal das Binary und einmal das "Freetz-Paket" gibt ist o.k.. Da mit den zweimal Modulen ist eher komisch. Vielleicht checkst du das ganze nochmal aus??
Sind denn überhaupt iptables Module auf der Box vorhanden (in " /lib/modules/2.6.32.XY/..."? Kannst du sie per "modprobe" laden?

Iptables muss laufen, sonst funktioniert dein Vorhaben nicht (wie gesagt, allein schon für NAT brauchst du das).

Jörg
 
Hi, erst mal sorry, dass es immer etwas mit meiner Antwort dauert. Ich bin beruflich immer nur so jeden 2. Tag zu Hause.

Es sieht so aus als ob es ein Problem mit iptables gibt.
root@fritz:/usr/sbin# modprobe iptables
modprobe: module iptables not found in modules.dep


Code:
cd /usr/sbin/
ls

80211stats
athstats
athstatsclr
blkid
chroot
crond
diag
dsl_monitor
e2fsck
fsck
fsck.ext2
fsck.ext3
fsck.ext4
fsck.ext4dev
httpd
inetd
ip6tables
ip6tables-restore
ip6tables-save
iptables
iptables-restore
iptables-save
iptables-xml
openvpn
rdate
setlogcons
telnetd
xtables-multi

cd /var/mod/pkg/
ls

avm
avm-firewall
bridge-utils
haserl
inetd
iptables
mod
modcgi
nhipt
openvpn
syslogd
vtun

cd /lib/modules/2.6.32.21/
ls

kernel
modules.dep

cd /lib/modules/2.6.32.41/
ls

kernel
modules.alias
modules.alias.bin
modules.ccwmap
modules.dep
modules.dep.bin
modules.devname
modules.ieee1394map
modules.inputmap
modules.isapnpmap
modules.ofmap
modules.order
modules.pcimap
modules.seriomap
modules.softdep
modules.symbols
modules.symbols.bin
modules.usbmap

Ich baue noch mal eine neue Firmware. Falls das nicht klappt, hast Du die ggf. in einem zip, welches ich auf die box kopieren kann? Ich hab eine laborversion benutzt und gerade im Forum gesehen, dass das Probleme geben kann.

Thx.
 
Zuletzt bearbeitet:
Hallo,

neu gebaut, nun: Firmware-Version 54.05.05freetz-devel-7891

Iptables scheint zu funktionieren.

Was nun?

Danke!
 
Jetzt? OpenVPN aufbauen und iptables-Regeln eintragen:

Code:
# NAT (da bin ich ziemlich sicher, dass es so geht
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE 

# "Erzwungene Nutzung" des tun0-Interfaces für 192.168.20.111
# benötigt iptables "mangle" Modul 
# (nur "zusammengeschrieben", nicht getestet, )
iptables -t mangle -A PREROUTING -s 192.168.20.111 -j ROUTE --oif tun0
 
Hi & Danke.

Hatte leider immernoch Probleme mit IPtables, daher nun auf: Firmware-Version 54.04.88freetz-1.2-stable

Port Forwarding: udp 0.0.0.0:8292 0.0.0.0:8292 0 # Astrill OpenVpn

Starte OpenVPN - weiterhin default gateway Fehlermeldung
Code:
cat > /var/tmp/debug_openvpn_Astrill.out << 'RUDI_EOF'
Sat Oct 29 18:12:44 2011 OpenVPN 2.2.1 mipsel-linux [SSL] [LZO2] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Oct 28 2011
Sat Oct 29 18:12:44 2011 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Sat Oct 29 18:12:44 2011 WARNING: file '/tmp/flash/openvpn/Astrill_box.key' is group or others accessible
Sat Oct 29 18:12:44 2011 LZO compression initialized
Sat Oct 29 18:12:44 2011 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Sat Oct 29 18:12:44 2011 Socket Buffers: R=[108544->131072] S=[108544->131072]
Sat Oct 29 18:12:44 2011 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Sat Oct 29 18:12:44 2011 NOTE: chroot will be delayed because of --client, --pull, or --up-delay
Sat Oct 29 18:12:44 2011 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Sat Oct 29 18:12:44 2011 UDPv4 link local: [undef]
Sat Oct 29 18:12:44 2011 UDPv4 link remote: [AF_INET]207.126.94.3:8292
Sat Oct 29 18:12:44 2011 TLS: Initial packet from [AF_INET]207.126.94.3:8292, sid=0debe14d 0ee914d6
Sat Oct 29 18:12:45 2011 VERIFY OK: depth=1, /C=../ST=../L=../O=../OU=../CN=ASCA/emailAddress=..
Sat Oct 29 18:12:45 2011 VERIFY OK: nsCertType=SERVER
Sat Oct 29 18:12:45 2011 VERIFY OK: depth=0, /C=../ST=../L=../O=../OU=../CN=server-207.126.94.3/emailAddress=..
Sat Oct 29 18:12:48 2011 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sat Oct 29 18:12:48 2011 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Oct 29 18:12:48 2011 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sat Oct 29 18:12:48 2011 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Oct 29 18:12:48 2011 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Sat Oct 29 18:12:48 2011 [server-207.126.94.3] Peer Connection Initiated with [AF_INET]207.126.94.3:8292
Sat Oct 29 18:12:51 2011 SENT CONTROL [server-207.126.94.3]: 'PUSH_REQUEST' (status=1)
Sat Oct 29 18:12:51 2011 PUSH: Received control message: 'PUSH_REPLY,sndbuf 262144,rcvbuf 262144,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 5.5.0.1,ping 10,ping-restart 90,comp-lzo no,route-gateway 5.5.0.1,topology subnet,ifconfig 5.5.1.24 255.255.240.0'
Sat Oct 29 18:12:51 2011 OPTIONS IMPORT: timers and/or timeouts modified
Sat Oct 29 18:12:51 2011 OPTIONS IMPORT: LZO parms modified
Sat Oct 29 18:12:51 2011 OPTIONS IMPORT: --sndbuf/--rcvbuf options modified
Sat Oct 29 18:12:51 2011 Socket Buffers: R=[131072->217088] S=[131072->217088]
Sat Oct 29 18:12:51 2011 OPTIONS IMPORT: --ifconfig/up options modified
Sat Oct 29 18:12:51 2011 OPTIONS IMPORT: route options modified
Sat Oct 29 18:12:51 2011 OPTIONS IMPORT: route-related options modified
Sat Oct 29 18:12:51 2011 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Sat Oct 29 18:12:51 2011 TUN/TAP device tun0 opened
Sat Oct 29 18:12:51 2011 TUN/TAP TX queue length set to 100
Sat Oct 29 18:12:51 2011 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sat Oct 29 18:12:51 2011 /sbin/ifconfig tun0 5.5.1.24 netmask 255.255.240.0 mtu 1500 broadcast 5.5.15.255
Sat Oct 29 18:12:51 2011 NOTE: unable to redirect default gateway -- Cannot read current default gateway from system
Sat Oct 29 18:12:51 2011 chroot to '/tmp/openvpn' and cd to '/' succeeded
Sat Oct 29 18:12:51 2011 GID set to openvpn
Sat Oct 29 18:12:51 2011 UID set to openvpn
Sat Oct 29 18:12:51 2011 Initialization Sequence Completed

cat > /var/log/openvpn_Astrill.log << 'RUDI_EOF'
OpenVPN STATISTICS
Updated,Sat Oct 29 18:14:44 2011
TUN/TAP read bytes,312
TUN/TAP write bytes,0
TCP/UDP read bytes,5603
TCP/UDP write bytes,4905
Auth read bytes,160
pre-compress bytes,0
post-compress bytes,0
pre-decompress bytes,0
post-decompress bytes,0
END

Starte IPTables:
Code:
Funktioniert: iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
Funktioniert Nicht: iptables -t mangle -A PREROUTING -s 192.168.20.111 -j ROUTE --oif tun0 
Fehlermeldung: iptables v1.4.1.1: Unknown arg `--oif'  (ich baue es noch mal neu und checke, dass magle drin ist, bin nicht sicher ob es bei mir aktiviert ist, oder hat --oif damit nix zu tuen?)

Route -n
Code:
root@fritz:/var/mod/root# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.180.1   0.0.0.0         255.255.255.255 UH    2      0        0 dsl
192.168.180.2   0.0.0.0         255.255.255.255 UH    2      0        0 dsl
192.168.179.0   0.0.0.0         255.255.255.0   U     0      0        0 guest
192.168.20.0    0.0.0.0         255.255.255.0   U     0      0        0 lan
87.201.195.0    0.0.0.0         255.255.255.0   U     2      0        0 dsl
5.5.0.0         0.0.0.0         255.255.240.0   U     0      0        0 tun0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 lan
0.0.0.0         0.0.0.0         0.0.0.0         U     2      0        0 dsl

Ich dachte, dass aufgrund des Fehlers beim 2. IPTables Befehl, der gesamte Lan traffic ueber OpenVpn gehen wuerde. Ist aber nicht der Fall. Alles geht wie vorher direkt ueber Provider.

Gruss + werde diesen Post updaten, falls sich das IPTables problem erledigt.

Thx.
 
Hab nochmal nachgelesen: Für "--oif" braucht man einen Patch.
Ich muss mal schauen, ob mir was anderes einfällt...
 
Hallo.

Einen Schritt weiter, nach folgendem in Ergänzung zu meinem vorigen Post (befehle kommen einem fruheren post von Jörg) geht es für alle Geräte im LAN (gehen alle über VPN ins Internet).:

Code:
# Set route to VPN server over device dsl
route add VPN-SERVER dev dsl

# Set route to tun0 device
route add -net 0.0.0.0/1 dev tun0
route add -net 128.0.0.0/1 dev tun0

Jetzt fehlt nur noch die Einschränkung, dass das alles nur für eine ip im LAN der fritzbox passieren soll und der Rest nicht über VPN sondern direkt über Provider geht.

Ideen? Thx
 
Also, es könnte mit "iproute2" gehen (dafür gibt es das Ticket #536 im Freetz).
Damit könnte man eine neue Routingtabelle einrichten, und per iptables die Pakete von der "besonderen Kiste" an diese Tabelle hängen, so wie es hier beschrieben ist.
Bei mir bekam ich auf die Schnelle aber iproute2 auf einem Speedport 701 nicht so recht zum laufen, sondern nur "RTNETLINK answers: Invalid argument":
Code:
root@Speedport:/var/mod/root# /tmp/ip rule list
root@Speedport:/var/mod/root# /tmp/ip rule add table 12
RTNETLINK answers: Invalid argument
root@Speedport:/var/mod/root# /tmp/ip help
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
       ip [ -force ] [-batch filename
where  OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable |
                   tunnel | maddr | mroute | monitor | xfrm }
       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
                    -f[amily] { inet | inet6 | ipx | dnet | link } |
                    -o[neline] | -t[imestamp] }
root@Speedport:/var/mod/root#

Vielleicht klappt es ja auf der 7270 besser mit iproute2?

Jörg
 
Hi Leute, habe mir das alles mal durchgelesen und konnte einiges ganz gut nachvollziehen. Da ich auch schon einige Jahre mit Openvpn arbeite, anbei ein Tipp verbunden mit einer Frage. Der Tipp, leider habe ich die Erfahrungen machen müssen, das komischerweise nur 10% der fertigen Images (7270 und 7390) mit Openvpn funktionieren. Warum das so ist, habe ich bis heute nicht verstanden. Das wäre dann auch meine Frage, kann mir jemand sagen, warum das so ist? Ich nutze seit Jahren die gleiche Config und die gleichen Schlüssel (Tunnelverbindung!!). Das es funktioniert zeigen ja die anderen 10%. Also darauf kann ich mir absolut keinen Reim machen. Hat da vielleicht jemand einen Tipp oder gleiche Erfahrungen machen können?
zweifler
 
Könntest du die "10%" näher beschreiben/erklären: Was ist mit den 90% der Images? Funktionieren die garnicht? Also: Startet die Box damit nicht? Oder geht "nur" das OpenVPN nicht?
Wenn es "nur" ums OpenVPN geht: welche Config nutzt du (Server/Client, lzo, tcp/udp, Zertifikate/Schlüssel, tls-auth ...)?
Welche Fehlermeldung bekommst du?
 
Hi MaxMuster, natürlich handelt es sich NUR um Openvpn. Ich Server zu zwei Clienten (Flugwetterdaten beim Clienten vor Ort abrufen ...). Dazu benutze ich den Tunnel mit einer AES 256 Verschlüßlung. Schlüssel werden natürlich auch gebraucht, das funktioniert ja aber. Ich erstelle die natürlich nicht neu, sondern nutze immer meine ersten als Openvpn noch die Version 2.1_rc15 war. Mit diesem Schlüsselpaar hatte ich auch schon openvpn 2.2.2 am Laufen. Aber warum das bei 90% aller Images nicht funzt, würde mich schon sehr interessieren. Bei dem Thema Fehlermeldung vielleicht nur so viel. Außer daß mir immer gezeigt wird, daß keine Verbindung zum Clienten aufgebaut werden kann, bin ich damit so schlau wie am Anfang. Ich werde morgen extra noch einmal einen solchen Test starten und die Meldungen hier posten. Das Ganze hat nämlich den Nachteil, daß ich damit die Clienten und mich auf ältere Images zwinge, wo es eben geht. Wäre wirklich schön, wenn ich mit Deiner Hilfe mal hinter des Rätsels Lösung steigen würde.
 

Neueste Beiträge

Statistik des Forums

Themen
244,881
Beiträge
2,220,052
Mitglieder
371,606
Neuestes Mitglied
Hobbie
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.