Wireguard unable to create network adapter windows 7

Перейти к содержанию

DragonIT

  • AutoSoft
  • Обслуживание
  • Помощь
  • Прайс-лист
  • Контакты

Автор Дмитрий DragonIT На чтение 1 мин Просмотров 2.6к. Опубликовано

Получаете ошибку ?

wireguard windows 7 unable to create network adapter

Возможны варианты проблемы и их решения:

1. Ваш Windows сильно устарел по обновлениям, установите все обновления и проблема решится.

2. Есть еще информация, что если поставить старую версию WireGuard (0.4), то поможет.
Мне 0.4 версия не помогла и пришлось обновлять Windows, долго и упорно…
Но если хотите попробовать сами, ловите WireGuard 0.4

wireguard-x86-0.4
wireguard-amd64-0.4

3. Ввиду того что WireGuard при каждом подключении делает новую сеть, у вас банально мог переполниться список известных сетей.

Найдите раздел реестра
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles

Там хранится список сетей к которым когда либо подключался ПК,удалите те что создал WireGuard и перезагрузите ПК. У меня после этого сеть спокойно поднялась
(спасибо Archer за данную проблему и способ решения)

Вам также может понравиться

Если вы столкнулись с проблемой, что не можете подключиться

0346

Как убрать «Показать дополнительные параметры

1507

   Если нам требуется: Объединить несколько удаленных

0510

Не везде в Windows можно нажать правым кликом и «

0250

Иногда при RDP соединений происходит ошибка, предполагаю

0245

Работать приходится в основном с маленькими офисами

0131

Mikrotik это Латвийская компания, которая работает

0198

Данная инструкция подходит для любых материнских плат

01.5к.

Мы используем cookie-файлы, чтобы получить статистику, которая помогает нам улучшить сервис для Вас с целью персонализации сервисов и предложений. Продолжая пользоваться сайтом, вы даёте согласие на использование ваших cookie-файлов.

Greetings fellow tech enthusiasts and networking professionals! In this journal article, we will explore the common issue of “WireGuard unable to create network adapter” that many users have faced while configuring their VPN connections. WireGuard is a popular VPN protocol that offers faster and more secure connections than traditional VPN protocols. However, its setup process can sometimes be complex and may cause various errors, including the one we’ll focus on in this article.

What is WireGuard?

Before we dive into the main topic, let’s have a brief overview of WireGuard. WireGuard is a modern VPN protocol that was developed to provide a faster and more secure connection than other VPN protocols such as OpenVPN and IPSec. It is an open-source VPN protocol that uses state-of-the-art cryptography and implements newer and more efficient techniques such as Noise protocol framework and BLAKE2s hash function. WireGuard is known for its excellent speed, which makes it a popular choice for VPN services and enthusiasts.

How does WireGuard Work?

WireGuard works by creating virtual network interfaces, which are used to route traffic through the VPN tunnel. It uses public key cryptography to establish a secure connection between the client and server. The client and server exchange public keys, and then a shared secret is generated. This shared secret is used to establish a secure session between the two parties, which is used to encrypt and decrypt data.

Now let’s discuss the main topic of this article, which is the “WireGuard unable to create network adapter” error that users have experienced while setting up their VPN connections.

What Causes the “WireGuard Unable to Create Network Adapter” Error?

The “WireGuard unable to create network adapter” error occurs when WireGuard is not able to create a virtual network interface on the user’s device. This error can be caused by various reasons such as:

Reason Solution
The user does not have administrative privileges on their device The user should log in as an administrator or contact their IT department to obtain administrative privileges.
The device’s network adapter drivers are outdated or missing The user should update their network adapter drivers or reinstall them from the device manufacturer’s website.
The device’s network adapter is disabled The user should enable their network adapter in the device’s control panel or settings.
The device’s network adapter is conflicting with another network adapter The user should disable the conflicting network adapter or change its settings to avoid conflicts.

The above table shows the common reasons for the error and their solutions. However, there may be other reasons for the “WireGuard unable to create network adapter” error, which we’ll discuss further in the next section.

How to Fix the “WireGuard Unable to Create Network Adapter” Error?

As discussed earlier, several reasons can cause the “WireGuard unable to create network adapter” error. Therefore, the solution may vary depending on the cause. Here are some general methods that users can try to fix the error:

Method 1: Enable Administrative Privileges

If the user does not have administrative privileges on their device, they will not be able to create a virtual network interface. Therefore, the user should log in as an administrator or contact their IT department to obtain administrative privileges.

Method 2: Update Network Adapter Drivers

If the device’s network adapter drivers are outdated or missing, the user should update their network adapter drivers or reinstall them from the device manufacturer’s website. To update the drivers, follow these steps:

  1. Open the Device Manager on the user’s device.
  2. Expand the Network Adapters section.
  3. Right-click on the network adapter that is causing the error and select Update driver.
  4. Follow the on-screen instructions to update the driver.

If the user does not find an updated driver, they can try reinstalling the network adapter drivers from the device manufacturer’s website.

Method 3: Enable Network Adapter

