Categories
Networking

Create MikroTik image

Download the raw disk image archive from Mikrotik

wget https://download2.mikrotik.com/routeros/6.42rc30/chr-6.42rc30.img.zip

Unzip the archive

unzip chr-6.42rc30.img

Expand the image size to 1GB

truncate --size=1G chr-6.42rc30.img

Create the image archive for Google GCE

mv chr-6.42rc30.img disk.raw tar -Sczf chr-6.42rc30-image.tar.gz disk.raw

To upload in Google cloud

Create a bucket to store image archives

gsutil mb gs://cloud-hosted-router-images

Copy the new image to the bucket

gsutil cp chr-6.42rc30.tar.gz gs://cloud-hosted-router-images

Create a Google cloud image

Create an image for GCE from the archive

gcloud compute images create "routeros"
--family=cloud-hosted-router
--description "Mikrotik Cloud Hosted Router (CHR) for running as a virtual machine."
--source-uri "https://storage.googleapis.com/cloud-hosted-router-images/chr-6.42rc30.tar.gz"

Create MikroTik instance

Create an instance

gcloud compute instances create "chr-1"
--zone "us-central1-c"
--machine-type "f1-micro"
--image-family=cloud-hosted-router

For Mac

For truncate:

brew install truncate
truncate -s 1G chr-6.42rc30.img

For gnu-tar:

brew install gnu-tar
gtar -Sczf chr-6.42rc30.tar.gz disk.raw
Categories
Switch

Zyxel switch basic setup

Tested on GS2210

Setup DHCP

GS2210# configure 
GS2210(config)# vlan 1 
GS2210(config-vlan)# ip address default-management dhcp-bootp 
GS2210(config-vlan)# exit 
GS2210(config)# exit 
GS2210# write memory 

Setup static IP Address

GS2210# configure 
GS2210(config)# vlan 1 
GS2210(config-vlan)# ip address default-management 192.168.1.10 255.255.255.0
GS2210(config-vlan)# ip address default-gateway 192.168.1.1
GS2210(config-vlan)# exit 
GS2210(config)# exit 
GS2210# write memory 

Web Interface

From the above static IP Address setup, the web interface IP address is 192.168.1.10

URL: http://192.168.1.10

The default username and password Zyxel switch

Username: admin

Password: 1234

Basic Zyxel commands

GS2210# show version
GS2210# show ip
GS2210# show vlan 1
GS2210# show interfaces status
GS2210# show running-config page

Zyxel Configure VLAN command

GS2210# config
GS2210(config)# vlan 1 
GS2210(config-vlan)# name NAME
GS2210(config-vlan)# fixed 1
GS2210(config-vlan)# untagged 1
GS2210(config-vlan)# exit 
GS2210(config)# exit 
GS2210# write memory 

Zyxel Configure Interface command

GS2210# config
GS2210(config)# interface port-channel 1
GS2210(config-interface)# pvid 100
GS2210(config-interface)# exit 
GS2210(config)# exit 
GS2210# write memory 
Categories
Networking

Mac OS trunked VLAN Command line

VLAN Tagging in Terminal

ifconfig
sudo ifconfig vlan0 create
sudo ifconfig vlan0 vlan [VLAN-TAG] vlandev en0
sudo ipconfig set vlan0 DHCP

Note: [VLAN-TAG] = VLAN ID

Optional: Set static IP address

sudo ifconfig vlan0 inet 192.168.0.20 netmask 255.255.255.0

Set default gateway

sudo route add default 192.168.0.1

Delete vlan

sudo ifconfig vlan0 destroy
Categories
Networking

Opening a port on Mac

You could open a port by listening to the port

nc -l [PORT NUMBER]

Considering port is 500,

nc -l 500
Categories
Networking

Routing Basic Commands

sudo route add 192.168.1.0/24 [DEFAULT GATEWAY]
sudo route add 192.168.1.0/24 192.168.1.1

Debug Routing

netstat -nr

Mac

ifcoufig

Windows

ipconfig -all