Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Get IP Iran and add to Mikrotik Address List

License

Notifications You must be signed in to change notification settings

falahati/Get-IP-Iran

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44,706 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get IP Iran

This script is for get iran ip subnet and added to address list mikrotik

How to use script

foreach i in={"NoNAT"} do={
  /tool fetch url="https://raw.githubusercontent.com/MrAriaNet/Get-IP-Iran/main/list.rsc" dst-path=NoNAT
  /ip firewall address-list remove [/ip firewall address-list find list=$i]
  /import file-name=$i
  /file remove $i
}
  • If your internet is disconnected and you cannot connect to GitHub to fetch the new list, you can use the script below so that the previous list is not deleted.
foreach i in={"NoNAT"} do={

  :local fileName $i
  :local url "https://raw.githubusercontent.com/MrAriaNet/Get-IP-Iran/main/list.rsc"

  /tool fetch url=$url dst-path=$fileName mode=http

  :delay 5

  :if ([/file find name=$fileName] != "") do={

    :if ([/file get $fileName size] > 0) do={

      /ip firewall address-list remove [/ip firewall address-list find list=$i]
      /import file-name=$fileName
      /file remove $fileName

    } else={
      :log warning "Download failed or empty file for $i — keeping old address list"
      /file remove $fileName
    }

  } else={
    :log warning "File not found after fetch — download likely failed — keeping old address list"
  }
}

Author

Aria

Special thanks from my best friends

SS Salehi

Mahdi Habashi

About

Get IP Iran and add to Mikrotik Address List

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • RouterOS Script 99.5%
  • Shell 0.5%