If the device’s network adapter is disabled, the user should enable their network adapter in the device’s control panel or settings. To enable the network adapter, follow these steps:

  1. Open the Device Manager on the user’s device.
  2. Expand the Network Adapters section.
  3. Right-click on the network adapter that is causing the error and select Enable.
  4. The network adapter should be enabled now. If not, the user can try updating its drivers or contacting their device manufacturer for assistance.

Method 4: Resolve Network Adapter Conflicts

If the device’s network adapter is conflicting with another network adapter, the user should disable the conflicting network adapter or change its settings to avoid conflicts. To resolve network adapter conflicts, follow these steps:

  1. Open the Control Panel on the user’s device.
  2. Select Network and Sharing Center.
  3. Click on Change adapter settings.
  4. Right-click on the network adapter that is causing the error and select Properties.
  5. Uncheck all the services and protocols except for the WireGuard adapter.
  6. Click OK to save the changes.

If the above methods do not work, the user can contact their VPN service provider or the WireGuard community for assistance.

FAQs

Q1. What is WireGuard?

A1. WireGuard is a modern VPN protocol that was developed to provide a faster and more secure connection than other VPN protocols such as OpenVPN and IPSec.

Q2. Why does the “WireGuard unable to create network adapter” error occur?

A2. The “WireGuard unable to create network adapter” error occurs when WireGuard is not able to create a virtual network interface on the user’s device. This error can be caused by various reasons such as administrative privileges, outdated or missing network adapter drivers, disabled network adapter, or conflicting network adapter.

Q3. How can I fix the “WireGuard unable to create network adapter” error?

A3. The user can try enabling administrative privileges, updating network adapter drivers, enabling network adapter, or resolving network adapter conflicts to fix the error.

We hope this article has been helpful in understanding and fixing the “WireGuard unable to create network adapter” error. If you have any further questions or suggestions, please leave a comment below. Thank you for reading!

Source :

  • sshstores.net
  • wireguard unable to create network adapter

Содержание

  1. WireGuard Server на Windows
  2. Предварительные изыскания
  3. Итак, сформулируем задачу
  4. WireSock Gateway
  5. не получается подключиться через wireguard
  6. windows: CreateTUN: Error registering rings: Error listing NDIS interfaces: no interfaces found #524
  7. Comments
  8. bradfitz commented Jul 5, 2020 •
  9. burhan commented Jul 5, 2020
  10. skycrash commented Jul 8, 2020
  11. bradfitz commented Jul 8, 2020
  12. burhan commented Jul 8, 2020
  13. bradfitz commented Jul 8, 2020
  14. bradfitz commented Jul 8, 2020
  15. burhan commented Jul 8, 2020 •
  16. bradfitz commented Jul 8, 2020
  17. bradfitz commented Jul 10, 2020
  18. bradfitz commented Jul 16, 2020
  19. bradfitz commented Jul 16, 2020
  20. burhan commented Jul 28, 2020 •
  21. marpie commented Jul 29, 2020
  22. judfromhud commented Aug 19, 2020
  23. Wireguard windows 7 unable to create wintun interface
  24. WireGuard заработал в режиме ядра WindowsNT

WireGuard Server на Windows

Подозреваю, что я не один такой, кто держит дома в режиме 24/7 маленький и тихий системный блок с Windows в качестве сервера, на который можно зайти по RDP (с того же смартфона) и несколько переживает в связи с количеством «неслучайных» попыток к нему подключиться. Задача не новая и вполне себе решаемая, например можно рассмотреть следующие варианты:

Не очень понятно, можно ли зайти со смартфона (для iPhone вероятно понадобится какой-то гибридный RDP клиент).

Поддерживается только TCP, а RDP уже довольно давно умеет использовать преимущества UDP.

Обновления Windows имеют необъяснимое свойство отключать OpenSSH, не знаю с чем это связано, но несколько за год раз такое было.

Настроить VPN непосредственно на маршрутизаторе. В целом, решение рабочее и минусы тут довольно субъективные:

Не хочется вешать на маршрутизатор дополнительную «необязательную» нагрузку.

Открывается дополнительный вектор атаки непосредственно на маршрутизатор.

Требует определенных технических навыков.

Дополнительно установить Raspberry Pi и на нем настроить VPN (можно ещё много чего на ней запустить). До сих пор пользуюсь, отличный вариант, если есть необходимые навыки и немного денег на «малинку».

Скорее для полноты картины, чем для реального домашнего использования, можно установить Hyper-V на нашу машинку с Windows, создать виртуальную машину с Linux и на нем настроить VPN. Как и в предыдущем случае:

Требует определенных технических навыков.

Могут возникнуть проблемы при отключении питания (виртуальная машина окажется в состоянии Saved и VPN будет недоступен).

Ну и наконец, можно установить сервер VPN непосредственно на Windows. Выбор конкретного VPN дело глубоко личное, но мне последние пару лет посчастливилось изрядно поработать с WireGuard и даже реализовать специализированного клиента для Wandera, в связи с этим выбор был очевиден.

Предварительные изыскания

