Temat: openwrt 21.02 + vpn + dns problem

Cześć.
Mam taki problem z openwrt i vpn:

Zainstalowane openwrt 21.02.
Wcześniej było 19 i openvpn i wydaje mi się , że działało to co teraz nie działą z 21.02

Skonfigurowane zgodnie z instrukcją https://eko.one.pl/?p=openwrt-openvpntun

Ładnie vpn działa.
Mogę się zalogować.
Widzę lokalne maszyny. Ping działa po IP.
Niestety nie działa jeśli pinga robie po nazwie dns (przykłądowo dla nazwy wpisanej statycznie w  static leases)

Bez vpn działa.

Czegoś nie zrobiłem?

2

Odp: openwrt 21.02 + vpn + dns problem

Dnsów? To one przecież odpowiadają za rozwiązywanie nazw.

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

Odp: openwrt 21.02 + vpn + dns problem

Możesz podpowiedzieć gdzie ten wpis odnośnie dnsów dodać, bo w opisie nie widzę?
Dzięki.

4

Odp: openwrt 21.02 + vpn + dns problem

Bo w opisie tego nie ma.
Działa bez vpn, nie działa z vpn, więc wynika z tego że po włączeniu vpn zmieniają ci się dnsy na inne (np. któryś skrypt zamienia lub wręcz sam vpn daje inne dnsy). Ale co zrobiłeś tego już nikt nie wie i musisz to sam sprawdzić.

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

Odp: openwrt 21.02 + vpn + dns problem

Jadę zgodnie z opisem.

Z vpn dostaje:

   Default Gateway . . . . . . . . . : 192.168.161.41
   DHCP Server . . . . . . . . . . . : 192.168.161.41
   DNS Servers . . . . . . . . . . . : 192.168.161.41

Bez vpn:

   Default Gateway . . . . . . . . . : 192.168.1.1
   DHCP Server . . . . . . . . . . . : 192.168.1.1
   DNS Servers . . . . . . . . . . . : fd60:...
                                       192.168.1.1
                                       fd08:...
                                       fde2:...
                                       fd60:...

6

Odp: openwrt 21.02 + vpn + dns problem

Widzisz wyraźnie że używasz innych dnsów - pewnie tych po drugiej stronie vpna. Co jest serwerem openvpn i jak jest skonfigurowany?

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

7 (edytowany przez marcin.kasinski 2021-09-20 20:33:39)

Odp: openwrt 21.02 + vpn + dns problem

Serwerem openvpn jest ruter brzegowy z openwrt.

Skonfigurowany zgodnie z opisem: https://eko.one.pl/?p=openwrt-openvpntun


dhcp:


config dnsmasq
    option domainneeded '1'
    option localise_queries '1'
    option rebind_protection '1'
    option rebind_localhost '1'
    option local '/lan/'
    option domain 'lan'
    option expandhosts '1'
    option authoritative '1'
    option readethers '1'
    option leasefile '/tmp/dhcp.leases'
    option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
    option localservice '1'
    option ednspacket_max '1232'

config dhcp 'lan'
    option interface 'lan'
    option start '100'
    option limit '150'
    option leasetime '12h'
    option dhcpv4 'server'
    option dhcpv6 'server'
    option ra 'server'
    option ra_slaac '1'
    list ra_flags 'managed-config'
    list ra_flags 'other-config'

config dhcp 'wan'
    option interface 'wan'
    option start '100'
    option limit '150'
    option leasetime '12h'
    list ra_flags 'none'

config odhcpd 'odhcpd'
    option maindhcp '0'
    option leasefile '/tmp/hosts/odhcpd'
    option leasetrigger '/usr/sbin/odhcpd-update'
    option loglevel '4'




openvpn:


config openvpn 'home'
    option enabled '1'
    option dev 'tun0'
    option port '1194'
    option proto 'udp'
    option log '/tmp/openvpn.log'
    option verb '3'
    option ca '/etc/openvpn/ca.crt'
    option cert '/etc/openvpn/serwer.crt'
    option key '/etc/openvpn/serwer.key'
    option server '10.8.0.0 255.255.255.0'
    option topology 'subnet'
    option dh '/etc/openvpn/dh.pem'
    list push 'route 192.168.1.0 255.255.255.0'

