Ufw: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Mernits (talk | contribs)
No edit summary
Mernits (talk | contribs)
No edit summary
Line 1: Line 1:
=Maskeraadi loomine ufw abil=
Lubame ''ufw''
<source lang="bash">
<source lang="bash">
sudo ufw enable
sudo ufw enable
sudo ufw allow 22
sudo ufw allow 22
</source>
</source>
/etc/default/ufw
Muudame failis ''/etc/default/ufw'' pakettide edastamise reegli lubavaks
<source lang="bash">
<source lang="bash">
DEFAULT_FORWARD_POLICY="ACCEPT"
DEFAULT_FORWARD_POLICY="ACCEPT"
</source>
</source>


Määrame ruutimise
/etc/ufw/sysctl.conf
/etc/ufw/sysctl.conf
<source lang="bash">
<source lang="bash">
Line 14: Line 19:
</source>
</source>


Seame maskeraadi
/etc/ufw/before.rules
/etc/ufw/before.rules
<source lang="bash">
<source lang="bash">
Line 27: Line 33:
</source>
</source>


Teeme teenusele taaskäivituse
<source lang="bash">
<source lang="bash">
sudo ufw disable && sudo ufw enable
sudo ufw disable && sudo ufw enable
</source>
</source>

Revision as of 21:28, 16 February 2011

Maskeraadi loomine ufw abil

Lubame ufw

sudo ufw enable
sudo ufw allow 22

Muudame failis /etc/default/ufw pakettide edastamise reegli lubavaks

DEFAULT_FORWARD_POLICY="ACCEPT"

Määrame ruutimise /etc/ufw/sysctl.conf

net.ipv4.ip_forward=1
net.ipv6.conf.default.forwarding=1

Seame maskeraadi /etc/ufw/before.rules

# nat Table rules
*nat
:POSTROUTING ACCEPT [0:0]

# Forward traffic from eth1 through eth0.
-A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

# don't delete the 'COMMIT' line or these nat table rules won't be processed
COMMIT

Teeme teenusele taaskäivituse

sudo ufw disable && sudo ufw enable