Mikrotik
(Różnice między wersjami)
(→W odpowiednie miejsca należy wpisać odpowiednie dane (loginy, hasła, adresy IP)) |
|||
| Linia 5: | Linia 5: | ||
===Skrypt=== | ===Skrypt=== | ||
W odpowiednie miejsca należy wpisać odpowiednie dane (loginy, hasła, adresy IP) | W odpowiednie miejsca należy wpisać odpowiednie dane (loginy, hasła, adresy IP) | ||
| − | <pre> | + | <pre>/interface pppoe-server server |
| − | + | add authentication=chap default-profile=default disabled=no interface=wlan14 \ | |
| − | + | keepalive-timeout=10 max-mru=1480 max-mtu=1480 max-sessions=0 mrru=\ | |
| − | + | disabled one-session-per-host=yes service-name=testowy | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
/ppp profile | /ppp profile | ||
| − | set 0 | + | set 0 address-list="" !bridge !bridge-path-cost !bridge-port-priority \ |
| − | + | change-tcp-mss=yes !dns-server !idle-timeout !incoming-filter \ | |
| − | + | local-address=IP_MIKROTIKA name=default only-one=default !outgoing-filter \ | |
| − | + | !rate-limit !remote-address !session-timeout use-compression=default \ | |
| − | + | use-encryption=default use-mpls=default use-vj-compression=default \ | |
| − | + | !wins-server | |
| − | + | set 1 address-list="" !bridge !bridge-path-cost !bridge-port-priority \ | |
| − | + | change-tcp-mss=yes !dns-server !idle-timeout !incoming-filter \ | |
| − | + | !local-address name=default-encryption only-one=default !outgoing-filter \ | |
| − | + | !rate-limit !remote-address !session-timeout use-compression=default \ | |
| − | + | use-encryption=yes use-mpls=default use-vj-compression=default \ | |
| − | / | + | !wins-server |
| − | set | + | |
| − | + | /ppp aaa | |
| − | + | set accounting=yes interim-update=15m use-radius=yes | |
| + | |||
| + | |||
/ip firewall filter | /ip firewall filter | ||
| − | add action=jump chain=forward jump-target=ppp | + | add action=jump chain=forward !connection-bytes !connection-limit \ |
| + | !connection-mark !connection-rate !connection-state !connection-type \ | ||
| + | !content disabled=no !dscp !dst-address !dst-address-list \ | ||
| + | !dst-address-type !dst-limit !dst-port !fragment !hotspot !icmp-options \ | ||
| + | !in-bridge-port !in-interface !ingress-priority !ipv4-options \ | ||
| + | jump-target=ppp !layer7-protocol !limit !nth !out-bridge-port \ | ||
| + | !out-interface !p2p !packet-mark !packet-size !per-connection-classifier \ | ||
| + | !port !priority !protocol !psd !random !routing-mark !routing-table \ | ||
| + | !src-address !src-address-list !src-address-type !src-mac-address \ | ||
| + | !src-port !tcp-flags !tcp-mss !time !ttl | ||
add action=add-src-to-address-list address-list=przekierowanie \ | add action=add-src-to-address-list address-list=przekierowanie \ | ||
| − | address-list-timeout=10m chain=przypominajka dst-address=!78.31.90.8 | + | address-list-timeout=10m chain=przypominajka !connection-bytes \ |
| − | add chain=forward comment="Akceptujemy ruch dnsa" dst-port=53 protocol=udp \ | + | !connection-limit !connection-mark !connection-rate !connection-state \ |
| − | src-address-list=przekierowanie | + | !connection-type !content disabled=no !dscp dst-address=!78.31.90.8 \ |
| − | add chain=forward comment=\ | + | !dst-address-list !dst-address-type !dst-limit !dst-port !fragment \ |
| − | "Akceptujemy ruch o strony z komunikatem i do panelu usera" dst-address=\ | + | !hotspot !icmp-options !in-bridge-port !in-interface !ingress-priority \ |
| − | + | !ipv4-options !layer7-protocol !limit !nth !out-bridge-port \ | |
| + | !out-interface !p2p !packet-mark !packet-size !per-connection-classifier \ | ||
| + | !port !priority !protocol !psd !random !routing-mark !routing-table \ | ||
| + | !src-address !src-address-list !src-address-type !src-mac-address \ | ||
| + | !src-port !tcp-flags !tcp-mss !time !ttl | ||
| + | add action=accept chain=forward comment="Akceptujemy ruch dnsa" \ | ||
| + | !connection-bytes !connection-limit !connection-mark !connection-rate \ | ||
| + | !connection-state !connection-type !content disabled=no !dscp \ | ||
| + | !dst-address !dst-address-list !dst-address-type !dst-limit dst-port=53 \ | ||
| + | !fragment !hotspot !icmp-options !in-bridge-port !in-interface \ | ||
| + | !ingress-priority !ipv4-options !layer7-protocol !limit !nth \ | ||
| + | !out-bridge-port !out-interface !p2p !packet-mark !packet-size \ | ||
| + | !per-connection-classifier !port !priority protocol=udp !psd !random \ | ||
| + | !routing-mark !routing-table !src-address src-address-list=przekierowanie \ | ||
| + | !src-address-type !src-mac-address !src-port !tcp-flags !tcp-mss !time \ | ||
| + | !ttl | ||
| + | add action=accept chain=forward comment=\ | ||
| + | "Akceptujemy ruch o strony z komunikatem i do panelu usera" \ | ||
| + | !connection-bytes !connection-limit !connection-mark !connection-rate \ | ||
| + | !connection-state !connection-type !content disabled=no !dscp \ | ||
| + | dst-address=IP_RADIUSA !dst-address-list !dst-address-type !dst-limit \ | ||
| + | !dst-port !fragment !hotspot !icmp-options !in-bridge-port !in-interface \ | ||
| + | !ingress-priority !ipv4-options !layer7-protocol !limit !nth \ | ||
| + | !out-bridge-port !out-interface !p2p !packet-mark !packet-size \ | ||
| + | !per-connection-classifier !port !priority !protocol !psd !random \ | ||
| + | !routing-mark !routing-table !src-address src-address-list=przekierowanie \ | ||
| + | !src-address-type !src-mac-address !src-port !tcp-flags !tcp-mss !time \ | ||
| + | !ttl | ||
add action=drop chain=forward comment=\ | add action=drop chain=forward comment=\ | ||
| − | "Blokujemy ruch z komputer\F3w z komunikatami" src-address-list=\ | + | "Blokujemy ruch z komputer\F3w z komunikatami" !connection-bytes \ |
| − | + | !connection-limit !connection-mark !connection-rate !connection-state \ | |
| + | !connection-type !content disabled=no !dscp !dst-address \ | ||
| + | !dst-address-list !dst-address-type !dst-limit !dst-port !fragment \ | ||
| + | !hotspot !icmp-options !in-bridge-port !in-interface !ingress-priority \ | ||
| + | !ipv4-options !layer7-protocol !limit !nth !out-bridge-port \ | ||
| + | !out-interface !p2p !packet-mark !packet-size !per-connection-classifier \ | ||
| + | !port !priority !protocol !psd !random !routing-mark !routing-table \ | ||
| + | !src-address src-address-list=przekierowanie !src-address-type \ | ||
| + | !src-mac-address !src-port !tcp-flags !tcp-mss !time !ttl | ||
| + | |||
| + | |||
/ip firewall nat | /ip firewall nat | ||
| − | add action=redirect chain=dstnat comment=Przekierowanie dst-port=80 protocol | + | add action=redirect chain=dstnat comment=Przekierowanie !connection-bytes \ |
| − | tcp src-address-list= | + | !connection-limit !connection-mark !connection-rate !connection-type \ |
| − | + | !content disabled=no !dscp !dst-address !dst-address-list \ | |
| − | + | !dst-address-type !dst-limit dst-port=80 !fragment !hotspot !icmp-options \ | |
| + | !in-bridge-port !in-interface !ingress-priority !ipv4-options \ | ||
| + | !layer7-protocol !limit !nth !out-bridge-port !out-interface !packet-mark \ | ||
| + | !packet-size !per-connection-classifier !port !priority protocol=tcp !psd \ | ||
| + | !random !routing-mark !routing-table !src-address src-address-list=\ | ||
| + | przekierowanie !src-address-type !src-mac-address !src-port !tcp-mss \ | ||
| + | !time !to-addresses to-ports=8080 !ttl | ||
| + | |||
| + | |||
| + | |||
/ip proxy | /ip proxy | ||
| − | set enabled=yes max-cache-size=none | + | set always-from-cache=no cache-administrator=webmaster cache-hit-dscp=4 \ |
| + | cache-on-disk=no enabled=yes max-cache-object-size=2048KiB \ | ||
| + | max-cache-size=none max-client-connections=600 max-fresh-time=3d \ | ||
| + | max-server-connections=600 parent-proxy=0.0.0.0 parent-proxy-port=0 port=\ | ||
| + | 8080 serialize-connections=no src-address=IP_MIKROTIKA | ||
/ip proxy access | /ip proxy access | ||
| − | add comment="Akceptujemy ruch do strony z komunikatem" dst-address= | + | add action=allow comment="Akceptujemy ruch do strony z komunikatem" disabled=\ |
| − | add comment="Ruch do mBank" dst-host=*.mbank.pl src-address=0.0.0.0/0 | + | no dst-address=IP_RADIUSA !dst-host dst-port="" !local-port !method !path \ |
| − | add comment="Ruch do mBank" dst-host=*.mbank.com.pl src-address=0.0.0.0/0 | + | !redirect-to !src-address |
| − | add comment="Ruch do BZWBK" dst-host=*.centrum24.pl src-address=0.0.0.0/0 | + | add action=allow comment="Ruch do mBank" disabled=no !dst-address dst-host=\ |
| − | add comment="Ruch do BZWBK" dst-host=*.bzwbk.pl src-address=0.0.0.0/0 | + | *.mbank.pl dst-port="" !local-port !method !path !redirect-to \ |
| − | add action=deny comment="Przekierowujemy ruch na adres url" dst-port=80 | + | src-address=0.0.0.0/0 |
| − | + | add action=allow comment="Ruch do mBank" disabled=no !dst-address dst-host=\ | |
| + | *.mbank.com.pl dst-port="" !local-port !method !path !redirect-to \ | ||
| + | src-address=0.0.0.0/0 | ||
| + | add action=allow comment="Ruch do BZWBK" disabled=no !dst-address dst-host=\ | ||
| + | *.centrum24.pl dst-port="" !local-port !method !path !redirect-to \ | ||
| + | src-address=0.0.0.0/0 | ||
| + | add action=allow comment="Ruch do BZWBK" disabled=no !dst-address dst-host=\ | ||
| + | *.bzwbk.pl dst-port="" !local-port !method !path !redirect-to \ | ||
| + | src-address=0.0.0.0/0 | ||
| + | add action=deny comment="Przekierowujemy ruch na adres url" disabled=no \ | ||
| + | !dst-address !dst-host dst-port=80 !local-port !method !path redirect-to=\ | ||
| + | nowynet.ostrog.net/notification src-address=0.0.0.0/0 | ||
/ip proxy direct | /ip proxy direct | ||
| − | add action=deny src-address=0.0.0.0/0 | + | add action=deny disabled=no !dst-address !dst-host dst-port="" !local-port \ |
| − | + | !method !path src-address=0.0.0.0/0 | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
/radius | /radius | ||
| − | add | + | add accounting-backup=no accounting-port=1813 address=IP_RADIUSA \ |
| − | + | authentication-port=1812 called-id="" disabled=no domain="" realm="" \ | |
| − | + | secret=amen service=ppp timeout=300ms | |
| − | + | /radius incoming | |
| − | + | set accept=no port=3799 | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | / | + | |
| − | set | + | |
| − | + | ||
| − | + | ||
</pre> | </pre> | ||
[[Kategoria:Urządzenia]] | [[Kategoria:Urządzenia]] | ||
Wersja z 12:24, 18 cze 2013
Skrypt do konfiguracji urządzeń Mikrotik.
Konfiguracja Mikrotik
Skrypt
W odpowiednie miejsca należy wpisać odpowiednie dane (loginy, hasła, adresy IP)
/interface pppoe-server server
add authentication=chap default-profile=default disabled=no interface=wlan14 \
keepalive-timeout=10 max-mru=1480 max-mtu=1480 max-sessions=0 mrru=\
disabled one-session-per-host=yes service-name=testowy
/ppp profile
set 0 address-list="" !bridge !bridge-path-cost !bridge-port-priority \
change-tcp-mss=yes !dns-server !idle-timeout !incoming-filter \
local-address=IP_MIKROTIKA name=default only-one=default !outgoing-filter \
!rate-limit !remote-address !session-timeout use-compression=default \
use-encryption=default use-mpls=default use-vj-compression=default \
!wins-server
set 1 address-list="" !bridge !bridge-path-cost !bridge-port-priority \
change-tcp-mss=yes !dns-server !idle-timeout !incoming-filter \
!local-address name=default-encryption only-one=default !outgoing-filter \
!rate-limit !remote-address !session-timeout use-compression=default \
use-encryption=yes use-mpls=default use-vj-compression=default \
!wins-server
/ppp aaa
set accounting=yes interim-update=15m use-radius=yes
/ip firewall filter
add action=jump chain=forward !connection-bytes !connection-limit \
!connection-mark !connection-rate !connection-state !connection-type \
!content disabled=no !dscp !dst-address !dst-address-list \
!dst-address-type !dst-limit !dst-port !fragment !hotspot !icmp-options \
!in-bridge-port !in-interface !ingress-priority !ipv4-options \
jump-target=ppp !layer7-protocol !limit !nth !out-bridge-port \
!out-interface !p2p !packet-mark !packet-size !per-connection-classifier \
!port !priority !protocol !psd !random !routing-mark !routing-table \
!src-address !src-address-list !src-address-type !src-mac-address \
!src-port !tcp-flags !tcp-mss !time !ttl
add action=add-src-to-address-list address-list=przekierowanie \
address-list-timeout=10m chain=przypominajka !connection-bytes \
!connection-limit !connection-mark !connection-rate !connection-state \
!connection-type !content disabled=no !dscp dst-address=!78.31.90.8 \
!dst-address-list !dst-address-type !dst-limit !dst-port !fragment \
!hotspot !icmp-options !in-bridge-port !in-interface !ingress-priority \
!ipv4-options !layer7-protocol !limit !nth !out-bridge-port \
!out-interface !p2p !packet-mark !packet-size !per-connection-classifier \
!port !priority !protocol !psd !random !routing-mark !routing-table \
!src-address !src-address-list !src-address-type !src-mac-address \
!src-port !tcp-flags !tcp-mss !time !ttl
add action=accept chain=forward comment="Akceptujemy ruch dnsa" \
!connection-bytes !connection-limit !connection-mark !connection-rate \
!connection-state !connection-type !content disabled=no !dscp \
!dst-address !dst-address-list !dst-address-type !dst-limit dst-port=53 \
!fragment !hotspot !icmp-options !in-bridge-port !in-interface \
!ingress-priority !ipv4-options !layer7-protocol !limit !nth \
!out-bridge-port !out-interface !p2p !packet-mark !packet-size \
!per-connection-classifier !port !priority protocol=udp !psd !random \
!routing-mark !routing-table !src-address src-address-list=przekierowanie \
!src-address-type !src-mac-address !src-port !tcp-flags !tcp-mss !time \
!ttl
add action=accept chain=forward comment=\
"Akceptujemy ruch o strony z komunikatem i do panelu usera" \
!connection-bytes !connection-limit !connection-mark !connection-rate \
!connection-state !connection-type !content disabled=no !dscp \
dst-address=IP_RADIUSA !dst-address-list !dst-address-type !dst-limit \
!dst-port !fragment !hotspot !icmp-options !in-bridge-port !in-interface \
!ingress-priority !ipv4-options !layer7-protocol !limit !nth \
!out-bridge-port !out-interface !p2p !packet-mark !packet-size \
!per-connection-classifier !port !priority !protocol !psd !random \
!routing-mark !routing-table !src-address src-address-list=przekierowanie \
!src-address-type !src-mac-address !src-port !tcp-flags !tcp-mss !time \
!ttl
add action=drop chain=forward comment=\
"Blokujemy ruch z komputer\F3w z komunikatami" !connection-bytes \
!connection-limit !connection-mark !connection-rate !connection-state \
!connection-type !content disabled=no !dscp !dst-address \
!dst-address-list !dst-address-type !dst-limit !dst-port !fragment \
!hotspot !icmp-options !in-bridge-port !in-interface !ingress-priority \
!ipv4-options !layer7-protocol !limit !nth !out-bridge-port \
!out-interface !p2p !packet-mark !packet-size !per-connection-classifier \
!port !priority !protocol !psd !random !routing-mark !routing-table \
!src-address src-address-list=przekierowanie !src-address-type \
!src-mac-address !src-port !tcp-flags !tcp-mss !time !ttl
/ip firewall nat
add action=redirect chain=dstnat comment=Przekierowanie !connection-bytes \
!connection-limit !connection-mark !connection-rate !connection-type \
!content disabled=no !dscp !dst-address !dst-address-list \
!dst-address-type !dst-limit dst-port=80 !fragment !hotspot !icmp-options \
!in-bridge-port !in-interface !ingress-priority !ipv4-options \
!layer7-protocol !limit !nth !out-bridge-port !out-interface !packet-mark \
!packet-size !per-connection-classifier !port !priority protocol=tcp !psd \
!random !routing-mark !routing-table !src-address src-address-list=\
przekierowanie !src-address-type !src-mac-address !src-port !tcp-mss \
!time !to-addresses to-ports=8080 !ttl
/ip proxy
set always-from-cache=no cache-administrator=webmaster cache-hit-dscp=4 \
cache-on-disk=no enabled=yes max-cache-object-size=2048KiB \
max-cache-size=none max-client-connections=600 max-fresh-time=3d \
max-server-connections=600 parent-proxy=0.0.0.0 parent-proxy-port=0 port=\
8080 serialize-connections=no src-address=IP_MIKROTIKA
/ip proxy access
add action=allow comment="Akceptujemy ruch do strony z komunikatem" disabled=\
no dst-address=IP_RADIUSA !dst-host dst-port="" !local-port !method !path \
!redirect-to !src-address
add action=allow comment="Ruch do mBank" disabled=no !dst-address dst-host=\
*.mbank.pl dst-port="" !local-port !method !path !redirect-to \
src-address=0.0.0.0/0
add action=allow comment="Ruch do mBank" disabled=no !dst-address dst-host=\
*.mbank.com.pl dst-port="" !local-port !method !path !redirect-to \
src-address=0.0.0.0/0
add action=allow comment="Ruch do BZWBK" disabled=no !dst-address dst-host=\
*.centrum24.pl dst-port="" !local-port !method !path !redirect-to \
src-address=0.0.0.0/0
add action=allow comment="Ruch do BZWBK" disabled=no !dst-address dst-host=\
*.bzwbk.pl dst-port="" !local-port !method !path !redirect-to \
src-address=0.0.0.0/0
add action=deny comment="Przekierowujemy ruch na adres url" disabled=no \
!dst-address !dst-host dst-port=80 !local-port !method !path redirect-to=\
nowynet.ostrog.net/notification src-address=0.0.0.0/0
/ip proxy direct
add action=deny disabled=no !dst-address !dst-host dst-port="" !local-port \
!method !path src-address=0.0.0.0/0
/radius
add accounting-backup=no accounting-port=1813 address=IP_RADIUSA \
authentication-port=1812 called-id="" disabled=no domain="" realm="" \
secret=amen service=ppp timeout=300ms
/radius incoming
set accept=no port=3799