Scripts for a Dynamic CAPsMAN network with Mikrotik RouterOS
All RouterOS devices are preconfigured. They build a ad-hoc network and elect one device as CAPsMAN.
- All routers connect each other by ospfv3 (IPv6)
- Additional they build a network by ospfv2 (IPv4)
- They provides on every ethernet interface a unique IPv4 subnet for clients
- There is one primary CAPsMAN in the whole network
- There is one primary DNS-Server to distribute DNS-Names to all other routers
- The Router with a default route propagates it to the whole network
- Every router has his one uniqe id (between 0 and 255).
- Every router has a loopback device
- IPv6-Address fd58:9c23:3615::ID
- IPv4-Address 172.16.0.ID
There is a cron job (named check-master) everey minute who detects some topology changes and apply configuration changes (if needed).
They connect by OSPFv3 over IPv6 together
- Router ID: 172.16.0.ID
- search for neighbors routers on all ethernet devices
The IPv4-Configuration on a ethernet device depends if there is a other router with a lower router id on the same layer 2 segment.
- IP-Address 10.ID.EthernetId.1/24
- DHCP-Server enabled
- IP-Address configured by DHCP (but not set the default route)
- DHCP-Server disabled
- Router ID: 172.16.0.ID
- search for neighbors routers on all ethernet devices
- The router with the lowest ID is the CAPsMAN.
- It has additionally the ip fd58:9c23:3615:ffff
- There is a eoipv6 tunnel between CAPsMAN and all CAP devices
- Every local WLAN device will be connected to CAPsMAN
- Some Routers with RouterOS from Mikrotik
- Connections between the routers (Ethernet cable)
- Update router at least to 6.36.3
/system package update install
- Install wireless-rep (if not already there)
- Download extra packages from http://www.mikrotik.com/download for your Platform
- Extract wireless-rep-* and copy to your device
- Reboot it
- Enable wireless-rep and IPv6
/system package
enable ipv6
enable wireless-rep
/system reboot
- Log into device and remove all current configuration
/system reset-configuration no-defaults=yes
- Now connect device by serial console, mac-telnet (https://github.com/haakonnessjoen/MAC-Telnet) or Winbox (http://wiki.mikrotik.com/wiki/Manual:Winbox)
- Set ID to variable $number. Where ID is a unique number for this Device.
:global number
ID
- Open config.rsc with your favorite text editor
- Copy and paste the whole content it into the console on router.
- Set password
/password
- Set a idendity
/system identity set name=router-
ID
Now you are ready and can connect a client PC to any ethernet-connection on your device. If your device has the ID 20 you can connect the web ui by http://172.16.0.20/