User Tools

Site Tools


computers:firewall_configuration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computers:firewall_configuration [2011/08/31 12:33] chkuocomputers:firewall_configuration [2020/08/16 00:13] (current) – [References] chkuo
Line 5: Line 5:
 net.ipv4.ip_forward=1 net.ipv4.ip_forward=1
 </code> </code>
 +Apply by ''sudo sysctl -p''
  
 Then add the following lines to ''/etc/rc.local'' (so the rule is enabled on reboot): Then add the following lines to ''/etc/rc.local'' (so the rule is enabled on reboot):
Line 12: Line 13:
 Ext_IF="eth0" Ext_IF="eth0"
 Ext_IP="1.1.1.1" Ext_IP="1.1.1.1"
-Int_IF="eth3+Int_IF="eth1
-Int_Net="192.168.1.0/16"+Int_Net="192.168.1.0/24"
 iptables -t nat -A POSTROUTING -s $Int_Net -o $Ext_IF -j SNAT --to-source $Ext_IP iptables -t nat -A POSTROUTING -s $Int_Net -o $Ext_IF -j SNAT --to-source $Ext_IP
 iptables -A FORWARD -s $Int_Net -o $Ext_IF -j ACCEPT iptables -A FORWARD -s $Int_Net -o $Ext_IF -j ACCEPT
Line 40: Line 41:
 ===== References ===== ===== References =====
   * [[https://help.ubuntu.com/10.04/serverguide/C/firewall.html]]   * [[https://help.ubuntu.com/10.04/serverguide/C/firewall.html]]
 +  * [[https://www.networkreverse.com/2020/06/how-to-build-linux-router-with-ubuntu.html]]
computers/firewall_configuration.1314765203.txt.gz · Last modified: 2011/08/31 12:33 by chkuo