Difference between revisions of "Debian as router"

From RHS Wiki
Jump to navigation Jump to search
(Created page with "# Make a debian box roter ## Enable routing Temporal sudo sysctl -w net.ipv4.ip_forward=1 # Permanent sudo nano /etc/sysctl.conf net.ipv4.ip_forward = 1 ## Create NA...")
 
Line 1: Line 1:
# Make a debian box roter  
+
= Make a debian box roter =
## Enable routing
+
== Enable routing ==
 
Temporal
 
Temporal
 
  sudo sysctl -w net.ipv4.ip_forward=1 #  
 
  sudo sysctl -w net.ipv4.ip_forward=1 #  
Line 8: Line 8:
 
     net.ipv4.ip_forward = 1
 
     net.ipv4.ip_forward = 1
  
## Create NAT rule at IPTABLES
+
== Create NAT rule at IPTABLES ==
 
  sudo iptables -t nat -A POSTROUTING -s 15.17.170.215/32 -o tun0 -j MASQUERADE
 
  sudo iptables -t nat -A POSTROUTING -s 15.17.170.215/32 -o tun0 -j MASQUERADE
  
## List iptables nat rules
+
== List iptables nat rules ==
 
  sudo iptables -t nat -L -n -v
 
  sudo iptables -t nat -L -n -v

Revision as of 11:09, 8 October 2018

Make a debian box roter

Enable routing

Temporal

sudo sysctl -w net.ipv4.ip_forward=1 # 

Permanent

sudo nano /etc/sysctl.conf
   net.ipv4.ip_forward = 1

Create NAT rule at IPTABLES

sudo iptables -t nat -A POSTROUTING -s 15.17.170.215/32 -o tun0 -j MASQUERADE

List iptables nat rules

sudo iptables -t nat -L -n -v