Saturday 4 December 2021

677.0 Hướng dẫn sửa lổi không thể kết nối L2TP/IPSEC trên windows /Configuring L2TP/IPSec VPN Connection Behind a NAT, VPN Error Code 809

 Nguồn: http://woshub.com/l2tp-ipsec-vpn-server-behind/


Configuring L2TP/IPSec VPN Connection Behind a NAT, VPN Error Code 809

Due to disabling PPTP VPN support in iOS, one of my clients decided to reconfigure the VPN server running Windows Server 2012 R2 from PPTP to L2TP/IPSec. Internal VPN clients from inside LAN connect to the VPN server without any problems, however external Windows clients get the error 809 when trying to establish the connection with the L2TP VPN server:

Can’t connect to L2TP-IPsec-VPN-Server.hostname

The network connection between your computer and the VPN server could not be established because the remote server is not responding. This could be because one of the network devices (e.g. firewalls, NAT, routers, etc) between your computer and the remote server is not configured to allow VPN connections. Please contact your Administrator or your service provider to determine which device may be causing the problem.

Can’t connect to L2TP-IPsec-VPN-Server

In other Windows versions, the connection errors 800, 794 or 809 may indicate the same problem.

It is worth to note that the VPN server is behind a NAT, and the router is configured to forward L2TP ports:

  • UDP 1701 — Layer 2 Forwarding Protocol (L2F) & Layer 2 Tunneling Protocol (L2TP)
  • UDP 500
  • UDP 4500 NAT-T – IPSec Network Address Translator Traversal
  • Protocol 50 ESP

These ports are also open in the Windows Firewall rules for VPN connection. Those, the classic configuration is used. The built-in Windows VPN client is used for connection.

If you connect to the same VPN server via PPTP, the connection is successfully established.

VPN Error 809 for L2TP/IPSec on Windows behind NAT

As it turned out, the problem is already known and described in the article https://support.microsoft.com/en-us/kb/926179. The Windows built-in VPN client doesn’t support by default L2TP/IPsec connections through NAT. This is because IPsec uses ESP (Encapsulating Security Payload) to encrypt packets, and ESP doesn’t support PAT (Port Address Translation). If you want to use IPSec for communication, Microsoft recommends using public IP addresses on the VPN server.

But there is also a workaround. You can fix this drawback by enabling support for the NAT-T protocol, which allows you to encapsulate ESP 50 packets in UDP packets on port 4500. NAT-T is enabled by default in almost all operating systems (iOS, Android, Linux) except Windows.

If the L2TP/IPsec VPN server is behind a NAT device, in order to connect external clients through NAT correctly, you have to make some changes to the registry both on the server and client side to allow UDP packet encapsulation for L2TP and NAT-T support in IPsec.

  • Open the Registry Editor (regedit.exe) and go to the following registry key:
    • Windows 10/8.1/Vista  and Windows Server 2016/2012R2/2008R2 — HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent
    • Windows XP/Windows Server 2003 — HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IPSec
  • Create a DWORD parameter with the name AssumeUDPEncapsulationContextOnSendRule and the value 2;AssumeUDPEncapsulationContextOnSendRule registry key
    Note. Possible AssumeUDPEncapsulationContextOnSendRule values are:
    • 0 – (a default value) suggests that the server is connected to the Internet without NAT;
    • 1 – the VPN server is behind a NAT device ;
    • 2 — both VPN server and client are behind a NAT.
  • Just restart your computer and make sure that the VPN tunnel is established successfully
[alert] If both Windows VPN server and client are behind NAT, you need to change this setting on both devices.

Also, you can use a PowerShell cmdlet to make changes to the registry:

Set-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Services\PolicyAgent" -Name "AssumeUDPEncapsulationContextOnSendRule" -Type DWORD -Value 2 –Force;

After enabling NAT-T support, you will be able to successfully connect to the VPN server from the client through NAT (including double NAT).

In some cases, for VPN to work properly, you need to enable an additional firewall rule for TCP 1701 (in some L2TP implementations, this port is used in conjunction with UDP 1701).
NAT-T didn’t work correctly in earlier Windows 10 builds, for example, 10240, 1511, 1607. If you have an older Windows version, we recommend you to upgrade the Windows 10 build.

Multiple L2TP VPN Connections from the same LAN

There is another interesting VPN bug. If your local network has several Windows computers, you cannot establish more than one simultaneous connection to an external L2TP/IPSec VPN server. If you try to connect to the same VPN server from another computer (with an active VPN tunnel from different device), error code 809 or 789 will appear:

Error 789: The L2TP connection attempt failed because the security layer encountered a processing error during initial negotiations with the remove computer.
Interestingly, this problem only occurs on Windows devices. On Linux/MacOS/Android devices on the same local network, there are no such problems. You can easily connect to the VPN L2TP server from multiple devices at the same time.

According to TechNet, the issue is related to incorrect implementation of the L2TP/IPSec client on Windows (not fixed for many years).

To fix this bug, you need to change two registry parameters in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters registry key and restart your computer:

  • AllowL2TPWeakCrypto – change to 00000001 (allows weak encryption algorithms, for L2TP/IPSec the MD5 and DES algorithms are used);
  • ProhibitIPSec – change to 00000000 (enables IPsec encryption, which is often disabled by some VPN clients or system tools).

AllowL2TPWeakCrypto and ProhibitIpSec for l2tp ipsec vpn connection behind a NAT on Windows

Run the following command to change apply these registry changes:

reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Rasman\Parameters" /v AllowL2TPWeakCrypto /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Rasman\Parameters" /v ProhibitIpSec /t REG_DWORD /d 0 /f

This enables support for concurrent L2TP/IPSec VPN connections on Windows through a shared public IP address (works on all versions from Windows XP to Windows 10). 

 

Friday 4 June 2021

676. Mùa covid, doanh số, tiền thưởng bị giảm, đã vậy mà bị mất tiền thì .. thua...

 676. Mùa covid, doanh số, tiền thưởng bị giảm, đã vậy  mà bị mất tiền thì .. thua...

Vậy là cơn địa chấn rung rinh mặt đất năm châu, bốn bể mang tên “ Đại dịch Covid19” do “em”  virus Corona  hình vương miện kiêu kỳ làm bao quốc gia hùng mạnh về tất cả các nguồn lực như Mỹ, Anh, Pháp, đức phải khốn đốn đã kéo dài đến na, tháng 05/2021, đã được hai năm.

Về ảnh hưởng từ  công nàng Corona virus này thì chắc ai cũng thấy, ai bị bị ảnh hưởng theo xu hướng Domino tương hỗ.  Khó khan chung là vậy, những tưởng các doanh nghiệp, các bậc đàn anh đi trước của mình  sẽ hổ trợ đàn em, cùng nhau vượt qua khó khan chung, nhưng thật đáng tiếc. điều đó chỉ có trong… sách hoặc trên TV thì phải nhỉ ? Và cũng thật bất ngờ hơn khi   tinh thần nhiệt huyết, hết mình của vì khách hàng của tui lại bị họ lợi dụng, “hốt” luôn những đồng tiền còm cõi của tui  trong mua dịch này, hic Nghĩ mà nó chàn gì đâu á!

Số là tui có ông khách tên ông Đinh Thế Tân ( “Ông Tân”),  làm ngành may mặc ( Garment) cũng làm chung được mấy năm, từ  thời ổng làm CEO ở  Công Ty TNHH May Xuất Khẩu xxxxxxxxx, quê ở Huyện Đông Hưng, Tỉnh Thái Bình.

 

Từ  đâu năm 2019 thì phải, không thấy liên hệ. Đại dịch thì ai cũng ở nhà, mặc quần đùi, có khi khỏi mặc gì cho mát ấy chứ 😊, nên chuyện ngành may mặc gặp khó khan là đương nhiên thôi. Đo đó  cả năm cũng không muốn liên hệ lại với khách là vậy.

Bẵng đi chừng 1 năm không liên hệ, ngày 23 /03 /2021, tự nhiên  khách liên hệ lại. Làm sales, khách liên hệ thì mứng thấy bà nội, với lại từ đầu năm  đến  hết tháng 04/2021 (30/04/2021) tình hỉnh cũng khả quan nên cũng không nghi ngờ gì. Ai ngờ.. hức, đúng là các cụ nói không có sai tí nào “ Họa hổ, họa bì nan họa cốt. Tri nhân, tri diện, bất tri tâm”, “Ngày vui ngắn chẳng tày gang”, rồi cái gì tự nhiên đến rốt và dồn dập thì phải coi chừng.. hic hic nạn nhân lại là tui.. Khách booking, đi hàng nhưng đến phần thanh toán thì chơi bài .. tình lơ. Tui đòi nợ thiếu điều muốn lạy ảnh mà ảnh vẫn.. “Trơ gan cùng tuế nguyệt”. Tìm đế Linkedin của ảnh để chat thì bị ảnh.. block nên nản quá, tình bõ cuộc, đền tiền cho công ty. Cũng may cho tui là sếp công ty cũng biết chuyện nên share một phần lỗ cho tui.

