hi
This is script for copy route table to another one route table
::local Z 0;
:local checkIP 0;
:local ipAddress;
#name of source table
:local BGPIN 5G;
#name of destination table
:local T1 6G;
#name of gw of destination route table
:local gatewayT1 10.50.0.2;
#route ip address
/ip route
:foreach Z in=[find where routing-table=$BGPIN] do={
:local ipAddress [get $Z dst-address]
#Check present destination ip or not in target table
:local checkIP [/ip route print count-only where routing-table=$T1 dst-address=$ipAddress];
#if it is the default gateway don't add it
:if ($ipAddress=0.0.0.0/0) do={:set checkIP 2}
#If the IP is not in the destination table add it
:if ($checkIP = 0) do={
/ip route add dst-address=$ipAddress gateway=$gatewayT1 routing-table=$T1;}
}