Я думаю, это ни для кого не новость, что WireGuard уже больше года как включен в основную ветку ядра Linux. С Windows не все так радужно, однако в силу специфики протокола официальный WireGuard для Windows вполне себе выполняет функцию сервера, ему не хватает только NAT. Благодаря Henry Chang и его вдохновленному им micahmo примерно известно как сделать это стандартными средствами Windows. Честно говоря, процесс выглядит немного сложновато, хотя надо отдать должное micahmo, который его частично автоматизировал. Помимо этого, меня заинтересовал следующий комментарий под оригинальным постом:

I have a Win10 machine that I plan to use as a wireguard server. This machine has a main internet network adapter + OpenVPN client connection that is used for selected routes.
If I understand correctly described above wireguard VPN setup will only allow my wireguard clients to access main internet interface but not the OpenVPN connection, please correct me I’m wrong.
Is there a way for a wireguard client to use all available connections and honor existing routes configuration on wireguard server?

Думаю, что полный перевод не требуется, суть состоит в том, чтобы WireGuard использовал для выхода не какой-то один определенный интерфейс (это единственный вариант с Windows Internet Connection Sharing), а тот из них который определен согласно действующей таблице маршрутизации.

Итак, сформулируем задачу

Максимально упростить процесс установки и настройки WireGuard. Давление на компании предоставляющие услуги VPN нарастает и, согласитесь, было бы неплохо, если бы любой пользователь Windows мог бы:

Настроить WireGuard на сервере расположенном облаке, не погружаясь в особенности реализации. Я не призываю к обходу блокировок уважаемого Роскомнадзора, но это так же может быть необходимо, чтобы обойти географические ограничения на какие-то продукты или услуги. Например, до недавнего времени, Ghidra нельзя было скачать с российского IP адреса. Сайт и сейчас вас не пустит, но сам дизассемблер можно скачать с Github. Или цена (валюта расчетов) на авиабилеты может варьироваться в зависимости от страны, с IP которой Вы зашли на сайт авиакомпании. Или можем вспомнить недавнюю историю с «неофициально» ввезенными телевизорами Samsung, у которых «неожиданно» отключилась функция Smart TV. Вернуть телевизор к нормальной жизни можно было только подключив его через европейский VPN. И это только то, что я сходу смог вспомнить.

Установить WireGuard на домашнем Windows сервере и получить постоянный защищенный доступ в собственную сеть и пользоваться ВСЕМИ сервисами доступными ему дома независимо от того в какой точке мира он находится. Например, понравилась мне Яндекс Станция (это не реклама, я действительно их довольно много приобрел для себя, для семьи, в подарки друзьям), да так, что я даже одну привез на Тенерифе. И тут выяснилась удивительная подробность, Яндекс-музыка работает за границей, а вот КиноПоиск ссылается на географические ограничения и отказывается работать. Было бы обидно, но настроил WireGuard клиента на роутере Keenetic и подключил Яндекс станцию через домашний VPN в России. А еще не так уж давно я проделывал что-то подобное для Amazon Fire Stick, чтобы нормально пользоваться подпиской Prime. Могу ошибаться, но кажется где-то читал, что и сам WireGuard был изначально придуман, чтобы смотреть американский Netflix из Австралии.

Использовать некую альтернативу Internet Connection Sharing со всем уважением к имеющейся сетевой конфигурации.

WireSock Gateway

image loader

Основная работа выполняется сервисом Wiresock Service, который поддерживает два режима работы: NAT и Proxy.

Первый это классический NAT, сервис включает маршрутизацию (для некоторых типов соединений начиная с Windows 7 встроенная маршрутизация не работает, и они маршрутизируются «вручную»), определяет внешний интерфейс «по умолчанию» на котором и занимается подменой адресов во входящих/исходящих пакетах. Получает почти то же самое, что дает встроенный Internet Connection Sharing, но без ограничений на адреса клиентской сети.

Таким образом, основные задачи вроде бы выполнены. И если к проекту будет интерес, то ему есть куда развиваться, например:

На данный момент (v.1.0.2.4) отсутствует поддержка IPv6.

«Белые» IPv4 постепенно становятся редкостью, поэтому хотелось бы организовать работу WireGuard сервера за NAT (или даже multi-NAT) Интернет-провайдера. Здесь правда без внешнего сервиса (с «белым» IP) обойтись не удастся.

Источник

с клиента на сервер не пингуется

p

130614:527561423

p

86912:2087359229

так и должно быть?
Лучше конфиги покажи.
И вот умвр, сервер — сентось7, клиент — джента. Пинги ходят туда-сюда и у тебя должны.

p

да. Мне бы хотелось, чтобы сервер не знал, где находится клиент до первого коннекта.

Ты прав в том, что если его явно прописать, то пинги начинают ходить. Но у меня клиент потом будет находиться за NAT и я не могу прописать его IP и порт (порт вообще динамический). И не надо советовать делать пробрасывание на NAT, я как раз этого хочу избежать.

p

думаю, что не при чём. второй так вообще отсутствует.

p

не лучше, там приватные ключи от дома лежат:

p

p

Приватные ключи настоящие, или ты их подправил? Если настоящие, то у тебя похоже публичные ключи не те.

p

86912:2087359229

не лучше, там приватные ключи от дома лежат:

