Skip to content
/ sNAT Public

PAT(Port Address Translation) linux kernel module

Notifications You must be signed in to change notification settings

timsong1/sNAT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

sNAT

A Linux kernel module for Network Address Translation (NAT)

Features

  • Supports Source NAT (SNAT) and Destination NAT (DNAT)
  • Implements Port Address Translation (PAT)
  • Handles TCP, UDP and ICMP packet translation

Building and Loading

Complie the module

make

Clean build

make clean

Load the module

sudo insmod NAT.ko

Unload the module

sudo rmmod NAT

View current settings

The module leverages procfs(Process Filesystem) to provide runtime configuration without reloading the kernel module

cat /proc/NAT/ip
cat /proc/NAT/timeout
cat /proc/NAT/start

Change settings

Set WAN IP

echo "xxx.xxx.x.xxx" | sudo tee /proc/NAT/ip

Adjust connection timeout

echo "120" | sudo tee /proc/NAT/timeout

Enable NAT

echo "1" | sudo tee /proc/NAT/start

Disable NAT

echo "0" | sudo tee /proc/NAT/start

About

PAT(Port Address Translation) linux kernel module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published