This parameter is available in v6.39rc33+ These are available variables that are accessible for the event script:
bound - 1 - lease is added/changed; 0 - lease is removed
server-address - server address
| #!/usr/bin/env sh | |
| apk update | |
| apk add openvswitch openvswitch-bash-completion bash bash-completion openvswitch-doc openvswitch-openrc vim tcpdump ruby ruby-rdoc git | |
| sed -i -e "s@mouse\=a@mouse=r@g" /usr/share/vim/vim*/defaults.vim | |
| grep "mouse=a" /usr/share/vim/vim*/defaults.vim | |
| grep "auto switch0" /etc/network/interfaces >/dev/null | |
| RES="$?" |
| { | |
| :do { | |
| :log info "STARTING BACKUP"; | |
| :global customerIdentificationVar; | |
| :local customerIdentification "{{ customer_identifictation }}"; | |
| if ( [:len $customerIdentificationVar] > 0 ) do={ | |
| :set customerIdentification "$customerIdentificationVar"; |
| { | |
| /export show-sensitive file=routeros-generic-config.rsc; | |
| :local deviceSerialNumber "1234"; | |
| :local apiUsername "$deviceSerialNumber"; | |
| :local apiPassword "secretPassword"; | |
| :lcal backupServerDomain "cep-backup.ngtech.home" | |
| :local fileContent [/file get routeros-generic-config.rsc contents]; | |
| :local apiUrl "https://$backupServerDomain/api/v1/backup/$apiUsename/generic"; | |
| :local postData "$fileContent"; | |
| :local contentLength [:len $fileContent]; |
| # Get the network interfaces | |
| $interfaces = Get-NetIPInterface | Where-Object {$_.InterfaceAlias -match "Wi-Fi" -or $_.InterfaceAlias -match "vEthernet" -or $_.InterfaceAlias -match "Ethernet"} | |
| # Set a higher metric value for the Ethernet interface | |
| foreach ($interface in $interfaces) { | |
| Write-Host $interface.InterfaceAlias | |
| if ($interface.InterfaceAlias -match "Ethernet") { | |
| Write-Host "Ethernet Interface" | |
| Set-NetIPInterface -InterfaceAlias $interface.InterfaceAlias -InterfaceMetric 100 |
| # Variables | |
| $ipStringPrefix = "192.20.20." # Replace with the desired IP address prefix | |
| $newIpAddress = "192.20.20.150" # Replace with the desired new static IP address | |
| $newPrefixLength = 24 # Replace with the desired subnet mask length | |
| # Find the interface by CIDR | |
| $interfaces = Get-NetIPAddress | Where-Object { | |
| $_.IPAddress.StartsWith($ipStringPrefix) | |
| } |
| # 1970-01-02 00:02:40 by RouterOS 7.15 | |
| # software id = 8A8H-8IIG | |
| # | |
| script: #| Welcome to RouterOS! | |
| #| 1) Set a strong router password in the System > Users menu | |
| #| 2) Upgrade the software in the System > Packages menu | |
| #| 3) Enable firewall on untrusted networks | |
| #| 4) Set your country name to observe wireless regulations | |
| #| ----------------------------------------------------------------------------- | |
| #| RouterMode: |
| { | |
| :do { | |
| :log info ("ppp on-up script for interface id: " . $interface . " Started" ); | |
| :local interfaceName [/interface/get $interface name]; | |
| :log info ("ppp on-up script for interface name: " . $interfaceName . " Started" ); | |
| :local routingTable "WAN1"; | |
| :local routingTable "WAN2"; |
This parameter is available in v6.39rc33+ These are available variables that are accessible for the event script:
bound - 1 - lease is added/changed; 0 - lease is removed
server-address - server address
| #!/usr/bin/env ruby | |
| def filter_text_file(input_file) | |
| # Read the input file content | |
| content = File.read(input_file) | |
| # Split the content into lines | |
| lines = content.split("\n") | |
| # Initialize a variable to track if we are inside a block to remove |
| { | |
| :do { | |
| :local debug 1; | |
| :local flagInterface ""; | |
| :local srcInterface ""; | |
| :local srcAddress ""; | |
| :set srcInterface "###INTERFACE_NAME###"; | |
| :set flagInterface "###FLAG_INTERFACE_NAME###"; |