Их можно «запикать» типа pkey1, pkey2 и т.д

Ээээ, Семён Семёныч!

Вот смотри, ты сгенерировал на сервере и клиенте пары ключей
на сервере privkey и publickey_server
На клиенте соответственно privkey1 и public_client1

/etc/wireguard/wg0.conf
[Interface]
PrivateKey = privkey ★★★★★ ( 02.07.18 01:44:13 )

86912:2087359229

да. Мне бы хотелось, чтобы сервер не знал, где находится клиент до первого коннекта.

У тебя какое-то сильно неверное представление. Сервер итак не знает где находится клиент. В файле конфигурации это не указывается. Тем не менее, после установившегося соединения wg show wg0 будет показывать в endpoint откуда клиент пришёл. У тебя там непонятно почему нули, поэтому логично что у тебя соединения нет. Но, у меня например, если клиент не подключен, то endpoint вообще на сервере в выхлопе peer не показывает. Поэтому нули меня удивили.

86912:2087359229

Вот это у меня в секции [Interface] у клиента лишнее. Не помню уже откуда и зачем оно там осталось.

Источник

windows: CreateTUN: Error registering rings: Error listing NDIS interfaces: no interfaces found #524

The Tailscale service doesn’t start for some Windows users. Logs:

The Error listing NDIS interfaces is from:

Which calls this, which returns the no interfaces found :

The text was updated successfully, but these errors were encountered:

As requested, output of ipconfig /all

86978398 7ec7f200 c187 11ea 8e7a fd47e6296e01

@burhan, my logs show that your machine is still running 0.95-0 stuck in a failure loop.

Perhaps our installer is failing to stop the existing running service before installing newer versions.

Can you go manually stop the service, kill the process if needed, and restart or reinstall?

@burhan, I filed #537 for the installer bug.

After a reboot, some progress! Once you dismiss this dialog, the notification tray icon crashes. This is different than the previous version, where the notification tray icon would remain but show that the service isn’t running.

86980049 838ea500 c18b 11ea 850e 9377147a1901

I reinstalled the application, which resulted in the same safesocket.Connect exception as before:

86980316 37903000 c18c 11ea 89e1 4588f0cd9470

The service is running:

86980391 60b0c080 c18c 11ea 83f5 c6a38fa2ff05

However, the application:

86980431 732afa00 c18c 11ea 835f ab296c71ef58

Restarting the service from the services.msc snap-in didn’t raise an error, but the notification tray icon still shows the service is not running.

BTW, little known Windows trick: you can focus those message box dialogs and hit Control-C and even though the text can’t be selected, that Control-C should make a sound and copy the full text to your clipboard which you can paste in here.

This won’t fix the issue, but it makes it have a much more verbose error message with more details.

@burhan, could you try it and paste the error here?

BTW, I hit this myself today. But only once and then it went away. I don’t have a reliable way to reproduce it.

I just got this error myself (running start /w tailscaled-ipn.exe /server in cmd.exe as Administrator). With new logging:

wgengine.NewUserspaceEngine: Error registering rings: Error listing NDIS interfaces: no interfaces found; buflen=1, deviceID=»ROOTNET002″, flags=0x0

Program starting: v0.100.0-106-ged6dd7b94: []string<«Z:installerbinamd64tailscale-ipn.exe», «/subproc», «d50190ab61c3ceb7407b45662c645d6051b2fb99bda508222471680a02b2acf2»>
subproc mode: logid=d50190ab61c3ceb7407b45662c645d6051b2fb99bda508222471680a02b2acf2
srv: 0.9M/0.0M Starting userspace wireguard engine with tun device «Tailscale»
srv: 1.1M/0.0M no TUN failure diagnostics for OS «windows»
srv: 1.1M/0.0M CreateTUN: Error registering rings: Error listing NDIS interfaces: no interfaces found; buflen=1, deviceID=»ROOTNET003″, flags=0x0
srv: 1.1M/0.0M wgengine.New: Error registering rings: Error listing NDIS interfaces: no interfaces found; buflen=1, deviceID=»ROOTNET003″, flags=0x0
srv: 1.1M/0.0M Listening on 127.0.0.1:41112

I notice the deviceID incremented, if that means anything.

So I finally managed to try out a new build, sadly:

However, on another machine that is running a different Windows build (and didn’t have tailscale installed), not such errors.

Working Windows Version: 10.0.20175 Build 20175 (Insider Preview)
Failing Windows Version: 10.0.19042 Build 19042

Update to add the log:

wgengine.NewUserspaceEngine: Error creating interface: GetStringValueWait(NetCfgInstanceId) failed: Timeout waiting for registry value

I upgraded Tailscale yesterday to 0.100.0-107 (gcef402bc9) and got the same error on my Windows 10 Box (10.0.18363.959).

On another system (Win10: 10.0.18363.900) the error is not present with the same Tailscale version. May it have anything to do with the fact that the erroring system uses Hyper-V? Or another change in the erroring system is that it has a wireless card with no IP-Stack. This is due to the fact that the card just connects to the WiFi and the VMs are using bridging to get their IPs.