8

Odp: openwrt 21.02 + vpn + dns problem

Przestań linkować mój poradnik, bo tak jest kilka alternatywnych konfiguracji i nie możesz zrobić dokładnie wszystkiego co tam jest opisane. Pokaż konkretne konfigi i konfigurację którą masz zrobioną.

Zobacz logi klienta - czy jest w nich że dostaje dnsy?

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

Odp: openwrt 21.02 + vpn + dns problem

config dnsmasq
    option domainneeded '1'
    option localise_queries '1'
    option rebind_protection '1'
    option rebind_localhost '1'
    option local '/lan/'
    option domain 'lan'
    option expandhosts '1'
    option authoritative '1'
    option readethers '1'
    option leasefile '/tmp/dhcp.leases'
    option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
    option localservice '1'
    option ednspacket_max '1232'

config dhcp 'lan'
    option interface 'lan'
    option start '100'
    option limit '150'
    option leasetime '12h'
    option dhcpv4 'server'
    option dhcpv6 'server'
    option ra 'server'
    option ra_slaac '1'
    list ra_flags 'managed-config'
    list ra_flags 'other-config'

config dhcp 'wan'
    option interface 'wan'
    option start '100'
    option limit '150'
    option leasetime '12h'
    list ra_flags 'none'

config odhcpd 'odhcpd'
    option maindhcp '0'
    option leasefile '/tmp/hosts/odhcpd'
    option leasetrigger '/usr/sbin/odhcpd-update'
    option loglevel '4'



openvpn:

config openvpn 'home'
    option enabled '1'
    option dev 'tun0'
    option port '1194'
    option proto 'udp'
    option log '/tmp/openvpn.log'
    option verb '3'
    option ca '/etc/openvpn/ca.crt'
    option cert '/etc/openvpn/serwer.crt'
    option key '/etc/openvpn/serwer.key'
    option server '10.8.0.0 255.255.255.0'
    option topology 'subnet'
    option dh '/etc/openvpn/dh.pem'
    list push 'route 192.168.1.0 255.255.255.0

10

Odp: openwrt 21.02 + vpn + dns problem

Logi klienta pokaż.

I wyniki poleceń

ifconfig
route -n

Z tego openwrt z serwerem openvpn.

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

11

Odp: openwrt 21.02 + vpn + dns problem

openvpn serwer:


