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.
73 de Marc, LX1DUC
Quoting YT9TP Pedja <yt9tp(a)uzice.net>et>:
(Please trim inclusions from previous messages)
_______________________________________________
On 21.8.2013 18:23, Tom Hayward wrote:
The script relies on reading your router's
configuration to determine
what needs to be updated. If someone provided a static script, every
time you ran the script it would create 300+ IPIP interfaces, and
there would be no mechanism for deleting orphaned interfaces and
routes. One of the parameters to create the IPIP interface is your
local IP, so simply exporting someone else's configuration isn't going
to work either. It is critical that the script interacts with your
router.
I need export from working Mikrotik router set to route 44/8 subnet
as an example, so I can learn how it works and hopefully create
Mikrotik script that does what is necessary to make it applicable to
any Mikrotik router.
Can you provide me that example? It is just an export of IPIP
settings and routing table.
I do not expect problems with handling replacements or orphan settings.
You could implement this in something other than
Python if you want,
like Mikrotik's native scripting language. I'm not very familiar with
Mikrotik's scripting language so I was not able to implement this
myself. I chose Python because I knew I could get it working quickly
and move on to something else.
I have some experience with Mikrotik scripting and I can try, but I
need something to start from as I was unsuccessful to create such
example myself. Python script that is offered does not work here and
I have not enough Python and Linux knowledge to be able to make it
work.
I don't see occasional reliance on an
external Linux server to be a
problem.
I do. First, I dislike my routers to depend on third parties, and
second, I do not have Linux server that can run that script.
You could even run the Python script from Openwrt
in a MetaROUTER
running on your primary Mikrotik router.
This is not available on all Mikrotik based routers. My guess is
that, at least in my area, most Mikrotik routers used would not have
this as an option.
There are so many options here that simply asking
someone else to do
it for you is not appropriate. Go forth and experiment!
This is rude and unnecessary approach. I did not ask anyone to do
work for me. All I asked was export from already set Mikrotik router
so I can have example I can work on to create necessary tools.
I already have several offers to simply establish VPN to other AMPR
subnets and they will do all the routing for me. I decided to first
try to make it on my own.
It seems that you do not understand that I do not need 44/8 subnet
addresses as they are just like any other private IP network. All I
want to do I can do fine using any other private IP subnet.
I want to use 44/8 to spread the word and help others to get
involved. And I am not alone.
When people see how things are complicated they simply turn in the
other way. Do you want me to do the same or to try to reach my goal
to make it simpler, and easier to implement, at least in the area
where I have some experience - Mikrotik routers.
Ok, message received, and it does explain a bit why there is not so
much people involved in AMPRNet.
Best wishes,
Pedja YT9TP
_________________________________________
44Net mailing list
44Net(a)hamradio.ucsd.edu
http://hamradio.ucsd.edu/mailman/listinfo/44net
http://www.ampr.org/donate.html