If I manually stop the Windows service and restart it (and the GUI) the error disappears.

I was getting this error on one of my machines as well:
90581679 d5b6e300 e199 11ea 826e f209ff9d819d

What fixed it for me was to change the IPv6 registry setting from 0xFF to 0x20 according to this article from Microsoft.
https://support.microsoft.com/en-us/help/929852/guidance-for-configuring-ipv6-in-windows-for-advanced-users

This was the only difference I could find between two of my machines. Hope this helps!

Источник

Wireguard windows 7 unable to create wintun interface

TUN Device Driver for Windows

This is a layer 3 TUN driver for Windows 7, 8, 8.1, and 10. Originally created for WireGuard, it is intended to be useful to a wide variety of projects that require layer 3 tunneling devices with implementations primarily in userspace.

Wintun is deployed as a platform-specific wintun.dll file. Install the wintun.dll file side-by-side with your application. Download the dll from wintun.net, alongside the header file for your application described below.

Include the wintun.h file in your project simply by copying it there and dynamically load the wintun.dll using LoadLibraryEx() and GetProcAddress() to resolve each function, using the typedefs provided in the header file. The InitializeWintun function in the example.c code provides this in a function that you can simply copy and paste.

With the library setup, Wintun can then be used by first creating an adapter, configuring it, and then setting its status to «up». Adapters have names (e.g. «OfficeNet») and types (e.g. «Wintun»).

After creating an adapter, we can use it by starting a session:

Then, the WintunAllocateSendPacket and WintunSendPacket functions can be used for sending packets (used by SendPackets in the example.c code):

And the WintunReceivePacket and WintunReleaseReceivePacket functions can be used for receiving packets (used by ReceivePackets in the example.c code):

Some high performance use cases may want to spin on WintunReceivePackets for a number of cycles before falling back to waiting on the read-wait event.

You are highly encouraged to read the example.c short example to see how to put together a simple userspace network tunnel.

The various functions and definitions are documented in the reference below.

#define WINTUN_MAX_POOL 256

Maximum pool name length including zero terminator

#define WINTUN_MIN_RING_CAPACITY 0x20000 /* 128kiB */

Minimum ring capacity.

#define WINTUN_MAX_RING_CAPACITY 0x4000000 /* 64MiB */

Maximum ring capacity.

#define WINTUN_MAX_IP_PACKET_SIZE 0xFFFF

Maximum IP packet size

typedef void* WINTUN_ADAPTER_HANDLE

A handle representing Wintun adapter

typedef BOOL(* WINTUN_ENUM_CALLBACK) (WINTUN_ADAPTER_HANDLE Adapter, LPARAM Param)

Called by WintunEnumAdapters for each adapter in the pool.

Parameters

Returns

Non-zero to continue iterating adapters; zero to stop.

typedef void(* WINTUN_LOGGER_CALLBACK) (WINTUN_LOGGER_LEVEL Level, DWORD64 Timestamp, const WCHAR *Message)

Called by internal logger to report diagnostic messages

Parameters

typedef void* WINTUN_SESSION_HANDLE

A handle representing Wintun session

Determines the level of logging, passed to WINTUN_LOGGER_CALLBACK.

WINTUN_ADAPTER_HANDLE WintunCreateAdapter (const WCHAR * Name, const WCHAR * TunnelType, const GUID * RequestedGUID)

Creates a new Wintun adapter.

Parameters

Returns

If the function succeeds, the return value is the adapter handle. Must be released with WintunCloseAdapter. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

WINTUN_ADAPTER_HANDLE WintunOpenAdapter (const WCHAR * Name)

Opens an existing Wintun adapter.

Parameters

Returns

If the function succeeds, the return value is adapter handle. Must be released with WintunCloseAdapter. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

void WintunCloseAdapter (WINTUN_ADAPTER_HANDLE Adapter)

Releases Wintun adapter resources and, if adapter was created with WintunCreateAdapter, removes adapter.

Parameters

Deletes the Wintun driver if there are no more adapters in use.

Returns

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

void WintunGetAdapterLuid (WINTUN_ADAPTER_HANDLE Adapter, NET_LUID * Luid)

Returns the LUID of the adapter.

Parameters

DWORD WintunGetRunningDriverVersion (void )

Determines the version of the Wintun driver currently loaded.

Returns

If the function succeeds, the return value is the version number. If the function fails, the return value is zero. To get extended error information, call GetLastError. Possible errors include the following: ERROR_FILE_NOT_FOUND Wintun not loaded

void WintunSetLogger (WINTUN_LOGGER_CALLBACK NewLogger)

Sets logger callback function.

Parameters

WINTUN_SESSION_HANDLE WintunStartSession (WINTUN_ADAPTER_HANDLE Adapter, DWORD Capacity)

Starts Wintun session.

Parameters

Returns

Wintun session handle. Must be released with WintunEndSession. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

void WintunEndSession (WINTUN_SESSION_HANDLE Session)

Ends Wintun session.

Parameters

HANDLE WintunGetReadWaitEvent (WINTUN_SESSION_HANDLE Session)

Gets Wintun session’s read-wait event handle.

Parameters

Returns

