From 95e186fffbe55d70fffc93425fe6cda3bded1d07 Mon Sep 17 00:00:00 2001 From: Pothi Kalimuthu <1254302+pothi@users.noreply.github.com> Date: Mon, 10 Jan 2022 08:14:02 +0530 Subject: [PATCH] Multiple changes in configuring SXT LTE Kit --- sxt-lte-init.rsc | 50 +++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/sxt-lte-init.rsc b/sxt-lte-init.rsc index ba3b31b..450d64b 100644 --- a/sxt-lte-init.rsc +++ b/sxt-lte-init.rsc @@ -3,13 +3,15 @@ :global myPassword; # override the default values here -:set identity "Mikrotik SXT LTE"; +:set identity "SXT LTE Kit"; :set myPassword [:pick ([/cert scep-server otp generate as-value minutes-valid=1]->"password") 0 20] +:put "Your new password is..." +:put $myPassword # my subnet :global mySubnetCIDR "10.88.50.0/24"; :global dhcpServerIP "10.88.50.1"; -:global dhcpPoolRange "10.88.50.88-10.88.50.254"; +:global dhcpPoolRange "10.88.50.88-10.88.50.100"; :global dhcpName "my-dhcp"; :global myBridgeAddress "10.88.50.1/24"; @@ -23,33 +25,19 @@ # Configure Identity /system identity set name=$identity -# Change subnet -/ip pool add name=$dhcpName ranges=$dhcpPoolRange; -/ip pool remove default-dhcp; - -/ip dhcp-server remove defconf; -/ip dhcp-server add name=$dhcpName address-pool=$dhcpName interface=bridge lease-time=10m disabled=no; - -/ip dhcp-server network add address=$mySubnetCIDR gateway=$dhcpServerIP dns-server=$dhcpServerIP; -/ip dhcp-server network remove [find dns-server=192.168.88.1]; - -/ip address add address=$myBridgeAddress interface=bridge; -/ip address remove [find address="192.168.88.1/24"] - -#change static DNS entry for router.lan -/ip dns static set numbers=[find name=router.lan] address=$dhcpServerIP; - -# Configure Guest Network and Firewall - # Wireless tweaks # install public SSH key +:put "Importing SSH key..." { :local result [ /tool fetch https://launchpad.net/~pothi/+sshkeys dst-path=pothi-ssh-key-rsa as-value]; :while ($result->"status" != "finished") do={ :delay 2s } } +:delay 1s /user ssh-keys import public-key-file=pothi-ssh-key-rsa; +:delay 1s /file remove pothi-ssh-key-rsa; +:put "Done importing SSH key." # Reduce disk activity /ip dhcp-server config set store-leases-disk=never; @@ -65,3 +53,25 @@ # SMS Receive capability /tool sms set auto-erase=yes receive-enabled=yes secret=0000 port=lte1; +:put "Changing the sim slot to 'b'." +/system routerboard modem set sim-slot=b + +# Change subnet +#change static DNS entry for router.lan +/ip dns static set numbers=[find name=router.lan] address=$dhcpServerIP; + +/ip pool add name=$dhcpName ranges=$dhcpPoolRange; +/ip dhcp-server network add address=$mySubnetCIDR gateway=$dhcpServerIP dns-server=$dhcpServerIP; +/ip address add address=$myBridgeAddress interface=bridge; +# /ip dhcp-server add name=$dhcpName address-pool=$dhcpName interface=bridge lease-time=10m disabled=no; +/ip dhcp-server set [find name=defconf] address-pool=my-dhcp +:put "Subnet changed." + +:put "Removing old subnet." +:put "This will make the current SSH session unresponsive." +:put "Renew or release the IP in DHCP client in the router or disble & enable DHCP client to make everything work again." +/ip pool remove default-dhcp; +/ip dhcp-server network remove [find dns-server=192.168.88.1]; +/ip address remove [find address="192.168.88.1/24"] +# /ip dhcp-server remove defconf; +