root@router:/tmp# cat openvpn.log
2021-09-20 21:33:21 --cipher is not set. Previous OpenVPN version defaulted to BF-CBC as fallback when cipher negotiation failed in this case. If you need this fallback please add '--data-ciphers-fallback BF-CBC' to your configuration and/or add BF-CBC to --data-ciphers.
2021-09-20 21:33:21 OpenVPN 2.5.3 arm-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD]
2021-09-20 21:33:21 library versions: OpenSSL 1.1.1l  24 Aug 2021, LZO 2.10
2021-09-20 21:33:22 WARNING: --keepalive option is missing from server config
2021-09-20 21:33:22 net_route_v4_best_gw query: dst 0.0.0.0
2021-09-20 21:33:22 net_route_v4_best_gw result: via x.x.x.x dev wan
2021-09-20 21:33:22 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
2021-09-20 21:33:22 Diffie-Hellman initialized with 2048 bit key
2021-09-20 21:33:22 TUN/TAP device tun0 opened
2021-09-20 21:33:22 net_iface_mtu_set: mtu 1500 for tun0
2021-09-20 21:33:22 net_iface_up: set tun0 up
2021-09-20 21:33:22 net_addr_v4_add: 10.8.0.1/24 dev tun0
2021-09-20 21:33:22 /usr/libexec/openvpn-hotplug up home tun0 1500 1621 10.8.0.1 255.255.255.0 init
2021-09-20 21:33:22 Could not determine IPv4/IPv6 protocol. Using AF_INET
2021-09-20 21:33:22 Socket Buffers: R=[180224->180224] S=[180224->180224]
2021-09-20 21:33:22 UDPv4 link local (bound): [AF_INET][undef]:1194
2021-09-20 21:33:22 UDPv4 link remote: [AF_UNSPEC]
2021-09-20 21:33:22 MULTI: multi_init called, r=256 v=256
2021-09-20 21:33:22 IFCONFIG POOL IPv4: base=10.8.0.2 size=252
2021-09-20 21:33:22 Initialization Sequence Completed
2021-09-20 21:36:39 192.168.1.239:1194 TLS: Initial packet from [AF_INET]192.168.1.239:1194, sid=d3d9fd3a 727d5733
2021-09-20 21:37:39 192.168.1.239:1194 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
2021-09-20 21:37:39 192.168.1.239:1194 TLS Error: TLS handshake failed
2021-09-20 21:37:39 192.168.1.239:1194 SIGUSR1[soft,tls-error] received, client-instance restarting
2021-09-20 21:38:18 37.47.28.48:20011 TLS: Initial packet from [AF_INET]37.47.28.48:20011, sid=9142178d 6193d5b2
2021-09-20 21:38:18 37.47.28.48:20011 VERIFY OK: depth=1, CN=IT Zone CA
2021-09-20 21:38:18 37.47.28.48:20011 VERIFY OK: depth=0, CN=client
2021-09-20 21:38:18 37.47.28.48:20011 peer info: IV_VER=2.4.4
2021-09-20 21:38:18 37.47.28.48:20011 peer info: IV_PLAT=win
2021-09-20 21:38:18 37.47.28.48:20011 peer info: IV_PROTO=2
2021-09-20 21:38:18 37.47.28.48:20011 peer info: IV_NCP=2
2021-09-20 21:38:18 37.47.28.48:20011 peer info: IV_LZ4=1
2021-09-20 21:38:18 37.47.28.48:20011 peer info: IV_LZ4v2=1
2021-09-20 21:38:18 37.47.28.48:20011 peer info: IV_LZO=1
2021-09-20 21:38:18 37.47.28.48:20011 peer info: IV_COMP_STUB=1
2021-09-20 21:38:18 37.47.28.48:20011 peer info: IV_COMP_STUBv2=1
2021-09-20 21:38:18 37.47.28.48:20011 peer info: IV_TCPNL=1
2021-09-20 21:38:18 37.47.28.48:20011 peer info: IV_GUI_VER=OpenVPN_GUI_11
2021-09-20 21:38:18 37.47.28.48:20011 Control Channel: TLSv1.2, cipher TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384, peer certificate: 2048 bit RSA, signature: RSA-SHA256
2021-09-20 21:38:18 37.47.28.48:20011 [client] Peer Connection Initiated with [AF_INET]37.47.28.48:20011
2021-09-20 21:38:18 client/37.47.28.48:20011 MULTI_sva: pool returned IPv4=10.8.0.2, IPv6=(Not enabled)
2021-09-20 21:38:18 client/37.47.28.48:20011 MULTI: Learn: 10.8.0.2 -> client/37.47.28.48:20011
2021-09-20 21:38:18 client/37.47.28.48:20011 MULTI: primary virtual IP for client/37.47.28.48:20011: 10.8.0.2
2021-09-20 21:38:18 client/37.47.28.48:20011 Data Channel: using negotiated cipher 'AES-256-GCM'
2021-09-20 21:38:18 client/37.47.28.48:20011 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
2021-09-20 21:38:18 client/37.47.28.48:20011 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
2021-09-20 21:38:20 client/37.47.28.48:20011 PUSH: Received control message: 'PUSH_REQUEST'
2021-09-20 21:38:20 client/37.47.28.48:20011 SENT CONTROL [client]: 'PUSH_REPLY,route 192.168.1.0 255.255.255.0,route-gateway 10.8.0.1,topology subnet,ifconfig 10.8.0.2 255.255.255.0,peer-id 0,cipher AES-256-GCM' (status=1)


openvpn windows client:



Mon Sep 20 21:38:16 2021 OpenVPN 2.4.4 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Sep 26 2017
Mon Sep 20 21:38:16 2021 Windows version 6.2 (Windows 8 or greater) 64bit
Mon Sep 20 21:38:16 2021 library versions: OpenSSL 1.0.2l  25 May 2017, LZO 2.10
Enter Management Password:
Mon Sep 20 21:38:16 2021 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Mon Sep 20 21:38:16 2021 Need hold release from management interface, waiting...
Mon Sep 20 21:38:17 2021 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Mon Sep 20 21:38:17 2021 MANAGEMENT: CMD 'state on'
Mon Sep 20 21:38:17 2021 MANAGEMENT: CMD 'log all on'
Mon Sep 20 21:38:17 2021 MANAGEMENT: CMD 'echo all on'
Mon Sep 20 21:38:17 2021 MANAGEMENT: CMD 'hold off'
Mon Sep 20 21:38:17 2021 MANAGEMENT: CMD 'hold release'
Mon Sep 20 21:38:17 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]46.31.39.119:1194
Mon Sep 20 21:38:17 2021 Socket Buffers: R=[65536->65536] S=[65536->65536]
Mon Sep 20 21:38:17 2021 UDP link local (bound): [AF_INET][undef]:1194
Mon Sep 20 21:38:17 2021 UDP link remote: [AF_INET]46.31.39.119:1194
Mon Sep 20 21:38:17 2021 MANAGEMENT: >STATE:1632166697,WAIT,,,,,,
Mon Sep 20 21:38:17 2021 MANAGEMENT: >STATE:1632166697,AUTH,,,,,,
Mon Sep 20 21:38:17 2021 TLS: Initial packet from [AF_INET]46.31.39.119:1194, sid=56d7e95f 27f14fc8
Mon Sep 20 21:38:17 2021 VERIFY OK: depth=1, CN=IT Zone CA
Mon Sep 20 21:38:17 2021 VERIFY KU OK
Mon Sep 20 21:38:17 2021 Validating certificate extended key usage
Mon Sep 20 21:38:17 2021 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Mon Sep 20 21:38:17 2021 VERIFY EKU OK
Mon Sep 20 21:38:17 2021 VERIFY OK: depth=0, CN=serwer
Mon Sep 20 21:38:17 2021 WARNING: 'cipher' is present in local config but missing in remote config, local='cipher BF-CBC'
Mon Sep 20 21:38:17 2021 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Mon Sep 20 21:38:17 2021 [serwer] Peer Connection Initiated with [AF_INET]x.x.x.x:1194
Mon Sep 20 21:38:18 2021 MANAGEMENT: >STATE:1632166698,GET_CONFIG,,,,,,
Mon Sep 20 21:38:18 2021 SENT CONTROL [serwer]: 'PUSH_REQUEST' (status=1)
Mon Sep 20 21:38:18 2021 PUSH: Received control message: 'PUSH_REPLY,route 192.168.1.0 255.255.255.0,route-gateway 10.8.0.1,topology subnet,ifconfig 10.8.0.2 255.255.255.0,peer-id 0,cipher AES-256-GCM'
Mon Sep 20 21:38:18 2021 OPTIONS IMPORT: --ifconfig/up options modified
Mon Sep 20 21:38:18 2021 OPTIONS IMPORT: route options modified
Mon Sep 20 21:38:18 2021 OPTIONS IMPORT: route-related options modified
Mon Sep 20 21:38:18 2021 OPTIONS IMPORT: peer-id set
Mon Sep 20 21:38:18 2021 OPTIONS IMPORT: adjusting link_mtu to 1624
Mon Sep 20 21:38:18 2021 OPTIONS IMPORT: data channel crypto options modified
Mon Sep 20 21:38:18 2021 Data Channel: using negotiated cipher 'AES-256-GCM'
Mon Sep 20 21:38:18 2021 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Mon Sep 20 21:38:18 2021 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Mon Sep 20 21:38:18 2021 interactive service msg_channel=564
Mon Sep 20 21:38:18 2021 ROUTE_GATEWAY 192.168.161.41/255.255.255.0 I=4 HWADDR=f8:59:71:7b:f2:6e
Mon Sep 20 21:38:18 2021 open_tun
Mon Sep 20 21:38:18 2021 TAP-WIN32 device [Ethernet 3] opened: \\.\Global\....tap
Mon Sep 20 21:38:18 2021 TAP-Windows Driver Version 9.21
Mon Sep 20 21:38:18 2021 Set TAP-Windows TUN subnet mode network/local/netmask = 10.8.0.0/10.8.0.2/255.255.255.0 [SUCCEEDED]
Mon Sep 20 21:38:18 2021 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.8.0.2/255.255.255.0 on interface ... [DHCP-serv: 10.8.0.254, lease-time: 31536000]
Mon Sep 20 21:38:18 2021 Successful ARP Flush on interface [23] ...
Mon Sep 20 21:38:18 2021 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Mon Sep 20 21:38:18 2021 MANAGEMENT: >STATE:1632166698,ASSIGN_IP,,10.8.0.2,,,,
Mon Sep 20 21:38:23 2021 TEST ROUTES: 1/1 succeeded len=1 ret=1 a=0 u/d=up
Mon Sep 20 21:38:23 2021 MANAGEMENT: >STATE:1632166703,ADD_ROUTES,,,,,,
Mon Sep 20 21:38:23 2021 C:\WINDOWS\system32\route.exe ADD 192.168.1.0 MASK 255.255.255.0 10.8.0.1
Mon Sep 20 21:38:23 2021 Route addition via service succeeded
Mon Sep 20 21:38:23 2021 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Mon Sep 20 21:38:23 2021 Initialization Sequence Completed
Mon Sep 20 21:38:23 2021 MANAGEMENT: >STATE:1632166703,CONNECTED,SUCCESS,10.8.0.2,46.31.39.119,1194,,