BYTE* WintunReceivePacket (WINTUN_SESSION_HANDLE Session, DWORD * PacketSize)

Retrieves one or packet. After the packet content is consumed, call WintunReleaseReceivePacket with Packet returned from this function to release internal buffer. This function is thread-safe.

Parameters

Returns

Pointer to layer 3 IPv4 or IPv6 packet. Client may modify its content at will. If the function fails, the return value is NULL. To get extended error information, call GetLastError. Possible errors include the following: ERROR_HANDLE_EOF Wintun adapter is terminating; ERROR_NO_MORE_ITEMS Wintun buffer is exhausted; ERROR_INVALID_DATA Wintun buffer is corrupt

void WintunReleaseReceivePacket (WINTUN_SESSION_HANDLE Session, const BYTE * Packet)

Releases internal buffer after the received packet has been processed by the client. This function is thread-safe.

Parameters

BYTE* WintunAllocateSendPacket (WINTUN_SESSION_HANDLE Session, DWORD PacketSize)

Allocates memory for a packet to send. After the memory is filled with packet data, call WintunSendPacket to send and release internal buffer. WintunAllocateSendPacket is thread-safe and the WintunAllocateSendPacket order of calls define the packet sending order.

Parameters

Returns

Returns pointer to memory where to prepare layer 3 IPv4 or IPv6 packet for sending. If the function fails, the return value is NULL. To get extended error information, call GetLastError. Possible errors include the following: ERROR_HANDLE_EOF Wintun adapter is terminating; ERROR_BUFFER_OVERFLOW Wintun buffer is full;

void WintunSendPacket (WINTUN_SESSION_HANDLE Session, const BYTE * Packet)

Sends the packet and releases internal buffer. WintunSendPacket is thread-safe, but the WintunAllocateSendPacket order of calls define the packet sending order. This means the packet is not guaranteed to be sent in the WintunSendPacket yet.

Parameters

Источник

WireGuard заработал в режиме ядра WindowsNT

image loader

Разработчик WireGuard VPN Джейсон Доненфельд выпустил новую версию WireGuardNT, которая работает в режиме ядра WindowsNT (7, 8.1, 10, 11, 2012, 2016, 2019, 2022). Перенос всего кода в ядро значительно повышает пропускную способность туннеля практически на любых соединениях, особенно по WiFi.

image loader
Сравнение производительности различных VPN. Источник: WireGuard

image loader
Сравнение производительности WireGuard и OpenVPN. Источник: WireGuard

В январе 2020 года после нескольких лет разработки Линус Торвальдс принял WireGuard в основную ветку ядра Linux 5.6. Линус высоко оценил программу с точки зрения качества кода.

image loader
Отзыв Линуса можно заносить в резюме

В обычной версии WireGuard для Windows используется реализация WireGuard на Go в userspace. Она привязывается к виртуальному сетевому устройству, большая часть которого также находится в userspace. Джейсон Доненфельд написал собственный виртуальный сетевой интерфейс Wintun, поскольку существующая реализация tap-windows от OpenVPN оставляет желать лучшего.

Wintun определённо лучше tap-windows: даже в проекте OpenVPN такая замена увеличивает пропускную способность туннеля примерно в полтора раза (с 414 до 737 Мбит/с в клиенте OpenVPN 2, с 652 до 904 в OpenVPN 3, в обоих случаях на 7-гигабитном канале). Но при этом мы всё равно не избавляемся от необходимости постоянных контекстных переключений из пространства ядра (реальный сетевой стек) в пространство пользователя (OpenVPN и wireguard-go).

Поэтому для максимальной производительности VPN желательно перенести в ядро весь стек, включая виртуальный адаптер, криптографию и всё остальное. В Linux для этого создаётся модуль DLKM (Dynamically-Loadable Kernel Module), а в Windows — драйвер устройства в ядре. Кстати, проект WireGuardNT начинался именно как прямой порт WireGuard для ядра Linux.

image loader
Архитектура ядра WindowsNT

По словам Доненфельда, кодовая база хорошо срослась с нативным кодом ядра и программными интерфейсами NDIS для сетевых драйверов. В итоге получилась «глубоко интегрированная и высокопроизводительная реализация WireGuard для ядра NT, использующая весь спектр возможностей ядра NT и NDIS».

Устранив переключения контекста, удалось значительно повысить производительность. По независимым тестам Ars Technica, на одном и том же оборудовании WireGuardNT даёт на 10−25% больше пропускной способности, чем wireguard-go и Wintun. Другие тестеры говорят даже о росте производительности в несколько раз (с 95 до 600 Мбит/с по WiFi). Сам Джейсон на тестовой Windows-машине зафиксировал производительность 7,5 Гбит/с по VPN.

Вообще, это интересный пример того, как программист-любитель пишет более качественный код для ядра Windows, чем профессионалы из Microsoft. Интересно, сколько человек работает над функцией Always On VPN в Windows Server?

Источник

Приветствую, коллеги.
В данной записи хочу опубликовать материал, по которому я установил и настроил WireGuard с веб-интерфейсом.

Установку производил на Ubuntu Server 22.04

Как установить Ubuntu Server 22.04

