- tce-load -wi ipv6-netfilter-5.15.10-tinycore.tcz
- sudo echo "modprobe ipv6" >> /opt/bootlocal.sh
- /usr/bin/filetool.sh -b
2022年12月25日 星期日
2022年12月17日 星期六
Telnet to a node's console on remote GNS server through SSH tunnel
Connect a node on remote GNS3 server through SSH tunnel
A dstnat is required to forward node_dstnat_port to node_console_port on GNS3
User PuTTY to connect a node on remote GNS3 server through SSH tunnel
(1) Command line:
C:\>putty username@proxy-ssh-server -L localport:gns3-remote-server:node-console-port
C:\>telnet localhost localport
-> Session
Host Name: remote-server-name Port: remote-node-port
->Connection -> Proxy
Proxy type: Local
Proxy hostname: hostname-for-ssh-server
Port: 22
Username: username-for-ssh-server
Password: password-for-ssh-server
local proxy command:
plink -pw %pass %user@%proxyhost -nc %host:%port
-> Session
Saved sessions: name-for-node
click save
更新 .ssh/config 內容如下之後:
1. 如果要連接 vm3,則輸入
ssh vm3
輸入 pc106 和 vm3 的 password 就可以連線。
2. 如果要從 vm3 下載或上傳資料,則輸入
ssh -Nf pc106
之後,如要複製 $HOME/history 檔案,則可輸入
scp -P 3199 127.0.0.1:history history
就會把檔案從 vm3 下載到本機,要留意的是遠端檔案的正確路徑和名稱。
Host *
StrictHostKeyChecking no
Ciphers aes256-gcm@openssh.com
Host pc106
HostName 120.125.80.106
LocalForward 3197 163.28.10.197:22
LocalForward 3198 163.28.10.198:22
LocalForward 3199 163.28.10.199:22
LocalForward 3200 163.28.10.200:22
Host vm1
ProxyCommand ssh 120.125.80.106 -W 163.28.10.197:22
Host vm2
ProxyCommand ssh 120.125.80.106 -W 163.28.10.198:22
Host vm3
ProxyCommand ssh 120.125.80.106 -W 163.28.10.199:22
Host vm4
ProxyCommand ssh 120.125.80.106 -W 163.28.10.200:22
2022年12月11日 星期日
qemu Mikrotik ROS for GNS3 Remote Server
Convert img to qcow2:
qemu-img convert -f raw -O qcow2 chr-7.6.img chr-7.6.qcow2
Boot ROS and connect with webfig:
qemu-system-x86_64 -nic user,hostfwd=tcp:127.0.0.1:6001-:80 "chr-7.6.qcow2"Boot ROS and connect with winbox:
qemu-system-x86_64 -nic user,hostfwd=tcp:127.0.0.1:6002-:8291 "chr-7.6.qcow2"For GNS3 remote server:
- If the first interface is not ether1, do /system/reset-configuration, power off the machine, then upload the image to GNS3.
- To avoid default route added by dhcp client, use the following script or do /system/reset-configuration with no default configuration and run-after-reset=oob.rsc:
/ip vrf add name=oob interface=ether1 /ip service set winbox vrf=oob /ip service set www vrf=oob
2022年11月7日 星期一
Mikrotik ROS v7 User Manager v5 as RADIUS server (with VLAN)
PART 1. RADIUS server
A. Certificate Generation
menu System/Certificate
Certificates tab:
B. User Manager
menu User Manager
add (for MAC auth)
Attributes Tunnel-Type 13
Attributes Tunnel-Private-Group-ID 100 (VLAN ID)
add (for 802.1x)
Name user1 (802.1x login username)Password 12345 (802.1x login password)Attributes Tunnel-Medium-Type 6
Attributes Tunnel-Type 13
Attributes Tunnel-Private-Group-ID 100 (VLAN ID)
Attributes Tunnel-Type 13
Attributes Tunnel-Private-Group-ID 100 (VLAN ID)
Router tab
PART 2. RADIUS client
A. RADIUS client setup
menu RADIUS
add (for do1x service)
B. Dot1X server setup
menu Do1X
add (for interface)
2022年2月7日 星期一
GNS3 Notes
Some notes about GNS3 on Windows 10
- Till GNS3 version 2.2.29, the WinPcap is required for both uBridge and Dynamips. Hosts inside GNS3 may not connect to host PC (ping replied destination unreachable) if WinPcap is not installed. uBridge is compiled with WinPcap SDK, so it cannot be replaced by the WinPcap compatible-API provided by NPcap.
- Serial console is required for a appliance in GNS3, such that its console can be redirected to a TCP port which can be connect by telnet programs on host PC.
- The VPCS in GNS3 is initiated with the same MAC address (stating at 00:50:79:66:68:00 by default). If there are two VPCSs running on two different GNS3s which are connected in a physical LAN, this will raise the MAC address conflict problem.
2022年1月9日 星期日
GNS3 Micro Core Linux (Tiny Core Linux) qcow2
GNS3 Micro Core Linux (Tiny Core Linux 13.0) 的 qcow2
問題所在
- 在 GNS3 VPCS 的 MAC address 起始值是固定的,如果有兩個 GNS3 在同一個 LAN 環境下,在 VPCS 互通的情況下,會有問題。
- There is a serious bug in Tiny Core Linux 12.0, the traceroute program does not work as expected. The bug has been resolved in Tiny Core Linux 13.0. [updated:2/5/2022]
前置準備
- Go to Tiny Core Linux website (http://tinycorelinux.net/downloads.html) download Core x86 Release Files Core-13.1.iso, or click Other Ports (http://tinycorelinux.net/ports.html) to download CorePure64-13.1.iso
- 至 QEMU website (https://www.qemu.org/download/#windows)下載 Windows 64bit 安裝檔 qemu-w64-setup-20220831.exe
- 執行安裝檔
- 將安裝後路徑加入使用者環境變數 PATH
產生 qcow2 on Windows 10
A. 利用 QEMU (on Windows 10)產生qcow2
- 產生 Micro Core Linux qcow2 檔案
qemu-img create -f qcow2 Core-13.qcow2 128M
qemu-img create -f qcow2 Core64-13.qcow2 128M - 將Micro Core Linux載入qcow2影像檔並開機
qemu-system-i386 -hda Core-13.qcow2 -cdrom Core-13.1.iso -boot d -m 128
qemu-system-x86_64 -hda Core64-13.qcow2 -cdrom CorePure64-13.1.iso -boot d -m 256 - 執行從iso安裝Micro Core Linux至影像檔
- 測試產生的qcow2影像檔
qemu-system-i386 -hda Core-13.qcow2 -m 128
qemu-system-x86_64 -hda Core64-13.qcow2 -m 128
B-1. 利用Vriturlbox (on Window 10)產生vdi
- 新增虛擬機
類型: Linux
版本: Linux 2.6/3.x/4.x (32/64-bit)
記憶體: 128MB
立即建立虛擬機
檔案位置: Core64-13.vdi
檔案大小: 64MB
硬碟類型: VDI
動態分配
建立 - 設定虛機
儲存裝置:加入光碟影像檔CorePure64-13.0.iso,並調整Core-13.vdi至IDE - 執行從iso安裝Micro Core Linux至影像檔
- 測試產生的Core64-13.vdi
設定虛機: 移除光碟影像檔
開啟虛機,正常運作後,關閉虛機
B-2. 利用qemu-img將vdi轉換為qcow2
- qemu-img convert -f vdi -O qcow2 Core64-13.dvi Core64-13.qcow2
從iso安裝Micro Core Linux至影像檔
- Micro Core Linux開機後下載安裝程式
tce-load -wic tc-install - 執行安裝程式
sudo tc-install.sh
boot from [C]drom: c
Install type [F]rugal: f
Target 1. Whole Disk: 1
Disk for corepure64 2.sda: 2
Install a bootloader: y
Install Extensions:
Formatting Option 3.ext4: 3
Boot options:
Continue: y - 安裝完畢後關機
sudo halt
將Console轉導至serial port (ttyS0)
A. Method 1
sudo vi /opt/bootsync.sh
---
/usr/bin/sethostname box
/sbin/getty 38400 ttyS0 &
/opt/bootlocal.sh &
---
filetool.sh -b
B. Method 2
cd /mnt/sda1/tce/boot/extlinux
vi extlinux.conf---SERIAL 0 38400DEFAULT coreLABEL coreKERNEL /tce/boot/vmlinuzINITRD /tce/boot/core.gzAPPEND quiet waitusb=5:UUID="..." tce=UUID="..." console=ttyS0,38400 tz=GMT+8 nodhcp---
加入自動登入serial console
ttyS0::respawn:/sbin/getty -nl /sbin/autologin 38400 ttyS0
修改自動登入
tty1::respawn:/sbin/getty -nl /sbin/autologin 38400 tty1
為人工登入 (tc)
tty1::respawn:/sbin/getty -L 38400 tty1
cd /optmkdir tmpcd tmpzcat /mnt/sda1/tce/boot/core.gz | sudo cpio -i -H newc -dvi etc/inittab---自動登入serial console,人工登入tty console (tc)---# /sbin/getty respawn shell invocations for selected ttys.ttyS0::respawn:/sbin/getty -nl /sbin/autologin 38400 ttyS0tty1::respawn:/sbin/getty -L 38400 tty1---
修改etc/security,將 # ttyS0 行首的註解去除,允許serial登入console
vi etc/securetty---# For people with serial port consolesttyS0---
刪除 core.gz (corepure64.gz),並以重新打包的 core.gz (corepure64.gz)替代
rm /mnt/sda1/tce/boot/core.gzfind|sudo cpio -o -H newc | gzip -2 > /mnt/sda1/tce/boot/core.gz
關機即可得到qcow2影像檔
虛機使用serial連線console
使用QEMU
qemu-system-x86_64 "Core64-13.qcow2" -m 128 -serial telnet:localhost:12345,server,nowait
使用VirtualBox
連線serial console
QEMU模擬器無法輸入非小寫字母的解決方式
- sendkey shift-S
- sendkey esc
- sendkey shift-semicolon
- sendkey shift-1
2022年1月5日 星期三
Microsoft Automatic Update trusted CTL
Microsoft Automatic Update URL for trusted CTL
- The computer requires HTTP (TCP port 80) access and name resolution (TCP and UDP port 53) ability to contact ctldl.windowsupdate.com.
- Currently all the downloaded files require approximately 1.5 MB of space.