cowcow728123 wrote:/ip firewall mangle
Firewall ...(恕刪)
15.


16.



17.



18.


19.




cowcow728123 wrote:
# may/31/2018...(恕刪)
gfx wrote:
#v6.41後
#RB450G
/interface bridge
add name=bridge1 vlan-filtering=no
/interface bridge port
add bridge=bridge1 interface=ether5
add bridge=bridge1 interface=ether1 pvid=100
add bridge=bridge1 interface=ether2 pvid=200
add bridge=bridge1 interface=ether3 pvid=200
add bridge=bridge1 interface=ether4 pvid=100
/interface bridge vlan
add bridge=bridge1 tagged=ether5,bridge1 untagged=ether1,ether4 vlan-ids=100
add bridge=bridge1 tagged=ether5 untagged=ether2,ether3 vlan-ids=200
/interface vlan
add interface=bridge1 name=WAN vlan-id=100
/ip address
add address=192.168.88.1/24 interface=ether2 network=192.168.88.0
/ip dhcp-server
add address-pool=dhcp-pool authoritative=after-2sec-delay interface=ether2 name=DHCP
/interface pppoe-client
add allow=pap interface=WAN keepalive-timeout=60 profile=default name=pppoe-out1 password=xxxx user=xxxx
/interface bridge set bridge1 vlan-filtering=yes
nnn000 wrote:您可以閱讀這兩篇:
請問DFX大......(恕刪)
cowcow728123 wrote:
script not...(恕刪)
![]() :global vpn :if ([:typeof $vpn]!="num") do={:set vpn 0} :local tcp [/ip firewall mangle get [find dst-port="1723,443,1194"] byte] :local udp [/ip firewall mangle get [find dst-port="1701,500,4500"] byte] :local total ($tcp+$udp) :if ($vpn!=$total) do={:set vpn $total ; /system script run vpn-server} |
![]() :global active :foreach i in=[/ppp active find] \ do={ :local vpnc [/ppp active get $i caller-id] :if ([:len $active]=0) \ do={:set active $vpnc} \ else={:if ([:typeof [:find $active $vpnc]]="nil") do={:set active ($active.",".$vpnc)}} } :if ([:len [/ip firewall address-list find list=temp]]=0) do={:set active} |
![]() :global active :global vpn :local logout :foreach i in=[/ip firewall address-list find dynamic list=temp] \ do={ :local client [/ip firewall address-list get $i address] :local online false :if ([:typeof [:find [:toarray $active] $client]]="num") \ do={:set online true ; :do {/ip firewall address-list add list=mobile address=$client timeout=1d} on-error={}} :if ($online) \ do={/ip firewall address-list remove $i} \ else={:if ([:len $logout]=0) do={:set logout $i} else={:set logout ($logout.",".$i)}} } :set active :local scanners [:len [:toarray $logout]] :foreach i in=[:toarray $logout] \ do={ :if ([/ip firewall address-list get $i timeout]<0:1:0) \ do={ /ip firewall address-list add list=Scanners address=[/ip firewall address-list get $i address] timeout=7d /ip firewall address-list remove $i ; :set scanners ($scanners-1) } } :if ($scanners>0) do={:set vpn ($vpn-1)} |
![]() |
:if ([/interface get $interface type]~"in") do={/system script run vpn-clients} |
/system script run vpn-clients |