После установки настоятельно рекомендую выполнить обновление

Bash
1
apt update && apt upgrade -y

а также, установить пароль для root

В данном случае WireGurd устанавливается с Docker, т.е. по сути это набор контейнеров, который требуется установить:

Bash
1
curl -sSL https://get.docker.com | sh

Далее, добавляем текущего пользователя в группу Docker

Bash
1
sudo usermod -aG docker $(whoami)

А теперь разворачиваем контейнеры с WireGuard

Bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
docker run -d \
  --name=wg-easy \
  -e WG_HOST=11.22.33.44 \
  -e PASSWORD=P@S$W0RD \
  -e WG_DEFAULT_DNS=8.8.8.8,1.1.1.1 \
  -v ~/.wg-easy:/etc/wireguard \
  -p 51820:51820/udp \
  -p 51821:51821/tcp \
  --cap-add=NET_ADMIN \
  --cap-add=SYS_MODULE \
  --sysctl="net.ipv4.conf.all.src_valid_mark=1" \
  --sysctl="net.ipv4.ip_forward=1" \
  --restart unless-stopped \
  weejewel/wg-easy

Где:
11.22.33.44 — выделенный ip-адрес от провайдера (статика), также можно указать динамический DNS (проверено на микротике);
P@S$W0RD — пароль от будущего веб-интерфейса управления WireGurd (вход в веб-морду осуществляется без указания имени пользователя, только пароль);
8.8.8.8,1.1.1.1 — какие угодно DNS, можете указать локальные (если у Вас они имеются);
51820:51820 — порт для подключения клиентов VPN, не забудьте его пробросить на роутере;
51821:51821 — порт управления веб-интерфейсом.

Итак, после установки идем в браузере по адресу 11.22.33.44:51821

Нажмите на изображение для увеличения
Название: 01.jpg
Просмотров: 152
Размер:	20.5 Кб
ID:	8034

Вводим пароль, который указали при конфигурировании контейнеров (P@S$W0RD), и видим примерно следующее:

Нажмите на изображение для увеличения
Название: 02.jpg
Просмотров: 139
Размер:	29.5 Кб
ID:	8035

Добавляем нового пользователя и скачиваем конфиг:

Нажмите на изображение для увеличения
Название: 03.jpg
Просмотров: 135
Размер:	32.9 Кб
ID:	8036

Конфиг клиента VPN выглядит так:

[Interface]PrivateKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=
Address = 10.10.10.2/24
DNS = 8.8.8.8,1.1.1.1

[Peer]
PublicKey = YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY=
PresharedKey = ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 0
Endpoint = 11.22.33.44:51820

Здесь я хочу заострить внимание на параметре AllowedIPs его значение равно 0.0.0.0/0 это значит, что удаленный клиент будет иметь доступ ко всей подсети предприятия (хорошо для админов и плохо для обычного юзера в плане ифнобеза), соответственно если мы логиним по VPN обычного юзера, то вписываем сюда только тот ip-адрес(а), доступ к которым ему необходим.

После проделанного, качаем приложение WireGuard, подгружаем конфиг и подключаемся.

Приложение также есть и для смартфонов, а для удобства можно отсканировать QR-код прямо из веб-морды, но лично я не стал бы это делать для обычных юзеров, а все же сконфигурировал бы файл для доступа только к нужным сервисам из соображения безопасности.

Каких-либо проблем при эксплуатации я не заметил, но время покажет.

P.S.: Файлы программы в самой системе находятся здесь: ~/.wg-easy

UPD

Возможные проблемы

Если при попытке подключения через приложение WireGuard в WIndows 7 выходит такая ошибка:

Цитата:

unable to create network adapter

Необходимо установить обновление kb4474419

I created a Wireguard server, but can’t get it running on my personal Windows 10 PC. When I try to activate the tunnel using the app, I can see a Wireguard network adapter appearing in the Device Manager for a short period, and then Wireguard fails, saying «Couldn’t create network adapter«.

What I did:

  1. I tried connecting from many different devices (iOS, MacOS, Windows 10 laptop, Windows 8 PC) with all of my configs working just fine, so I am pretty sure that client-server configuration is not the issue, and the problem is with my OS.

  2. I tried to inspect the traffic with wireshark and cant even see a handshake, so indeed Wireguard apparently fails yet before creating the connector.

  3. I also tried launching wireguard from elevated console using >wireguard /installtunnelservice «C:\config_path.conf», which resulted in the very same error.

  4. Of couse, I tried doing everything as admin user, with WG also being installed under the admin.

  5. Finally, I noticed a strange error, when installing a different software (npcap, if that matters), which might inidcate something. When installing this software, I had the wireguard app uninstalled. This software was looking through the driver packages avaliable on my system. At some point it found the driver package, subscribed by Wireguard LLC (which, once again, I thought was completely uninstalled), and failed with the following error log:

NpCap installation failed due to Wireguard network adapter driver package

[00004D70] 2023-09-28 14:45:20 <-- executeCommand

[00004D70] 2023-09-28 14:45:20 --> getInfNamesFromPnpUtilOutput

