Добрый час хабровчане.
Прошу помощи в настройке маршрута к принтерам в сети маршрутизатора 10.0.1.0/24.
Постановка задачи:
Обеспечить возможность печати с Сервера 1С (172.16.254.132) расположенного в Main DC, на принтеры подключенные к сети в одном из филиалов M01
Что имеем:
Маршрутизатор TP-LINK (192.168.0.1) на стоковой прошивке
Маршрутизатор Apple Time Capsule (10.0.1.1) на стоковой прошивке
Сервер OpenVPN (172.16.254.1) поднят на виртуалке с CentOS 7
Сервер 1С (172.16.254.132) поднят на виртуалке Windows Server 2008R2
Принтеры пока не подключены, работу маршрута с сервера 1С (172.16.254.132) можно проверить трассировкой маршрута к маршрутизатору (10.0.1.1)
Доступы между узлов в сети OpenVPN (172.16.254.0/24) функционируют штатно.
Направление печати изображено красными стрелками на картинке.
Что пробовал:
1. На сервере 1С (172.16.254.132) добавлял маршрут:
# route -p add 10.0.1.1 mask 255.255.255.0 172.16.254.101 metric 1 if 17
if 17 это как раз интерфейс с поднятым TAP для OpenVPN
Но, при трассировке, пакеты заворачиваются сначала в 192.168.0.1 и естественно там и пропадают.
Вывод route print с сервера 1С (172.16.254.132)
===========================================================================
Список интерфейсов
17…00 ff 2f 16 07 69 ……TAP-Windows Adapter V9
16…00 0c 29 95 19 64 ……vmxnet3 Ethernet Adapter #2
11…00 0c 29 95 19 5a ……vmxnet3 Ethernet Adapter
1………………………Software Loopback Interface 1
12…00 00 00 00 00 00 00 e0 Адаптер Microsoft ISATAP
13…00 00 00 00 00 00 00 e0 Адаптер Microsoft ISATAP #2
===========================================================================
IPv4 таблица маршрута
===========================================================================
Активные маршруты:
Сетевой адрес Маска сети Адрес шлюза Интерфейс Метрика
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.132 5
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
172.16.254.0 255.255.255.0 On-link 172.16.254.132 276
172.16.254.132 255.255.255.255 On-link 172.16.254.132 276
172.16.254.255 255.255.255.255 On-link 172.16.254.132 276
192.168.0.0 255.255.255.0 On-link 192.168.0.132 261
192.168.0.132 255.255.255.255 On-link 192.168.0.132 261
192.168.0.255 255.255.255.255 On-link 192.168.0.132 261
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.0.132 261
224.0.0.0 240.0.0.0 On-link 172.16.254.132 276
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.0.132 261
255.255.255.255 255.255.255.255 On-link 172.16.254.132 276
===========================================================================
Постоянные маршруты:
Сетевой адрес Маска Адрес шлюза Метрика
10.0.1.1 255.255.255.0 172.16.254.101 1
===========================================================================
IPv6 таблица маршрута
===========================================================================
Активные маршруты:
Метрика Сетевой адрес Шлюз
1 306 ::1/128 On-link
17 276 fe80::/64 On-link
17 276 fe80::d9c7:bf09:d25f:b0a8/128
On-link
1 306 ff00::/8 On-link
17 276 ff00::/8 On-link
===========================================================================
Постоянные маршруты:
Отсутствует
Вывод трассировки с сервера 1С к 10.0.1.1
Трассировка маршрута к 10.0.1.1 с максимальным числом прыжков 30
1 <1 мс <1 мс <1 мс 192.168.0.1
2 * * * Превышен интервал ожидания для запроса.
3 * * * Превышен интервал ожидания для запроса.
4 * * * Превышен интервал ожидания для запроса.
5 * * * Превышен интервал ожидания для запроса.
6 * * * Превышен интервал ожидания для запроса.
2. На сервере OpenVPN, в файлике ccd, для клиента сервер1с прописывал строку:
push «route 10.0.1.0 255.255.255.0 172.16.254.101 1»
Результат аналогичен с добавлением маршрута на сервере 1С
Подскажите плиз куда копать дальше.
Заранее спасибо.
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Sign up
Доброго времени суток.
Есть 2 машины: openvpn-сервер под FreeBSD9.0 (к нему подключены 2 аплинка em0 217.117.*.* и локальный em1 10.10.75.*) и клиентская машина под win xp (тоже 2 аплинка 217.117.*.* с метрикой 20 и 10.10.75.* с метрикой 10). На серверной машине поднял openvpn, конофиг openvpn.conf
Код: Выделить всё
port 2000
proto udp
dev tun0
ca /usr/local/etc/openvpn/keys/ca.crt
cert /usr/local/etc/openvpn/keys/server.crt
key /usr/local/etc/openvpn/keys/server.key
dh /usr/local/etc/openvpn/keys/dh1024.pem
server 10.10.100.0 255.255.255.0
client-config-dir ccd
client-to-client
route 10.10.100.0 255.255.255.0 10.10.100.1 3
route-metric 3
tls-server
tls-auth keys/ta.key 0
tls-timeout 120
auth MD5
cipher BF-CBC
keepalive 10 120
comp-lzo
max-clients 100
user nobody
group nobody
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
log /var/log/openvpn/openvpn.log
verb 3
Конфиг клиентской части в ccd
Код: Выделить всё
ifconfig-push 10.10.100.6 10.10.100.5
route 217.117.*.0 255.255.255.128
В конфиге на клиентской машине прописал
Код: Выделить всё
dev tun
proto udp
remote 217.117.*.* (айпи на em0)
port 2000
client
resolv-retry infinite
ca ca.crt
cert client.crt
key client.key
tls-client
tls-auth ta.key 1
auth MD5
cipher BF-CBC
ns-cert-type server
comp-lzo
persist-key
persist-tun
verb 3
Машины коннектятся по openvpn, пинг по внутренним айпишникам туннеля идет, но винда присвоила маршруту 10.10.100.0/24 метрику 30, в то время как нужна метрика 3. В чем может быть причина?
P.S. эти настройки только для тестового стенда. В результате должны получиться сервер и клиент, связанные 2 туннелями поверх 2 подсетей, один туннель должен быть приоритетным, но если линк с сетью, поверх которой он идет, отвалится, клиентская машина должна автоматически переключиться на второй запасной туннель. Эту задачу я попытался решить с помощью метрики.
This post is inspired from my urge to watch Macedonian TV (for free). Broadcast of Macedonian television is actually
available on internet via Web MaxTV.mk, however it is limited to Macedonian IP addresses only.
Since this scenario for tv broadcast or any kind of services, which are limited to a particular IP country block,
applies to many other people living abroad, I decided to make my nightly experiment public.
The standard way to use services that operates in one or several countries only is to use proxy servers. However, in
some cases there are either no proxies available in the home country, the services that one is planing to use can not
be bypassed with a simple proxy server, the proxy services are slow to transfer broadcasts, or one just does not want
to pay for a proxy service.
Obviously from the picture above, I have already resolved the problem, by making my home computer (the one in Macedonia)
an internet gateway. This is almost a trivial task when the home computer has a public IP address, but in most cases,
this simply does not apply (such as my Macedonian IP). Assuming that one can get his hands on a computer with a public
IP address, a cheap (almost free) solution is routing via OpenVPN. What you need is the following:
- A computer with a public IP address (the server), located anywhere in the world.
- A computer in the home country (the gateway), with a decent internet connection.
- One or several clients (the client), with an Internet connection
As I currently live in Switzerland, I am more than happy to use the services of upc cablecom
ISP, especially since they are so nice to provide me a public IP address. Therefore, I can simply setup an OpenVPN
server in Switzerland, and use it as a tunnel to redirect traffic to the home computer. My current setup looks like this:
From the drawing above you can infer that the server is ch-server
, the gateway is mk-gateway
and finally the
client is astojanov-mac
. The gray lines and black labels represent the physical connections, and the red lines and
red labels specify the OpenVPN network.
72.xxx.xxx.xxx
is the public address in Switzerland, and the router behind it has port-forwarding toch-server
,
port 1194 to thech-server
having local IP address192.168.1.50
ch-server
andastojanov-mac
are behind the same router and are part of the192.168.1.0/24
network. Note that the
clientastojanov-mac
can access the OpenVPN server from any network node on the Internet. Thus the route to access the
ch-server
goes through the Internet cloud.mk-gateway
is part of the192.168.0.0/24
local network in Macedonia and has no public IP address attached on the router.- The OpenVPN overlaid network is represented with
192.168.2.0/24
. The server has a static ip address: 192.168.2.1,
as well as the gateway192.168.2.250
. The clientastojanov-mac
as every other OpenVPN client are assigned dynamic ip address.
The first step is installing and setting up OpenVPN. In order to run the server, a very modest computer can fulfill
the needs of a VPN server if less than 10 VPN connections are anticipated. Personally I am using Intel(R) Pentium(R) M
processor 1200MHz, with 1.6 GB of RAM. OpenVPN is cross platform and has no OS requirements. ch-server
runs
Debian GNU/Linux 6.0.6 (squeeze) and I base my instruction on this distribution. Note that to run OpenVPN server / client
there are many alternatives with less power consumption requirements. For example the
Raspberry Pi, which has 700 Mhz ARM CPU and costs about $25, or your router, if you can
set up DD-WRT on it.
Installing OpenVPN sever and setting up server / client keys & certificates
Installing and setting up OpenVPN has almost cross-platform steps. Also there are many tutorial available out there.
My setup is based on the following tutorial,
but you can also find additional tutorial on Linux,
Windows and Mac OS X.
First install OpenVPN and OpenSSL:
apt-get install openvpn openssl
Now we need to create server certificates. Before that we edit the variables of the certificates we are about to create.
cd /etc/openvpn
cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 ./easy-rsa
vim easy-rsa/vars
Edit accordingly:
export KEY_COUNTRY="CH"
export KEY_PROVINCE="ZH"
export KEY_CITY="Zurich"
export KEY_ORG="AlenBlog"
export KEY_EMAIL="me@myhost.mydomain"
Save and quit. Load the variables, clean, and build the server key and certificate:
source ./easy-rsa/vars
./easy-rsa/clean-all
./easy-rsa/build-ca
./easy-rsa/build-key-server ch-server
As soon as the server ca.crt and ch-server.key are set, we can proceed towards creating the client keys. Note that
we will have one special client, namely the mk-gateway client. This step must be repeated for ever clients you want
to allow on your VPN. Note that the clients are identified by the ‘Common Name’.
./easy-rsa/build-key mk-gateway
./easy-rsa/build-key astojanov-mac
Now let’s create Diffie Hellman parameters:
./easy-rsa/build-dh
After this is done, we are ready to setup the OpenVPN configuration file.
OpenVPN server configuration
Since the main goal is to watch Macedonian TV, the router will be configured such that I do not have to turn on / off
the VPN connection whenever I want to watch the TV stream. However, it was is also useful to have the opportunity to
transfer the whole traffic to the mk-gateway
. Therefore the client will make the decision of what routes will be
redirected to the mk-gateway
. In other words OpenVPN will route complete or selective traffic to a client.
The server configuration file is as simple as possible.
dev tun
proto udp
port 1194
ca /etc/openvpn/ca.crt
cert /etc/openvpn/ch-sever.crt
key /etc/openvpn/ch-server.key
dh /etc/openvpn/dh1024.pem
user nobody
group nogroup
server 192.168.2.0 255.255.255.0
persist-key
persist-tun
route 192.168.0.0 255.255.255.0
status /var/log/openvpn-status.log
ifconfig-pool-persist /etc/openvpn/ipp.txt
client-config-dir /etc/openvpn/ccd
verb 3
client-to-client
The server uses UDP as a transport protocol (although less reliable than TCP, it is quite faster than TCP), running on
port 1194. For in-depth knowledge for the rest of the directives, I strongly advise the OpenVPN
manpage.
Note the client-config-dir
directive. It provides the flexibility to add specific configurations to the clients.
We configure the mk-gateway
here.
mkdir -p /etc/openvpn/ccd
vim /etc/openvpn/ccd/mk-gateway
In order to make mk-gateway route any specific traffic, we use the iroute
directive.
Ideally we would like to route 0/1
to the client and set something like:
iroute 0.0.0.0 128.0.0.0
However, THIS DOES NOT WORK in OpenVPN. Good news is that instead of using one general route, we can set routes
from 1.0.0.0
to 255.0.0.0
using netmask 255.0.0.0
which will do exactly the same. We also like a static IP for
the mk-gateway
:
ifconfig-push 192.168.2.250 192.168.2.249
iroute 1.0.0.0 255.0.0.0
iroute 2.0.0.0 255.0.0.0
iroute 3.0.0.0 255.0.0.0
. . . . . .
iroute 254.0.0.0 255.0.0.0
iroute 255.0.0.0 255.0.0.0
By now, the configuration for the OpenVPN server is complete. The server can be started with:
/etc/init.d/openvpn start
Setting up the remote gateway (mk-gateway). Optional DD-WRT setup.
Initially I configured the gateway to run on Windows 7 machine. Since this machine will be forwarding packets, the OS must be configured to enable forwarding. According to Bebop’s post, the following tweaks should do the job:
- Start -> Right-click My Computer -> Manage -> Services. Right-click Routing and Remote Access -> Properties -> Automatic.
Right-click Routing and Remote Access -> Start - Control Panel -> Network and Sharing Center -> Local Area Connection -> Properties -> Sharing.
Tick the box “Allow other network users to connect through this computer’s Internet connection”.
From the drop-down list select “Local Area Connection 2”, or whatever is the connection name of your TUN connection. - Run regedit. Navigate to
HKEY_LOCAL_MACHINE
and then toSYSTEM\CurrentControlSet\Services\Tcpip\Parameters
.
Change value ofIPEnableRouter
to 1.
OpenVPN GUI for Windows is a decent OpenVPN client for Windows, including GUI, as mentioned in its title.
In order to set it up, download it, install it and copy the files /etc/openvpn/ca.crt
, /etc/openvpn/mk-gateway.crt
and /etc/openvpn/mk-gateway.key
into C:\Program Files\Open VPN\config\
and finally create the config file config.opvn
dev tun
proto udp
remote ch-sever 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert mk-gateway.crt
key mk-gateway.key
verb 3
route-method exe
route-delay 2
The GUI client will enable / disable the tun device and setup the routes in the system. Therefore in Windows 7 / Vista
it need administrator permissions. Make sure that you right-click on the GUI executable in
C:\Program Files\OpenVPN
and check the ‘Run as administrator’ checkbox.
OpenVPN client running on DD-WRT
Having a computer running 24/7 just for routing is not really desirable. With a decent router having OpenVPN support,
one can bypass the need for an extra computer. I personally have WRT54GL in Macedonia. It is possible to install DD-WRT
on the router and ‘unleash’ the OpenVPN client support in the router itself. Setting up DD-WRT in some cases is router
specific, and its installation has been well documented on the DD-WRT wiki.
In order to setup DD-WRT on a router, one needs to flush the current firmware, and replace it with a DD-WRT, which might
be a risky business. Note that the first step is flushing the router with the ‘mini firmware’ available at the DD-WRT
website, and then the next step is installing the OpenVPN supported firmware. When the final firmware is installed,
setting up the OpenVPN client can be done via the Web interface in Services -> VPN.
The files /etc/openvpn/ca.crt
, /etc/openvpn/mk-gateway.crt
and /etc/openvpn/mk-gateway.key
can simply be
copy-pasted into the corresponding fields:
Depending on the router CPU, you can enable or disable the LZO Comporession. I have actually disabled it in my final
configuration since WRT54GL has 200MHz CPU.
The above creates a connection to the OpenVPN server ch-server
as soon as the router is rebooted. Before rebooting,
packet forwarding within the router must be enabled. This can be done in Administration -> Commands, by setting
the following commands for the Firewall.
iptables -I FORWARD 1 --source 192.168.2.0/24 -j ACCEPT
iptables -I FORWARD -i br0 -o tun0 -j ACCEPT
iptables -I FORWARD -i tun0 -o br0 -j ACCEPT
By clicking Save Firewall, the commands will allow packets to flow to/from the ch-sever
to the mk-gateway
.
Setting up the client such that the whole traffic is redirected to the remote gateway
The client astojanov-mac
, runs Mac OS X. I am using Tunnelblick as an OpenVPN client GUI. To set it up, the generated
key & certificates: /etc/openvpn/ca.crt
, /etc/openvpn/astojanov-mac.crt
and /etc/openvpn/astojanov-mac.key
must be copied to the client, and config.opvn
file must be created:
client
dev tun
proto udp
remote `ch-server` 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert astojanov-mac.crt
key astojanov-mac.key
verb 3
redirect-gateway def1
dhcp-option DNS 8.8.8.8
Note the redirect-gateway
def1 directive. This directive forces the client to change its default gateway and redirect
it to the OpenVPN server. Since the mk-gateway
takes all the routes from 1.0.0.0
to 255.0.0.0
, the whole traffic
will be redirected to mk-gateway
.
Setting up the client to route selective traffic via a remote gateway
For this scenario, I use most of the previous settings for redirecting the whole traffic and Tunnelblick, with a
modified config.opvn
file. In order to perform selective routing, instead of redirecting the gateway, we need to
rewrite the routing rules to the specific selective trafic that we are planning to redirect. I personally wanted
scenario where all Macedonian web sites hosted in Macedonia will be redirected through the mk-gateway
.
To identify all Macedonian hosts, I used the NirSoft country based IP blocks.
The blocks are given by their price ranges, and the number of hosts for each block. With a simple math, it is easy to
derive the netmasks for each block taking into considerations the number of nodes.
Finally the config file looks like the following:
client
dev tun
proto udp
remote `ch-server` 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert astojanov-mac.crt
key astojanov-mac.key
verb 3
route 31.11.64.0 255.255.192.0 # Cabletel DOOEL Skopje
route 78.157.0.0 255.255.224.0 # Cabletel DOOEL Skopje
route 92.53.0.0 255.255.192.0 # Cabletel DOOEL Skopje
route 188.44.0.0 255.255.224.0 # GIV Ivan LTD Gostivar
route 212.120.0.0 255.255.224.0 # NETCETERA DOOEL Skopje
route 95.86.0.0 255.255.192.0 # Inel Dooel Kavadarci
route 79.141.112.0 255.255.240.0 # INFEL-KTV DOO
route 213.135.160.0 255.255.224.0 # KDS-Kabel Net DOOEL
route 212.110.64.0 255.255.224.0 # Macedonia On-Line
route 46.217.0.0 255.255.0.0 # Makedonski Telekom
route 62.162.0.0 255.255.0.0 # Makedonski Telekom
route 62.220.192.0 255.255.224.0 # Makedonski Telekom
route 77.28.0.0 255.254.0.0 # Makedonski Telekom
route 79.125.128.0 255.255.128.0 # Makedonski Telekom
route 195.26.128.0 255.255.224.0 # Makedonski Telekom
route 89.205.0.0 255.255.128.0 # MEGANET
route 94.100.96.0 255.255.240.0 # Miksnet
route 217.196.192.0 255.255.240.0 # Miksnet
route 80.77.144.0 255.255.240.0 # NEOTEL Skopje
route 88.85.96.0 255.255.224.0 # NEOTEL Skopje
route 92.55.64.0 255.255.192.0 # NEOTEL Skopje
route 95.180.128.0 255.255.128.0 # NEOTEL Skopje
route 79.126.128.0 255.255.128.0 # ONE Telecom
route 85.30.64.0 255.255.192.0 # ONE Telecom
route 212.158.176.0 255.255.240.0 # ONE Telecom
route 217.16.64.0 255.255.240.0 # ONE Telecom
route 217.16.80.0 255.255.240.0 # ONE Telecom
route 151.236.240.0 255.255.240.0 # PET NET DOO Gevgelija
route 31.12.16.0 255.255.240.0 # T-Mobile Makedonija
route 95.156.0.0 255.255.192.0 # T-Mobile Makedonija
route 146.255.64.0 255.255.224.0 # TELESMART TELEKOM DOO
route 89.185.192.0 255.255.224.0 # TRD " Net Kabel"
route 212.13.64.0 255.255.224.0 # UltraNet d.o.o.
route 194.149.128.0 255.255.224.0 # "Sv. Kiril i Metodij"
Linux clients
For the linux users, particularly, the linux clients, setting up openvpn in a client mode is straight forward. We use the same keys and certificates as explained above. The content of the config file remains the same and its renamed to client.conf. All the files should be placed into /etc/openvpn and the client is started with:
/etc/init.d/openvpn start client
1 / 0 / 2 Регистрация: 27.03.2017 Сообщений: 49 |
|
20.07.2020, 08:41. Показов 1750. Ответов 24 Здравствуйте! Помогите настроить маршрутизацию между сервером и клиентом. Офис: Дом: Windows 7 (Клиент) На данный момент пинги проходят только в сети 10.8.0.0 конфиг server.ovpn Кликните здесь для просмотра всего текста
port 443 конфиг client.ovpn Кликните здесь для просмотра всего текста
client
0 |
insect_87 11436 / 7005 / 1903 Регистрация: 25.12.2012 Сообщений: 29,398 |
||||
22.07.2020, 14:06 |
||||
покажите, когда поднят ovpn
с сервера и клиента
0 |
1 / 0 / 2 Регистрация: 27.03.2017 Сообщений: 49 |
|
22.07.2020, 22:21 [ТС] |
|
Server ipconfig -all Кликните здесь для просмотра всего текста Настройка протокола IP для Windows Имя компьютера . . . . . . . . . : FOREVER Unknown adapter QYZYLJAR: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : fec0:0:0:ffff::1%1 Ethernet adapter optika: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 192.168.2.4 Ethernet adapter NIC4: Состояние среды. . . . . . . . : Среда передачи недоступна. Ethernet adapter NIC3: Состояние среды. . . . . . . . : Среда передачи недоступна. Ethernet adapter NIC2: Состояние среды. . . . . . . . : Среда передачи недоступна. Ethernet adapter NIC1: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 212.154.163.162 Туннельный адаптер isatap.{064E16D9-3E97-49B4-B438-74604AAFD36E}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер isatap.{759CB174-37BB-443F-8038-645249D4FEBC}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер isatap.{16E9996F-287B-43E9-8BE2-75B3E19A4D4C}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер 6TO4 Adapter: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 212.154.163.162 route print Кликните здесь для просмотра всего текста
Список интерфейсов IPv4 таблица маршрута IPv6 таблица маршрута Client ipconfig -all Кликните здесь для просмотра всего текста Настройка протокола IP для Windows Имя компьютера . . . . . . . . . : Александр-ПК Unknown adapter QYZYLJAR: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 8.8.8.8 Ethernet adapter Подключение по локальной сети: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 192.168.0.1 Туннельный адаптер isatap.{A49606F4-FF50-474E-A988-74FA17E44E38}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер isatap.{F1587BD6-A94F-4BE6-8F44-CA205D55AF50}: Состояние среды. . . . . . . . : Среда передачи недоступна. route print Кликните здесь для просмотра всего текста
Список интерфейсов IPv4 таблица маршрута IPv6 таблица маршрута Попытался сделать через NAT, вроде пошло. Но тогда интернета нигде нет. Пришлось убрать пока.
0 |
insect_87 11436 / 7005 / 1903 Регистрация: 25.12.2012 Сообщений: 29,398 |
||||||||||||||||
23.07.2020, 06:49 |
||||||||||||||||
И так:
2. На пк в сети сервера
3. На клиенте
+включить через реестр маршрутизацию
Локальный и туннельный адреса клиента должны быть фиксированными/постоянными
0 |
1 / 0 / 2 Регистрация: 27.03.2017 Сообщений: 49 |
|
23.07.2020, 07:45 [ТС] |
|
Server ipconfig -all Кликните здесь для просмотра всего текста Настройка протокола IP для Windows Имя компьютера . . . . . . . . . : FOREVER Unknown adapter QYZYLJAR: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : fec0:0:0:ffff::1%1 Ethernet adapter optika: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 192.168.2.4 Ethernet adapter NIC4: Состояние среды. . . . . . . . : Среда передачи недоступна. Ethernet adapter NIC3: Состояние среды. . . . . . . . : Среда передачи недоступна. Ethernet adapter NIC2: Состояние среды. . . . . . . . : Среда передачи недоступна. Ethernet adapter NIC1: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 212.154.163.162 Туннельный адаптер isatap.{064E16D9-3E97-49B4-B438-74604AAFD36E}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер isatap.{759CB174-37BB-443F-8038-645249D4FEBC}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер isatap.{16E9996F-287B-43E9-8BE2-75B3E19A4D4C}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер 6TO4 Adapter: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 212.154.163.162 route print Кликните здесь для просмотра всего текста
Список интерфейсов IPv4 таблица маршрута IPv6 таблица маршрута Client Кликните здесь для просмотра всего текста Настройка протокола IP для Windows Имя компьютера . . . . . . . . . : Александр-ПК Unknown adapter QYZYLJAR: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 8.8.8.8 Ethernet adapter Подключение по локальной сети: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 192.168.0.1 Туннельный адаптер isatap.{A49606F4-FF50-474E-A988-74FA17E44E38}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер isatap.{F1587BD6-A94F-4BE6-8F44-CA205D55AF50}: Состояние среды. . . . . . . . : Среда передачи недоступна. route print Кликните здесь для просмотра всего текста
Список интерфейсов IPv4 таблица маршрута IPv6 таблица маршрута Теперь с клиента пинг проходит на все компьютеры в сети сервера такого вида: Обмен пакетами с 192.168.2.1 по с 32 байтами данных: Статистика Ping для 192.168.2.1:
0 |
insect_87 11436 / 7005 / 1903 Регистрация: 25.12.2012 Сообщений: 29,398 |
||||||||
23.07.2020, 08:08 |
||||||||
1. на сервере удалите лишние маршруты: Сообщение от alexsher91 10.8.0.0 255.255.255.0 192.168.2.1 1 Сообщение от alexsher91 192.168.0.0 255.255.255.0 192.168.2.1 1 пример:
2. на клиенте удалите лишние маршруты: Сообщение от alexsher91 192.168.2.0 255.255.255.0 192.168.0.102 1 3. на сервере nat настроен? 4. покажите
с пк за сервером и с пк за клиентом
0 |
1 / 0 / 2 Регистрация: 27.03.2017 Сообщений: 49 |
|
23.07.2020, 08:35 [ТС] |
|
NAT настроен. Маршруты удалил. Server ipconfig -all Кликните здесь для просмотра всего текста Настройка протокола IP для Windows Имя компьютера . . . . . . . . . : FOREVER Unknown adapter QYZYLJAR: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : fec0:0:0:ffff::1%1 Ethernet adapter optika: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 192.168.2.4 Ethernet adapter NIC4: Состояние среды. . . . . . . . : Среда передачи недоступна. Ethernet adapter NIC3: Состояние среды. . . . . . . . : Среда передачи недоступна. Ethernet adapter NIC2: Состояние среды. . . . . . . . : Среда передачи недоступна. Ethernet adapter NIC1: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 212.154.163.162 Туннельный адаптер isatap.{064E16D9-3E97-49B4-B438-74604AAFD36E}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер isatap.{759CB174-37BB-443F-8038-645249D4FEBC}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер isatap.{16E9996F-287B-43E9-8BE2-75B3E19A4D4C}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер 6TO4 Adapter: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 212.154.163.162 route print Кликните здесь для просмотра всего текста
Список интерфейсов IPv4 таблица маршрута IPv6 таблица маршрута Client ipconfig -all Кликните здесь для просмотра всего текста Настройка протокола IP для Windows Имя компьютера . . . . . . . . . : Александр-ПК Unknown adapter QYZYLJAR: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 8.8.8.8 Ethernet adapter Подключение по локальной сети: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 192.168.0.1 Туннельный адаптер isatap.{A49606F4-FF50-474E-A988-74FA17E44E38}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер isatap.{F1587BD6-A94F-4BE6-8F44-CA205D55AF50}: Состояние среды. . . . . . . . : Среда передачи недоступна. route print Кликните здесь для просмотра всего текста Настройка протокола IP для Windows Имя компьютера . . . . . . . . . : Александр-ПК Unknown adapter QYZYLJAR: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 8.8.8.8 Ethernet adapter Подключение по локальной сети: DNS-суффикс подключения . . . . . : DNS-серверы. . . . . . . . . . . : 192.168.0.1 Туннельный адаптер isatap.{A49606F4-FF50-474E-A988-74FA17E44E38}: Состояние среды. . . . . . . . : Среда передачи недоступна. Туннельный адаптер isatap.{F1587BD6-A94F-4BE6-8F44-CA205D55AF50}: Состояние среды. . . . . . . . : Среда передачи недоступна. C:\Users\Александр>route print IPv4 таблица маршрута IPv6 таблица маршрута Добавлено через 3 минуты ipconfig -all Кликните здесь для просмотра всего текста
Имя компьютера . . . . . . . . . : ADMIN Адаптер Ethernet Ethernet: DNS-суффикс подключения . . . . . : route print Кликните здесь для просмотра всего текста
Список интерфейсов IPv4 таблица маршрута IPv6 таблица маршрута Добавлено через 38 секунд
0 |
insect_87 11436 / 7005 / 1903 Регистрация: 25.12.2012 Сообщений: 29,398 |
||||
23.07.2020, 08:40 |
||||
1. NAT настроен только на выход во внешку?
с пк из сети сервера и с пк из сети клиента
0 |
1 / 0 / 2 Регистрация: 27.03.2017 Сообщений: 49 |
|
23.07.2020, 08:44 [ТС] |
|
Да, NAT настроен только на выход во внешку. ipconfig -all Клиент всего один. Из дома.
0 |
11436 / 7005 / 1903 Регистрация: 25.12.2012 Сообщений: 29,398 |
|
23.07.2020, 08:49 |
|
так все должно работать.
0 |
1 / 0 / 2 Регистрация: 27.03.2017 Сообщений: 49 |
|
23.07.2020, 09:04 [ТС] |
|
В конфиге сервера ovpn: В конфиге клиента ovpn: Если NAT во внешку убираю, потом настраиваю NAT на VPN подключение, то могу зайти на сервер 192.168.2.1 и пингует нормально. Миниатюры
0 |
1 / 0 / 2 Регистрация: 27.03.2017 Сообщений: 49 |
|
23.07.2020, 09:07 [ТС] |
|
Вот пинг по vpn. Миниатюры
0 |
1 / 0 / 2 Регистрация: 27.03.2017 Сообщений: 49 |
|
23.07.2020, 09:29 [ТС] |
|
Только что заметил, что если добавить второй шлюз 192.168.2.1 в настройки vpn клиента, то пинг на 192.168.2.1 появляется и могу в него зайти по сети.
0 |
11436 / 7005 / 1903 Регистрация: 25.12.2012 Сообщений: 29,398 |
|
23.07.2020, 13:06 |
|
Сообщение от alexsher91 В конфиге сервера ovpn: попробуйте их убрать из конфигов ovpn или закомментируйте, пусть останутся только те маршруты, что вы руками через route add прописали
0 |
1 / 0 / 2 Регистрация: 27.03.2017 Сообщений: 49 |
|
23.07.2020, 13:18 [ТС] |
|
Server route print Кликните здесь для просмотра всего текста
Список интерфейсов IPv4 таблица маршрута IPv6 таблица маршрута Client route print Кликните здесь для просмотра всего текста
Список интерфейсов IPv4 таблица маршрута IPv6 таблица маршрута Маршруты в ovpn закомментировал.
0 |
insect_87 11436 / 7005 / 1903 Регистрация: 25.12.2012 Сообщений: 29,398 |
||||||||
23.07.2020, 13:49 |
||||||||
уберите на клиенте маршрут
и добавьте его таким образом
на сервере это смущает: Сообщение от alexsher91 192.168.0.0 255.255.255.0 On-link 192.168.2.1 6
0 |
1 / 0 / 2 Регистрация: 27.03.2017 Сообщений: 49 |
|
23.07.2020, 14:36 [ТС] |
|
Всё, сделал. А что с этим делать? Добавлено через 24 минуты
0 |
insect_87 11436 / 7005 / 1903 Регистрация: 25.12.2012 Сообщений: 29,398 |
||||||||||||
23.07.2020, 15:02 |
||||||||||||
alexsher91, а сделайте и выложите сюда с клиента:
с ПК 192.168.2.240:
с сервера:
0 |
1 / 0 / 2 Регистрация: 27.03.2017 Сообщений: 49 |
|
23.07.2020, 15:44 [ТС] |
|
Всё, сделал.
0 |
11436 / 7005 / 1903 Регистрация: 25.12.2012 Сообщений: 29,398 |
|
23.07.2020, 16:47 |
|
на клиенте трафик в инет пошел, а не в туннель вы это при поднятом туннеле делали?
0 |