ссылки
1 2 3 4 5 6 7 8 9 |
https://www.cnblogs.com/lsgxeva/p/9566122.html https://mikrotiklab.ru/emulyator/ustanovka-eve-ng.html https://www.cnblogs.com/lsgxeva/p/9566122.html https://mikrotiklab.ru/emulyator/dobavlenie-obrazov.html https://www.eve-ng.net/ https://www.eve-ng.net/index.php/download/ https://mikrotik.com/download https://download.mikrotik.com/routeros/6.46.3/chr-6.46.3.img.zip https://www.eve-ng.net/index.php/documentation/howtos/howto-add-mikrotik-cloud-router/ |
Скрипт включаем NAT для облаков в eve-ng
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
#!/bin/bash #pnet1-9 interfaces in eve-ng ip add ad 172.16.1.10/24 dev pnet1 ip add ad 172.16.2.10/24 dev pnet2 ip add ad 172.16.3.10/24 dev pnet3 ip add ad 172.16.4.10/24 dev pnet4 ip add ad 172.16.5.10/24 dev pnet5 ip add ad 172.16.6.10/24 dev pnet6 ip add ad 172.16.7.10/24 dev pnet7 ip add ad 172.16.8.10/24 dev pnet8 ip add ad 172.16.9.10/24 dev pnet9 echo 1 > /proc/sys/net/ipv4/ip_forward echo "FORWARD ON" ip -4 a # pnet0 - default interface eve-ng echo "NAT ON" iptables -t nat -A POSTROUTING -o pnet0 -s 172.16.1.0/24 -j MASQUERADE iptables -t nat -A POSTROUTING -o pnet0 -s 172.16.2.0/24 -j MASQUERADE iptables -t nat -A POSTROUTING -o pnet0 -s 172.16.3.0/24 -j MASQUERADE iptables -t nat -A POSTROUTING -o pnet0 -s 172.16.4.0/24 -j MASQUERADE iptables -t nat -A POSTROUTING -o pnet0 -s 172.16.5.0/24 -j MASQUERADE iptables -t nat -A POSTROUTING -o pnet0 -s 172.16.6.0/24 -j MASQUERADE iptables -t nat -A POSTROUTING -o pnet0 -s 172.16.7.0/24 -j MASQUERADE iptables -t nat -A POSTROUTING -o pnet0 -s 172.16.8.0/24 -j MASQUERADE iptables -t nat -A POSTROUTING -o pnet0 -s 172.16.9.0/24 -j MASQUERADE # dst nat for ip 172.16.9.100\winbox\8291 echo "DST NAT ON " iptables -t nat -A PREROUTING -p tcp --dport 8291 -i pnet0 -j DNAT --to 172.16.9.100 iptables -A FORWARD -i pnet0 -d 172.16.9.100 -p tcp --dport 8291 -j ACCEPT iptables -t nat -A PREROUTING -p tcp --dport 3389 -i pnet0 -j DNAT --to 172.16.5.50 iptables -A FORWARD -i pnet0 -d 172.16.5.50 -p tcp --dport 3389 -j ACCEPT #done script exit 0 |
Куда класть образы?
1 2 3 4 5 6 7 |
IOL распаковывать не надо - просто положить в /opt/unetlab/addons/iol/bin Dynamips распаковывать не надо - просто положить в /opt/unetlab/addons/dynamips qemu нужно положить в /opt/unetlab/addons/qemu Для быстрой распаковки tar.gz архивов можно использовать команд: for i in ls *.gz ; do tar -zxvf $i ; done |
Пример как добавить mikrotik в eve-ng
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
1. Download Mikrotik Cloud router image chr-6.40.4.img.zip from: https://mikrotik.com/download 2. Using any archivator program unzip it to get image file chr-6.40.4.img Accordingly our image naming table: http://www.eve-ng.net/index.php/documentation/images-table 3. SSH to your EVE and create directory for Mikrotik node. mkdir /opt/unetlab/addons/qemu/mikrotik-6.40.4/ 4. Upload the chr-6.40.4.img image to the created directory using for example FileZilla or WinSCP. 5. Go to newly created folder and convert the disk to the qcow2 format: cd /opt/unetlab/addons/qemu/mikrotik-6.40.4/ mv chr-6.40.4.img hda.qcow2 6. Fix permissions: /opt/unetlab/wrappers/unl_wrapper -a fixpermissions |