[00004D70] 2023-09-28 14:45:20 <-- getInfNamesFromPnpUtilOutput

[00004D70] 2023-09-28 14:45:20 <-- ClearDriverStore

[00004D70] 2023-09-28 14:45:20 <-- _tmain: succeed, nStatus = 0.

[00001F88] 2023-09-28 14:45:20 --> wmain

[00001F88] 2023-09-28 14:45:20 _tmain: executing, argv[1] = -n.

[00001F88] 2023-09-28 14:45:20 _tmain: executing, argv[2] = -iw.

[00001F88] 2023-09-28 14:45:20 --> InstallWFPCallout

[00001F88] 2023-09-28 14:45:20 --> GetWFPCalloutInfFilePath

[00001F88] 2023-09-28 14:45:20 lpFilename = C:\Program Files\Npcap\NPCAP_wfp.inf

[00001F88] 2023-09-28 14:45:20 <-- GetWFPCalloutInfFilePath

[00001F88] 2023-09-28 14:45:20 --> isFileExist

[00001F88] 2023-09-28 14:45:20 FindFirstFile: succeed, szFileFullPath = C:\Program Files\Npcap\NPCAP_wfp.inf.

[00001F88] 2023-09-28 14:45:20 <-- isFileExist

[00001F88] 2023-09-28 14:45:20 LaunchINFSectionEx: executing, szCmd = C:\Program Files\Npcap\NPCAP_wfp.inf,DefaultInstall,,36,N.

[00001F88] 2023-09-28 14:45:20 <-- InstallWFPCallout

[00001F88] 2023-09-28 14:45:20 <-- _tmain: succeed, nStatus = 0.

[00002E4C] 2023-09-28 14:45:21 --> wmain

[00002E4C] 2023-09-28 14:45:21 _tmain: executing, argv[1] = -n.

[00002E4C] 2023-09-28 14:45:21 _tmain: executing, argv[2] = -i2.

[00002E4C] 2023-09-28 14:45:21 --> InstallDriver

[00002E4C] 2023-09-28 14:45:21 --> GetServiceInfFilePath

[00002E4C] 2023-09-28 14:45:21 lpFilename = C:\Program Files\Npcap\NPCAP.inf

[00002E4C] 2023-09-28 14:45:21 <-- GetServiceInfFilePath

[00002E4C] 2023-09-28 14:45:21 --> InstallSpecifiedComponent

[00002E4C] 2023-09-28 14:45:21 --> HrGetINetCfg

[00002E4C] 2023-09-28 14:45:21 CoCreateInstance: error, hr = 0x8007045a.

[00002E4C] 2023-09-28 14:45:21 <-- HrGetINetCfg

[00002E4C] 2023-09-28 14:45:21 Error 0x8007045a: Couldn't the get notify object interface.

Possible cause:

Failed to initalize DLL (DLL).

Apart from it, there are very little diagnostic messages I was able to find on my machine, but here they are

Wireguard app logs

2023-10-02 13:48:56.797: [TUN] [koldi-desktop] Starting WireGuard/0.5.3 (Windows 10.0.19045; amd64)

2023-10-02 13:48:56.797: [TUN] [koldi-desktop] Watching network interfaces

2023-10-02 13:48:56.799: [TUN] [koldi-desktop] Resolving DNS names

2023-10-02 13:48:56.799: [TUN] [koldi-desktop] Creating network adapter

2023-10-02 13:48:56.876: [TUN] [koldi-desktop] Using existing driver 0.10

2023-10-02 13:48:56.883: [TUN] [koldi-desktop] Creating adapter

2023-10-02 13:49:11.897: [TUN] [koldi-desktop] Timed out waiting for device query: Operation timeout. (Code 0x00000102)

2023-10-02 13:49:11.897: [TUN] [koldi-desktop] Failed to setup adapter (problem code: 0x38, ntstatus: 0x0): Device not ready. (Code 0x000010DF)

2023-10-02 13:49:11.910: [TUN] [koldi-desktop] Unable to create network adapter: Error creating adapter: The device is not ready for use.

2023-10-02 13:49:11.910: [TUN] [koldi-desktop] Shutting down

2023-10-02 13:49:11.911: [MGR] [koldi-desktop] Tunnel service tracker finished

Windows Event Viewer logs

10/2/2023 1:48:56 PM - Information A service was installed in the system.Service Name: WireGuard Tunnel: koldi-desktop

Service File Name: "C:\Program Files\WireGuard\wireguard.exe" /tunnelservice "C:\Program Files\WireGuard\Data\Configurations\koldi-desktop.conf.dpapi"

10/2/2023 1:48:56 PM - Error The Network Setup service terminated unexpectedly. It has done this 6 time(s).

10/2/2023 1:49:11 PM - Error The WireGuard Tunnel: koldi-desktop service terminated with the following service-specific error:

The system cannot find the path specified.

I am starting to lose hope, any help would be very much appreciated.

  • Winword скачать бесплатно для windows 10
  • Wireguard mikrotik server windows client
  • Winver windows 10 что это
  • Winzip для windows 10 скачать бесплатно на русском языке скачать бесплатно
  • Winusb device драйвер windows 7 xerox