Advertisement
sopyanx

ip public

Mar 25th, 2019
3,330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. :local WANINTERFACE
  2. :set WANINTERFACE pppoe-indihome
  3.  
  4. :local WANIP [/ip address get [find where interface=$WANINTERFACE] address];
  5. :set WANIP [:pick $WANIP 0 ([:len $WANIP]-3) ];
  6.  
  7. :if ($WANIP ~"^10.") do={
  8. :log warning "Private ip address found !!!"
  9.  
  10. /interface pppoe-client enable $WANINTERFACE
  11. :delay 1
  12. } else={
  13.  
  14. :if ($WANIP ~"^172.") do={
  15. :log warning "Private ip address found !!!"
  16.  
  17. /interface pppoe-client enable $WANINTERFACE
  18. :delay 1
  19. } else={
  20.  
  21. :if ($WANIP ~"^192.") do={
  22. :log warning "Private ip address found !!!"
  23.  
  24. /interface pppoe-client enable $WANINTERFACE
  25. :delay 1
  26. } else={
  27.  
  28. :log warning "Public IP - $WANIP - Found, OK ! No action required"
  29.  
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement