Quickstart Guide
This guide will help you set up a working paqet proxy quickly.Prerequisites
libpcap development libraries must be installed on both the client and server machines.- Linux: No prerequisites - binaries are statically linked
- macOS: Comes pre-installed with Xcode Command Line Tools. Install with
xcode-select --install - Windows: Install Npcap. Download from npcap.com
Setup Steps
Download the Binary
Download the pre-compiled binary for your client and server operating systems from the Releases page.Make the binary executable:
You will need root privileges to use raw sockets.
Find Your Network Details
You’ll need to find your network interface name, local IP, and the MAC address of your network’s gateway (router).On Linux:
- Find Interface and Local IP: Run
ip a. Look for your primary network card (e.g.,eth0,ens3). Its IP address is listed underinet. - Find Gateway MAC:
- First, find your gateway’s IP:
ip r | grep default - Then, find its MAC address with
arp -n <gateway_ip>(e.g.,arp -n 192.168.1.1)
- First, find your gateway’s IP:
- Find Interface and Local IP: Run
ifconfig. Look for your primary interface (e.g.,en0). Its IP is listed underinet. - Find Gateway MAC:
- First, find your gateway’s IP:
netstat -rn | grep default - Then, find its MAC address with
arp -n <gateway_ip>(e.g.,arp -n 192.168.1.1)
- First, find your gateway’s IP:
- Find Interface and Local IP: Run
ipconfig /alland note your active network adapter (Ethernet or Wi-Fi):- Its IP Address
- The Gateway IP Address
- Find Interface device GUID: Windows requires the Npcap device GUID. In PowerShell, run
Get-NetAdapter | Select-Object Name, InterfaceGuid. Note the Name and InterfaceGuid of your active network interface, and format the GUID as\Device\NPF_{GUID}. - Find Gateway MAC Address: Run:
arp -a <gateway_ip>. Note the MAC address for the gateway.
Configure Critical Firewall Rules
Although packets are handled at a low level, the OS kernel can still see incoming packets on the connection port and generate TCP RST packets. These kernel generated resets can corrupt connection state in NAT devices and stateful firewalls, causing instability, packet drops, and premature termination.You must configure
iptables on the server to prevent the kernel from interfering.Run these commands as root on your server:These rules ensure that only the application handles traffic for the connection port.
Configure the Client
Create a
config.yaml file for your client:The client acts as a SOCKS5 proxy server, accepting connections from applications and dynamically forwarding them through the raw TCP packets to any destination.
Test the Connection
Once the client and server are running, test the SOCKS5 proxy:This request will be proxied over raw TCP packets to the server, and then forwarded according to the client mode configuration. The output should show your server’s public IP address, confirming the connection is working.
Troubleshooting
If you encounter issues:- Permission Denied: Ensure you are running with
sudo. - Connection Times Out:
- Transport Configuration Mismatch: Ensure
transport.kcp.keyis exactly identical on client and server iptablesRules: Did you apply the firewall rules on the server?- Incorrect Network Details: Double-check all IPs, MAC addresses, and interface names.
- Cloud Provider Firewalls: Ensure your cloud provider’s security group allows TCP traffic on your
listen.addrport. - NAT/Port Configuration: For servers, ensure
listen.addrandnetwork.ipv4.addrports match. For clients, use port0innetwork.ipv4.addrfor automatic port assignment to avoid conflicts.
- Transport Configuration Mismatch: Ensure
- Use
pinganddump: Usepaqet ping -c config.yamlto test the connection. Usepaqet dump -p <PORT>on the server to see if packets are arriving.
Next Steps
Installation Guide
Detailed installation instructions for all platforms
Configuration Reference
Complete configuration documentation