On 22.08.13. 12:58, Marc, LX1DUC wrote:
There ara alot of clues in the amprupdate python
script.
https://github.com/kd7lxl/hamwan_scripts/blob/master/amprupdate/amprupdate.…
Especially on line 159 and 160.
commands.append("/interface ipip add local-address=%s name=ampr-%s
remote-address=%s" % (wan_router_ip, interface, interface))
commands.append("/ip route add dst-address=%s gateway=ampr-%s" %
(dstaddress, interface))
In this case "wan_router_ip" is the IP of the WAN interface of your
Mikrotik router (the interface which gives access to the internet.)
"interface" is the remote gateway's public IP address.
"dstaddress" is the remote AMPR subnet.
Assuming that your "wan_router_ip" (see definition above) is 192.0.2.2.
Assuming that encap.txt only contains the following 2 entries:
route addprivate 44.128/19 encap 198.51.100.1
route addprivate 44.128.210/24 encap 203.0.113.1
this is what your script needs to produce:
/interface ipip add local-address=192.0.2.2 name=ampr-198.51.100.1
remote-address=198.51.100.1
/interface ipip add local-address=192.0.2.2 name=ampr-203.0.113.1
remote-address=203.0.113.1
/ip route add dst-address=44.128.0.0/19 gateway=ampr-198.51.100.1
/ip route add dst-address=44.128.210.0/24 gateway=ampr-203.0.113.1
As you see you will need to expand 44.128/19 to 44.128.0.0/19.
Depending on your setup, you may want to use routing-marks and routing
tables and routing rules etc.
Something like this is the first thing I tried but was unable to set it
up to have routing work.
Thanks for an example. This is much more informative than digging
through that python script. Will let you know what I got.
Pedja
YT9TP