Mọi chuyển tưởng chừng dừng lại ở đó, tuy nhiên “đen” cho anh khách tên Tân này là đụng phải sế[ tui – Người cực kỳ ghét những người làm ăn cà chớn, chưa làm mà đã muốn giựt tiền của người khác, gian manh… etc. Sếp tui nói với mị người trong công ty “Số tiền đó không đáng nhưng những loại  người kiểu  đó thì nên cho họ một bài học về sự song phẳng trong kinh doanh, cảnh báo các doanh nghiệp trong ngành khác để  để họ cẩn thận”, và yêu cầu các team liên quan tiến hành các biện pháp pháp lý theo quy định của pháp luật. Sau khi gởi Đơn Tố giác và một số văn bản đến quê nhà của ông Tân, ảnh lật đật liên hệ cty để trả tiền nhưng cũng xảo biện vớt vát kiểu “ Anh bận quá nên không đọc tin nhắn, email”, thiệt tình !!

Dù gì chuyện cũng xong, thôi, cũng mong sau này ảnh mần ăn đoàng hoàng hơn !

 

dinhthetan@gmail.com

john@speedup.com.vn


 https://drive.google.com/drive/folders/126LlyXvAChK2buqN6NVL5_l6Ie9QsKK-?usp=sharing

 


Friday 26 February 2021

675.0 Cách chặn quảng cáo trên Facebook giao điện mới ( Block Facebook Ads on new GUI)

 

FB giao diện mới giờ họ quảng cáo ghê quá, phải nói là kiểu dội bom ấy! Cho nên không còn cách nào khác, dành phải thêm filter và lọc bớt vậy !
Copy filter bên dưới, thêm vào các add-in phổ biến như Adblock, adblock plus, Adguard, uBlock Origin... etc
 
facebook.com##div[role="feed"] > div[data-pagelet^="FeedUnit"] div > span > span > a > span:upward(div[data-pagelet^="FeedUnit"])

--Nếu bộ lộc trên không thể hoạt động, thêm 2 bộ lọc bên dưới. Reason xem chi tiết remark

facebook.com###facebook div[role="feed"] div > span > span > a > span > span[aria-label="Sponsored"]:upward(div[role="feed"] > div)

facebook.com###facebook div[role="feed"] div > span > span > a > span[aria-label="Sponsored"]:upward(div[role="feed"] > div)
 
Nguồn:  https://www.reddit.com/r/uBlockOrigin/comments/ko5s8c/fuck_facebook_heres_how_to_block_new_ads/
 

Add this to your filters

facebook.com##div[data-pagelet^="FeedUnit"]:has(a:has-text(/^S[a-zA-Z0-9]*p[a-zA-Z0-9]*o[a-zA-Z0-9]*n[a-zA-Z0-9]*s[a-zA-Z0-9]*o[a-zA-Z0-9]*r[a-zA-Z0-9]*e[a-zA-Z0-9]*d/))

you can't use has-text(Sponsored) because facebook purposefully adds random characters to obfuscate the word "Sponsored" like

tl1tfSp5honsoresd
tSnhSppoonncscsrornomgeedrded
98% Upvoted
Log in or sign up to leave a commentLog InSign Up
Sort by
level 1

Try the rule below for the redesigned FB. This rule does not look for the word "Sponsored", it looks for a particular HTML structure that Sponsored posts have. This rule only works in the News Feed page only. ATM, this rule works quite well:

facebook.com##div[role="feed"] > div[data-pagelet^="FeedUnit"] div > span > span > a > span:upward(div[data-pagelet^="FeedUnit"])


If that doesn't work on the redesigned FB, then try the following two rules. The reason the above rule isn't working for some users is because FB might be serving a different version of the HTML code based on your region/language or some other reason. The following rules look for a certain attribute having the word "Sponsored", but must be in a certain HTML structure:

facebook.com###facebook div[role="feed"] div > span > span > a > span > span[aria-label="Sponsored"]:upward(div[role="feed"] > div)

facebook.com###facebook div[role="feed"] div > span > span > a > span[aria-label="Sponsored"]:upward(div[role="feed"] > div)

 

 

679.0 Hướng dẫn cài đặt AD RMS server ( Active Directory Rights Management Services) có trong Windows Server 2012.

Nguồn: https://mdungblog.wordpress.com/2018/06/21/simple-guide-huong-dan-cai-dat-ad-rms-windows-server-2012-r2/   Hôm nay mình xin giới thiệ...