ROUTE na windowsie:


route PRINT

...


IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0   192.168.161.41  192.168.161.157     35
         10.8.0.0    255.255.255.0         On-link          10.8.0.2    291
         10.8.0.2  255.255.255.255         On-link          10.8.0.2    291
       10.8.0.255  255.255.255.255         On-link          10.8.0.2    291
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
      192.168.1.0    255.255.255.0         10.8.0.1         10.8.0.2    291
    192.168.161.0    255.255.255.0         On-link   192.168.161.157    291
  192.168.161.157  255.255.255.255         On-link   192.168.161.157    291
  192.168.161.255  255.255.255.255         On-link   192.168.161.157    291
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link          10.8.0.2    291
        224.0.0.0        240.0.0.0         On-link   192.168.161.157    291
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link          10.8.0.2    291
  255.255.255.255  255.255.255.255         On-link   192.168.161.157    291
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
          0.0.0.0          0.0.0.0      192.168.1.1  Default
===========================================================================

12

Odp: openwrt 21.02 + vpn + dns problem

Nie podajesz danych o które prosiłem.

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

13

Odp: openwrt 21.02 + vpn + dns problem

Brakującu ipconfig na kliencie windows:

C:\Users\marcin>ipconfig

Windows IP Configuration


Wireless LAN adapter Połączenie lokalne* 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Połączenie lokalne* 4:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Ethernet 3:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : xxx
   IPv4 Address. . . . . . . . . . . : 10.8.0.2
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : xxx
   IPv4 Address. . . . . . . . . . . : 192.168.161.157
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.161.41

Ethernet adapter Połączenie sieciowe Bluetooth:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

C:\Users\marcin>

Pozostale rzeczy , o które pytałeś wydaje się, że wysłałem.

14

Odp: openwrt 21.02 + vpn + dns problem

Nie na kliencie a na openwrt.

Ale i tak mi się coś nie zgadza. Skoro windows ma adres 192.168.161.157 to skąd bez VPN masz

   Default Gateway . . . . . . . . . : 192.168.1.1
   DHCP Server . . . . . . . . . . . : 192.168.1.1
   DNS Servers . . . . . . . . . . . : fd60:...
                                       192.168.1.1
                                       fd08:...
                                       fde2:...
                                       fd60:...

? Bo cos mi się wydaje że po prostu pomyliłeś się i jest właśnie odwrotnie. Tak?

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

15

Odp: openwrt 21.02 + vpn + dns problem

Nie.

IP 192.168.1.1 to adres ruterra openwrt na którym jest openvpn.

I taki jest poprawny bez vpn.



IPconfig klienta windows bez vpn:


C:\Users\marcin>ipconfig

Windows IP Configuration


Wireless LAN adapter Połączenie lokalne* 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Połączenie lokalne* 4:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Ethernet 3:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . : lan
...
   IPv4 Address. . . . . . . . . . . : 192.168.1.239
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter Połączenie sieciowe Bluetooth:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

C:\Users\marcin>

16

Odp: openwrt 21.02 + vpn + dns problem

