Mainos / Advertisement:

Ero sivun ”RouterOS Firewall/en” versioiden välillä

Kohteesta Taisto
Siirry navigaatioon Siirry hakuun
(Ak: Uusi sivu: We block invalid connections from going through the router.)
(Ak: Uusi sivu: Next we select the ICMP protocol, the so called ''ping'' protocol. This allows the routed to be pinged with a client device, which is connected to the Mikrotik. Useful for troubles...)
Rivi 48: Rivi 48:
 
</gallery>
 
</gallery>
  
Seuraavaksi sallitaan ICMP prokolola, eli ns. ping protokola. Tämä mahdollistaa että reitittimeen voidaan pingata toisella päätelaitteella, joka on verkkoyhteydessä Mikrotikin kanssa.
+
Next we select the ICMP protocol, the so called ''ping'' protocol. This allows the routed to be pinged with a client device, which is connected to the Mikrotik. Useful for troubleshooting.
  
 
   /ip firewall filter add chain=input protocol=icmp action=accept
 
   /ip firewall filter add chain=input protocol=icmp action=accept

Versio 21. elokuuta 2015 kello 07.13

Muut kielet:
English • ‎suomi

With the firewall we can filter packages and enable other kinds of security options, which either block or allow access to the network / router. Used in unison with a NAT, this significantly helps in blocking unauthorized outside access to your internal network.

RouterOS firewall mainly follows the same logic as Linux when it comes to Iptables.

Firewall settings are in the RouterOS system:

 /ip firewall

Filter Rules

With filter rules you can limit the transmission of packages to the router or through the router. Note, that in the RouterOS operating system firewall rules are created from the top down.

Basic firewall

In our example we create a secure and basic RouterOS firewall which suits the needs of all basic users.

First we create a new allow rule, which always allows connecting to the router from whatever network and with whatever protocol. You should do this in order to not accidentally lock yourself outside of the router while you work.

 /ip firewall filter add chain=input action=accept

We create a second firewall rule which allows traffic through the router. The connection must be trusted though.

 /ip firewall filter add chain=forward  connection-state=established,related action=accept 

We block invalid connections from going through the router.

 /ip firewall filter add chain=forward connection-state=invalid action=drop

Next we select the ICMP protocol, the so called ping protocol. This allows the routed to be pinged with a client device, which is connected to the Mikrotik. Useful for troubleshooting.

 /ip firewall filter add chain=input protocol=icmp action=accept

Seuraavaksi luodaan sääntö joka estää ether1 (WAN) portista sisällepäin tulevan liikenteen.

 /ip firewall filter add chain=input in-interface=ether1 action=drop

Nyt on valmiina peruspalomuuriasetukset. Palomuuri toimii ylhäältä alaspäin (0 ->) listan mukaisesti. Oletuksena on aina sallitaan jos ei toisin mainita.

 /ip firewall filter print

Estä hallintaporteihin pääsy ulkoverkosta

Estetään ulkoverkosta pääsy hallintaportteihin 21, 22, 23, 80 ulkoverkosta. Tämä suojaa Mikrotikkiä ettei ulkopuolinen pääse laitteeseen käsiksi helpolla.

 /ip firewall filter add chain=input protocol=tcp dst-port=21,22,23,80 in-interface=ether1 action=drop

NAT

NAT:ista meillä on oma artikkeli: RouterOS NAT

Mangle

Mangle:n avulla voit merkata paketit erityisellä merkillä. Voit lisätä merkin pakettiin ja käyttää esimerkiksi Queue:ssa, NAT:issa ja reitittämisessä. Mangle:n merkit ovat vain nykyisen reitittimen merkkejä, eli niitä ei lähetetä verkossa eteenpäin.

Marking Packets

Merkataan esimerkiksi interface:n ether1-gateway:n portissa 80 menevät paketit.

 /ip firewall mangle add chain=forward protocol=tcp dst-port=80 in-interface=ether1-gateway action=mark-packet new-packet-mark=HTTP

Aiheeseen liittyvää

Lähteet

http://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Filter http://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Mangle

Mainos / Advertisement: