Cấu hình và sử dụng WireGuard VPN trên Ubuntu

WireGuard

1. Cấu hình WireGuard Server

B1: Cài đặt WireGuard

B2: Tạo key (server)

Sau đó sẽ có 2 file server_private.key và server_public.key

B3: Tạo config server với file /etc/wireguard/wg0.conf

PrivateKey: là lấy từ file server_private.key

B4: Bật IP Forward

Bỏ comment “net.ipv4.ip_forward=1” trong file /etc/sysctl.conf

Sau đó dung lệnh sau để áp dụng

B5: Start WireGuard

Enable auto luôn cho phần này

B6: Tạo key client

B7: Thêm client vào server, từ đó client dung cert này có thể thực hiện VPN được

PublicKey: là giá trị của file client_public.key

B8: khởi động lại kết nối

2. Cấu hình Client

B1: Chọn Add empty tunnel để tạo 1 tunnel

B2: Cấu hình file > Save

PrivateKey: là CLIENT_PRIVATE_KEY

PublicKey: là SERVER_PUBLIC_KEY

B4: thử kết nối

Leave a Reply

Your email address will not be published. Required fields are marked *