No to teraz się pogubiłem. Masz router z openwrt z serwerem openvpn, za nim windowsa i łączysz się z tego windowsa do openvpn który jest na routerze zaraz przed nim? Co by to miało na celu? I jakim cudem miał by się zmieniać adres ip karty wifi po podłączeniu vpna?

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

17

Odp: openwrt 21.02 + vpn + dns problem

Chce po prostu po zainstalowaniu nowego opewrt sprawdzic , czy zadziała mi openvpn.

Włączyłem więc w telefonie dane pakietowe i router.

Na windowskie łącze się do tego WIFI, czyli symuluje, że jestem poza moją siecią i uruchamiam openvpn client.

NA ruterze ipconfig jak poniżej:

root@router:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 14:91:82:2A:67:F3
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:66895 errors:0 dropped:1188 overruns:0 frame:0
          TX packets:125080 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13284199 (12.6 MiB)  TX bytes:138489168 (132.0 MiB)

eth0      Link encap:Ethernet  HWaddr 14:91:82:2A:67:F3
          inet6 addr: x.x.x Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1508  Metric:1
          RX packets:407448 errors:0 dropped:0 overruns:0 frame:0
          TX packets:169727 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1024
          RX bytes:179178196 (170.8 MiB)  TX bytes:151259701 (144.2 MiB)
          Interrupt:37

lan1      Link encap:Ethernet  HWaddr 14:91:82:2A:67:F3
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:66405 errors:0 dropped:0 overruns:0 frame:0
          TX packets:124864 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13209512 (12.5 MiB)  TX bytes:138284464 (131.8 MiB)

