2022年12月25日 星期日

Tiny Core Linux add IPv6 support

  1. tce-load  -wi ipv6-netfilter-5.15.10-tinycore.tcz
  2. sudo echo "modprobe ipv6" >> /opt/bootlocal.sh
  3. /usr/bin/filetool.sh -b

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 

For telnet
ssh -Nf -L local_port:gns3_server_ip:node_dstnat_port ssh_user@ssh_server
telnet localhost:local_port

User PuTTY to connect a node on remote GNS3 server through SSH tunnel


PuTTY --> SSH server --> GNS3 remote server 

(1) Command line:

C:\>putty username@proxy-ssh-server -L localport:gns3-remote-server:node-console-port

C:\>telnet localhost localport


(2) GUI
Open PuTTY 

-> 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:

  1. If the first interface is not ether1, do /system/reset-configuration, power off the machine, then upload the image to GNS3.
  2. 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:
oob.rsc
/ip vrf add name=oob interface=ether1 /ip service set winbox vrf=oob /ip service set www vrf=oob

in /ip firewall managle, the output chain with new-routing-mark will not work if there is no route in the main table; use routing rule instead.