Skip to content
Nhan Le

Nhan Le

Technology Information

  • Home
  • Security
  • Blogs

Kiểm tra băng thông kết nối

Posted on November 6, 2023 By admin 146 Comments on Kiểm tra băng thông kết nối
Uncategorized

– Bước 1:  Thực hiện cài đặt hoặc download-only file iperf vào các máy linux

apt install iperf
apt –download-only –assume-yes install iperf

– Bước 2:  Khởi tạo Server iperf để thực hiện nhận kết nối, mặc định ở port 5001
iperf -s

– Bước 3:  Từ máy client thực hiện tạo kết nối để kiểm tra
iperf -c 10.100.0.1 -p 5001

– Từ máy client thử kết nối nhiều luồng
iperf -c 10.100.0.1 -P 8 -t 30 -w 32768 -f g

Mô tả một số thông số cơ bản
-b: bandwidth
-P: số luồng kết nối đồng thời
-t: xác định thời gian kiểm tra. Mặc định sử dụng là 10 giây
-w: tăng TCP window sizie
-f: hiển thị là Gbps

INOTIFY

Posted on November 25, 2022November 25, 2022 By admin
Security

– Bước 1: Cài đặt chương trình “inotify-tools” vào máy Ubuntu hoặc Kali Linux. Sau khi cài đặt xong ta sẽ thấy xuất hiện hai chương trình con là inotifywait và inotifywatch

┌──(root㉿kali)-[~]

└─# apt install inotify-tools

– Bước 2:Thiết lập cho chương trình tăng mức xử lý file

┌──(root㉿kali)-[/proc/sys/fs/inotify]

└─# vim /etc/sysctl.conf

fs.inotify.max_queued_events = 16384

fs.inotify.max_user_instances = 1024

fs.inotify.max_user_watches = 1048576

┌──(root㉿kali)-[/proc/sys/fs/inotify]

└─# sysctl -p

fs.inotify.max_queued_events = 16384

fs.inotify.max_user_instances = 1024

fs.inotify.max_user_watches = 1048576

┌──(root㉿kali)-[/proc/sys/fs/inotify]

└─# cat max_queued_events max_user_instances max_user_watches

16384

1024

1048576

– Bước 3: Thiết lập cho chương trình đọc file. Ví dụ bên dưới là chương trình đang đọc file ở trong thư mục /tmp của máy linux

┌──(root㉿kali)-[/proc/sys/fs/inotify]

└─# inotifywait -mrq -e modify,create,delete /tmp 

-m: modify

-q: quite

-r: recursive

Docker Wireguard VPN

Posted on November 2, 2022November 25, 2022 By admin
Docker Wireguard VPN
Docker, VPN

Trong bài hướng dẫn này mình sẽ hướng dẫn mọi người thiết lập Docker Wireguard VPN dựa trên nền tảng công nghệ Docker. Thông qua hướng dẫn bên dưới ta có thể triển khai nhanh máy chủ VPN Server dùng để truy cập vào trong hệ thống mạng nội bộ.

– Bước 1: Chuẩn bị máy chủ ảo Ubuntu server đóng vai trò là docker hosts và cài đặt docker container

root@nhanle:~# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION=”Ubuntu 20.04.3 LTS”

root@nhanle:~# uname -r
5.4.0-94-generic

root@nhanle:~# sudo apt update
root@nhanle:~# sudo apt install apt-transport-https ca-certificates curl software-properties-common
root@nhanle:~# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
root@nhanle:~# sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable”
root@nhanle:~# sudo apt-cache policy docker-ce
root@nhanle:~# sudo apt install docker-ce docker-compose

– Bước 2: Thực hiện tạo file cấu hình “docker-compose.yml” cho dịch vụ Wireguard VPN

nhanle@gitlab:/opt$ sudo mkdir /opt/WireGuard
nhanle@gitlab:/opt$ sudo vim docker-compose.yml

version: “3.8”
services:
  wg-easy:
    environment:
      # Phần nội dung phải khai báo
      # Khai báo tên miền wireguard
      – WG_HOST=nhanlan.me
      # Tùy chỉnh lại
      – PASSWORD=password
      # – WG_PORT=51820
      # – WG_DEFAULT_ADDRESS=10.8.0.x
      # – WG_DEFAULT_DNS=1.1.1.1
      # – WG_ALLOWED_IPS=192.168.15.0/24, 10.0.1.0/24
    image: weejewel/wg-easy
    container_name: wg-easy
    volumes:
      – .:/etc/wireguard
    ports:
      – “51820:51820/udp”
      – “51821:51821/tcp”
    restart: unless-stopped
    cap_add:
      – NET_ADMIN
      – SYS_MODULE
    sysctls:
      – net.ipv4.ip_forward=1
      – net.ipv4.conf.all.src_valid_mark=1
– Bước 3: Thực hiện khởi động Wireguard VPN và thực hiện một số câu lệnh kiểm tra nội dung
root@gitlab:/opt/WireGuard# docker-compose up –detach
root@gitlab:/opt/WireGuard# docker image ls | grep wg-easy
root@gitlab:/opt/WireGuard# docker-compose images

– Bước 4: Truy cập vào đường link web quản trị  Wireguard VPN “http://nhanle.local:51821” và thực hiện tạo profile cho người dùng

Recent Posts

  • Kiểm tra băng thông kết nối
  • INOTIFY
  • Docker Wireguard VPN

Recent Comments

  1. artane castle hairdressers on Kiểm tra băng thông kết nối
  2. where to buy cheap toradol price on Kiểm tra băng thông kết nối
  3. zanaflex used for on Kiểm tra băng thông kết nối
  4. periactin amazon on Kiểm tra băng thông kết nối
  5. can you buy generic ketorolac pill on Kiểm tra băng thông kết nối

Archives

  • November 2023
  • November 2022

Categories

  • Docker
  • Security
  • Uncategorized
  • VPN

  • Home
  • Security
  • Blogs

Copyright © 2025 Nhan Le.

Theme: Oceanly by ScriptsTown