lan2      Link encap:Ethernet  HWaddr 14:91:82:2A:67:F3
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan3      Link encap:Ethernet  HWaddr 14:91:82:2A:67:F3
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan4      Link encap:Ethernet  HWaddr 14:91:82:2A:67:F3
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:268 errors:0 dropped:0 overruns:0 frame:0
          TX packets:268 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:36617 (35.7 KiB)  TX bytes:36617 (35.7 KiB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00                                                                                                             -00
          inet addr:10.8.0.1  P-t-P:10.8.0.1  Mask:255.255.255.0
          inet6 addr: ... Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:1410 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1689 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:194326 (189.7 KiB)  TX bytes:774024 (755.8 KiB)

wan       Link encap:Ethernet  HWaddr 16:91:82:2A:67:F3
          inet addr:x.x.x.x  Bcast:x.x.x.x  Mask:255.255.255.192
          inet6 addr: ... Scope:Global
          inet6 addr: ... Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:341043 errors:0 dropped:717 overruns:0 frame:0
          TX packets:44846 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:157004828 (149.7 MiB)  TX bytes:11615755 (11.0 MiB)

wlan0     Link encap:Ethernet  HWaddr 14:91:82:2A:67:F5
          inet6 addr: .... Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23025 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:3211468 (3.0 MiB)

wlan1     Link encap:Ethernet  HWaddr 14:91:82:2A:67:F4
          inet6 addr: ... Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3058 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25201 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:308102 (300.8 KiB)  TX bytes:3660549 (3.4 MiB)

18

Odp: openwrt 21.02 + vpn + dns problem

No to pisz że to inne łącze. Dodaj sobie do konfiga serwera openvpn coś takiego:

list 'push' 'dhcp-option DNS 192.168.1.1'

Przy połączeniu klient dostanie znów 192.168.1.1 jako serwer dns, tak jak masz "przed vpn", po bezpośrednim połączeniu z routerem.

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

19

Odp: openwrt 21.02 + vpn + dns problem

No właśnie to już ćwiczyłem i nie pomaga:

Przy VPN:

konfiguracja openvpn:

config openvpn 'home'
    option enabled '1'
    option dev 'tun0'
    option port '1194'
    option proto 'udp'
    option log '/tmp/openvpn.log'
    option verb '3'
    option ca '/etc/openvpn/ca.crt'
    option cert '/etc/openvpn/serwer.crt'
    option key '/etc/openvpn/serwer.key'
    option server '10.8.0.0 255.255.255.0'
    option topology 'subnet'
    option dh '/etc/openvpn/dh.pem'
    list push 'route 192.168.1.0 255.255.255.0'
        list push 'dhcp-option DNS 192.168.1.1'


Na kliencie windows :


logi openvpn:

...
Mon Sep 20 22:30:24 2021 MANAGEMENT: >STATE:1632169824,GET_CONFIG,,,,,,
Mon Sep 20 22:30:24 2021 SENT CONTROL [serwer]: 'PUSH_REQUEST' (status=1)
Mon Sep 20 22:30:24 2021 PUSH: Received control message: 'PUSH_REPLY,route 192.168.1.0 255.255.255.0,dhcp-option DNS 192.168.1.1,route-gateway 10.8.0.1,topology subnet,ifconfig 10.8.0.2 255.255.255.0,peer-id 0,cipher AES-256-GCM'
Mon Sep 20 22:30:24 2021 OPTIONS IMPORT: --ifconfig/up options modified
Mon Sep 20 22:30:24 2021 OPTIONS IMPORT: route options modified

...


Czyli PUSH dostał

a jak na tym windowsie dam ipconfig /all dostaje:

   Default Gateway . . . . . . . . . : 192.168.161.41
   DHCP Server . . . . . . . . . . . : 192.168.161.41
   DNS Servers . . . . . . . . . . . : 192.168.161.41

20

Odp: openwrt 21.02 + vpn + dns problem

https://forums.openvpn.net/viewtopic.php?t=25999#p77382 ?  czy http://woshub.com/dns-resolution-via-vp … g-windows/

Nie mam windowsa w domu więc nie sprawdzę.

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

21

Odp: openwrt 21.02 + vpn + dns problem

OK.

Wielkie dzięki za pomoc.
Już nie truje.
Poczytam czemu ten dns na windows nie wchodzi.

22

Odp: openwrt 21.02 + vpn + dns problem

Cześć, może jakaś drobna podpowiedź odnośnie DNS na VPN ?

Robię nslookup na adres routera będąc zapiętym openvpnem do routera i za każdym razem mam timeout

nslookup onet.pl 192.168.10.1
DNS request timed out.
    timeout was 2 seconds.
Server:  UnKnown
Address:  192.168.10.1

DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
*** Request to UnKnown timed-out

co jeszcze powinienem zrobić by DNS zaczął działać? Potrzebne mi to bo mam jeden statyczny wpis na routerze. Dodam, że sama strona routera się otwiera bez problemu...

23

Odp: openwrt 21.02 + vpn + dns problem

Ale ta twoja wypowiedź jest trochę oderwana i pozbawiona szczegółów. Bo nikt nic nie wie i pytasz się co zrobić.
Masz jakiś dns na adresie 192.168.10.1 i nie uzyskujesz od niego odpowiedzi. Więc
- zepsułeś gdzieś firewalla, więc go napraw
- zepsułeś routing do tego hosta więc go popraw
- host nie pozwala na zapytania od innych hostów z innych sieci, więc.. go popraw

Naprawdę trudno coś konkretnego poradzić skoro nic konkretnego nie napisałeś, ani co to za host, ani gdzie sie znajduje, po której stronie sieci, tuneli, jaki vpn, jak wygląda routing itd.

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

24 (edytowany przez kidler 2023-09-19 21:04:55)

Odp: openwrt 21.02 + vpn + dns problem

192.168.10.1 to adres routera, tego samego do którego zapinam VPN'a. OpenVPN został skonfigurowany w trybie TUN. Dostęp przez VPN'a do samego routera jak i innych urządzeń jest prawidłowy.

Routing zakładam, że jest dobry bo  ping idzie do routera, tracert też, więc żadnych dodatkowych routingów nie ustawiałem.

tracert 192.168.10.1

Tracing route to 192.168.10.1 over a maximum of 30 hops

  1    63 ms    42 ms    41 ms  192.168.10.1

Trace complete.

Regułę na fw zrobiłem taką, która puszcza wszystko z sieci VPN do tego rtr'a i zarazem jest to pierwsza reguła.

config rule
    option src 'vpn'
    option name 'VPN-ROUTER'
    option target 'ACCEPT'
    option proto 'all'

25

Odp: openwrt 21.02 + vpn + dns problem

zrób netstat -apnt i zobacz czy dnsmasq słucha ci na interfejsie od vpn (tun0?)

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