1 (edytowany przez namado 2014-12-09 10:14:33)

Temat: openvpn, default gateway

Witam smile
1. router jest klientem openvpn

route

root@w:/etc/config# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.1.1.249      128.0.0.0       UG    0      0        0 tun0
default         192.168.0.1     0.0.0.0         UG    0      0        0 br-wan
10.1.1.0        10.1.1.249      255.255.255.0   UG    0      0        0 tun0
10.1.1.249      *               255.255.255.255 UH    0      0        0 tun0
128.0.0.0       10.1.1.249      128.0.0.0       UG    0      0        0 tun0
176.31.xxx.xxx  192.168.0.1     255.255.255.255 UGH   0      0        0 br-wan
192.168.0.0     *               255.255.255.0   U     0      0        0 br-wan
192.168.254.0   *               255.255.255.0   U     0      0        0 br-lan

tak jak widać domyślna trasa idzie przez vpn

root@w:/etc/config# traceroute -n wp.pl
traceroute to wp.pl (212.77.100.101), 30 hops max, 38 byte packets
 1  10.1.1.1  63.917 ms  56.967 ms  129.638 ms

Chciałbym aby domyślna trasa szła przez 192.168.0.1
(po VPN wchodzę z zewnątrz)

Gdzie mogę to przestawić? Ustawić?


--
1043ND najnowszy gargoyle-pl.

NETGEAR WNDR4300

2

Odp: openvpn, default gateway

Wywalić z konfiga odpowiednią opcję, np.  push "redirect-gateway local def1" czy co tam masz.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: openvpn, default gateway

Cezary napisał/a:

Wywalić z konfiga odpowiednią opcję, np.  push "redirect-gateway local def1" czy co tam masz.

dziękuję
hmm, ale nie wiem z którego sad

/etc/config/openvpn

config openvpn 'custom_config'
        option script_security '3'
        option up '/etc/openvpn.up'
        option down '/etc/openvpn.down'
        option config '/etc/openvpn/grouter_client_cayzjsifwdwx.conf'
        option enable '1'

/etc/openvpn/grouter_client_cayzjsifwdwx.conf'

client
remote          176.31.xxx.xxx 1194
dev             tun
proto           udp
status  /var/openvpn/current_status
resolv-retry    infinite
ns-cert-type    server
topology        subnet
verb            3

cipher          BF-CBC
keysize               128

ca    /etc/openvpn/grouter_client_cayzjsifwdwx_ca.crt
cert  /etc/openvpn/grouter_client_cayzjsifwdwx.crt
key   /etc/openvpn/grouter_client_cayzjsifwdwx.key
tls-auth    /etc/openvpn/grouter_client_cayzjsifwdwx_ta.key 1

nobind
persist-key
persist-tun
comp-lzo
NETGEAR WNDR4300

4

Odp: openvpn, default gateway

Usunąłem ręcznie trasę.

root@w:/etc# traceroute wp.pl
traceroute to wp.pl (212.77.100.101), 30 hops max, 38 byte packets
 1  192.168.0.1 (192.168.0.1)  1.922 ms  1.437 ms  1.003 ms

usunąłem trasę
128.0.0.0       10.1.1.249      128.0.0.0       UG    0      0        0 tun0

VPN działa
domyślna trasa nie jest przez VPN

root@w:/etc# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.1.1.249      128.0.0.0       UG    0      0        0 tun0
default         192.168.0.1     0.0.0.0         UG    0      0        0 br-wan
10.1.1.0        10.1.1.249      255.255.255.0   UG    0      0        0 tun0
10.1.1.249      *               255.255.255.255 UH    0      0        0 tun0
176.31.x.x  192.168.0.1     255.255.255.255 UGH   0      0        0 br-wan
192.168.0.0     *               255.255.255.0   U     0      0        0 br-wan
192.168.254.0   *               255.255.255.0   U     0      0        0 br-lan


root@w:/etc# ping 10.1.1.1
PING 10.1.1.1 (10.1.1.1): 56 data bytes
64 bytes from 10.1.1.1: seq=0 ttl=64 time=75.497 ms
64 bytes from 10.1.1.1: seq=1 ttl=64 time=91.133 ms

z hosta też ping ok

C:\Users\marek>ping 10.1.1.1

Badanie 10.1.1.1 z 32 bajtami danych:
Odpowiedź z 10.1.1.1: bajtów=32 czas=81ms TTL=63
Odpowiedź z 10.1.1.1: bajtów=32 czas=87ms TTL=63

Wiem co zrobiłem ale nie do końca rozumiem dlaczego tak!
1. nie wiem co to za sieć 128.0.0.0

dlatego, że nie rozumiem to nie znam ewentualnych skutków ubocznych.


root@w:/etc# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.1.1.249      128.0.0.0       UG    0      0        0 tun0 
default         192.168.0.1     0.0.0.0         UG    0      0        0 br-wan
10.1.1.0        10.1.1.249      255.255.255.0   UG    0      0        0 tun0
10.1.1.249      *               255.255.255.255 UH    0      0        0 tun0
176.31.xxx.xxx  192.168.0.1     255.255.255.255 UGH   0      0        0 br-wan
192.168.0.0     *               255.255.255.0   U     0      0        0 br-wan
192.168.254.0   *               255.255.255.0   U     0      0        0 br-lan

Jak ktoś zna "ładniejszy" sposób to bardzo proszę.

NETGEAR WNDR4300

5

Odp: openvpn, default gateway

Ja dałem opcję "route-noexec" w pliku konfiguracyjnym dla openvpn

6

Odp: openvpn, default gateway

kasjo napisał/a:

Ja dałem opcję "route-noexec" w pliku konfiguracyjnym dla openvpn

w którym pliku?
/etc/config/openvpn
czy
w /etc/openvpn/grouter_client_xxxxx.conf

NETGEAR WNDR4300

7 (edytowany przez namado 2014-12-10 00:36:55)

Odp: openvpn, default gateway

kasjo napisał/a:

Ja dałem opcję "route-noexec" w pliku konfiguracyjnym dla openvpn

po ustawieniu tej opcji

/etc/openvpn/grouter_client_xxxxxxxxxxxx.conf

nie pinguje na server vpn
i nie mam dostępu do routera po vpn sad

root@w:/etc/openvpn# ping 10.1.1.1
PING 10.1.1.1 (10.1.1.1): 56 data bytes
^C
--- 10.1.1.1 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
root@w:/etc/openvpn# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    0      0        0 br-wan
10.1.1.249      *               255.255.255.255 UH    0      0        0 tun0
192.168.0.0     *               255.255.255.0   U     0      0        0 br-wan
192.168.254.0   *               255.255.255.0   U     0      0        0 br-lan
NETGEAR WNDR4300

8

Odp: openvpn, default gateway

Ja mam u siebie to tak skonfigurowane:
/etc/config/openvpn

config openvpn francja
        option enabled 1
        option config /root/vpn/francja.cfg

/root/vpn/francja.cfg

client
dev tap
proto tcp
remote frvpn.mydevil.net 1194
nobind
persist-key
persist-tun
ca ca.crt
auth-user-pass /root/vpn/passwd.txt
route-noexec