From 0f5ca1e0918ee7ccede69692282c664b605b9613 Mon Sep 17 00:00:00 2001 From: minyub Date: Mon, 15 Jan 2024 19:41:46 +0900 Subject: [PATCH] Move and rename wiki files --- docs/wiki/install-dpdk.md | 82 ++++++++++++++++++ docs/wiki/install-gui-on-ubuntu.md | 14 ++++ docs/wiki/install-kvm.md | 20 +++++ docs/wiki/install-mail-server.md | 89 ++++++++++++++++++++ docs/wiki/install-minicom-on-mac.md | 20 +++++ docs/wiki/install-nox.md | 53 ++++++++++++ docs/wiki/install-onos.md | 79 +++++++++++++++++ docs/wiki/install-openjdk-on-mac.md | 16 ++++ docs/wiki/l2tp-over-ipsec.md | 126 ++++++++++++++++++++++++++++ 9 files changed, 499 insertions(+) create mode 100644 docs/wiki/install-dpdk.md create mode 100644 docs/wiki/install-gui-on-ubuntu.md create mode 100644 docs/wiki/install-kvm.md create mode 100644 docs/wiki/install-mail-server.md create mode 100644 docs/wiki/install-minicom-on-mac.md create mode 100644 docs/wiki/install-nox.md create mode 100644 docs/wiki/install-onos.md create mode 100644 docs/wiki/install-openjdk-on-mac.md create mode 100644 docs/wiki/l2tp-over-ipsec.md diff --git a/docs/wiki/install-dpdk.md b/docs/wiki/install-dpdk.md new file mode 100644 index 0000000..89fed64 --- /dev/null +++ b/docs/wiki/install-dpdk.md @@ -0,0 +1,82 @@ +--- +title: Install DPDK +author: Jaehyun Nam +date: 2022-07-18 +category: default +layout: post +--- + +## Test Environment + +``` +# Tested on Ubuntu 16.04 +``` + +## How to install DPDK + +- Check if DPDK is supported + + ``` + sudo ethtool -i [NIC] + (http://dpdk.org/doc/nics) + ``` + +- Configure CPU and memory + + ``` + sudo vi /etc/default/grub + ``` + + ``` + GRUB_CMDLINE_LINUX_DEFAULT="default_hugepagesz=1G hugepagesz=1G hugepages=4" (1GB huge page setup) + GRUB_CMDLINE_LINUX_DEFAULT="default_hugepagesz=2M hugepagesz=2M hugepages=2048" (2MB huge page setup) + ``` + + ``` + sudo update-grub + ``` + + ``` + echo 'vm.nr_hugepages=4' >> /etc/sysctl.conf (1GB huge page setup) + echo 'vm.nr_hugepages=2048' >> /etc/sysctl.conf (2MB huge page setup) + ``` + + ``` + sudo reboot + ``` + + ``` + grep -i huge /proc/meminfo + ``` + +- Install DPDK + + ``` + echo "export DPDK_DIR=/usr/src/dpdk-stable-17.11.3" >> ~/.bashrc + echo "export DPDK_TARGET=x86_64-native-linuxapp-gcc" >> ~/.bashrc + echo "export DPDK_BUILD=\$DPDK_DIR/\$DPDK_TARGET" >> ~/.bashrc + . ~/.bashrc + ``` + + ``` + sudo apt-get install -y make coreutils gcc-multilib python libnuma-dev + curl -LO http://fast.dpdk.org/rel/dpdk-17.11.3.tar.xz + sudo tar xvfJ dpdk-17.11.3.tar.xz -C /usr/src/ + ``` + + ``` + # install DPDK either manually + cd $DPDK_DIR + sudo make install T=$DPDK_TARGET DESTDIR=install + ``` + + ``` + # or using a DPDK-setup script + cd $DPDK_DIR/usertools + sudo ./dpdk-setup.sh + ``` + + ``` + sudo reboot + ``` + diff --git a/docs/wiki/install-gui-on-ubuntu.md b/docs/wiki/install-gui-on-ubuntu.md new file mode 100644 index 0000000..ea42520 --- /dev/null +++ b/docs/wiki/install-gui-on-ubuntu.md @@ -0,0 +1,14 @@ +--- +title: Install Desktop (GUI) on Ubuntu Server +author: Jaehyun Nam +date: 2022-07-18 +category: default +layout: post +--- + +## How to install GUI on Ubuntu Server + +``` +sudo apt-get install --no-install-recommends ubuntu-desktop +``` + diff --git a/docs/wiki/install-kvm.md b/docs/wiki/install-kvm.md new file mode 100644 index 0000000..25dfbfe --- /dev/null +++ b/docs/wiki/install-kvm.md @@ -0,0 +1,20 @@ +--- +title: Install KVM +author: Jaehyun Nam +date: 2022-07-18 +category: default +layout: post +--- + +## Install KVM on Ubuntu 16.04 / 18.04 + +``` +sudo apt-get install -y qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virt-manager +``` + +## Install KVM on Ubuntu 20.04 + +``` +sudo apt-get install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager +``` + diff --git a/docs/wiki/install-mail-server.md b/docs/wiki/install-mail-server.md new file mode 100644 index 0000000..52e7df3 --- /dev/null +++ b/docs/wiki/install-mail-server.md @@ -0,0 +1,89 @@ +--- +title: Install Mail Server (iRedMail) +author: Jaehyun Nam +date: 2022-07-18 +category: default +layout: post +--- + +## How to set up iRedMail + +- Configure Hostname + +``` +hostnamectl set-hostname mail.example.com +vi /etc/hosts +``` + +``` +127.0.0.1 mail.example.com mail +``` + +- Download iRedMail package + +``` +wget https://github.com/iredmail/iRedMail/archive/1.4.0.tar.gz +``` + +- Install iRedMail on Ubuntu + +``` +tar xvfz 1.4.0.tar.gz +cd iRedMail-1.4.0 +chmod +x iRedMail.sh +sudo ./iRedMail.sh +``` + +``` +[ Welcome and thanks for your use ] -> +[ Default mail storage path ] -> (if you need, you can change the path) +[ Preferred web server ] -> Nginx +[ Choose preferred backend used to store mail accounts ] -> PostgresSQL +[ Your first mail domain name ] -> mail.example.com (change it to yours) +[ Password for the mail domain administrator ] -> PASSWORD +[ Optional components ] -> SOGo, netdata, iRedAdmin, Fail2ban + +Continue? [y|N] y + +< Question > ... with SSHD ports: xx. [Y|n] +``` + +``` +sudo reboot +``` + +- Install SSL certificate + +``` +sudo cp [public key, fullchain.pem] /etc/ssl/certs/iRedMail.crt +sudo cp [private key, privkey.pem] /etc/ssl/private/iRedMail.key +``` + +``` +sudo reboot +``` + +- Access iRedMail Admin panel + +``` +https://mail.example.com/iredadmin/ + +postmaster@mail.example.com +PASSWORD + +[Login] + +... +``` + +- Access iRedMail webmail + +``` +# Common +https://mail.example.com +# RoundCube +https://mail.example.com/mail/ +# SOGo +https://mail.example.com/SOGo +``` + diff --git a/docs/wiki/install-minicom-on-mac.md b/docs/wiki/install-minicom-on-mac.md new file mode 100644 index 0000000..0a7cd6e --- /dev/null +++ b/docs/wiki/install-minicom-on-mac.md @@ -0,0 +1,20 @@ +--- +title: Install Minicom on Mac OS X +author: Jaehyun Nam +date: 2022-07-18 +category: default +layout: post +--- + +## Prerequisite + +``` +ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +``` + +## How to install SSHPASS + +``` +brew install minicom +``` + diff --git a/docs/wiki/install-nox.md b/docs/wiki/install-nox.md new file mode 100644 index 0000000..2fea1e0 --- /dev/null +++ b/docs/wiki/install-nox.md @@ -0,0 +1,53 @@ +--- +title: Install NOX +author: Jaehyun Nam +date: 2022-07-18 +category: default +layout: post +--- + +## Test Environment + +``` +# Tested on Ubuntu 14.04 +# Requirement: gcc-4.6 and g++-4.6 +``` + +## How to install NOX + +``` +cd ~ +wget https://boanlab.com/downloads/sdn/nox.tar.gz +tar xvfz nox.tar.gz +``` + +``` +mv nox/run_nox.sh ~ +sudo apt-get -y install gcc-4.6 g++-4.6 autoconf +sudo mv /usr/bin/gcc /usr/bin/gcc.bak +sudo ln -s /usr/bin/gcc-4.6 /usr/bin/gcc +sudo mv /usr/bin/g++ /usr/bin/g++.bak +sudo ln -s /usr/bin/g++-4.6 /usr/bin/g++ +``` + +``` +sudo apt-get -y install python-dev libtbb-dev libssl-dev libtool twisted* libbz2-dev libicu-dev +``` + +``` +cd ~/nox/boost-1.46.1/boost_1_46_1 +./bootstrap.sh --exec-prefix=/usr/local +./bjam +sudo ./bjam install +sudo ldconfig +``` + +``` +cd ~/nox/nox +./boot.sh +mkdir build +cd build +../configure +make +``` + diff --git a/docs/wiki/install-onos.md b/docs/wiki/install-onos.md new file mode 100644 index 0000000..3504813 --- /dev/null +++ b/docs/wiki/install-onos.md @@ -0,0 +1,79 @@ +--- +title: Install ONOS +author: Jaehyun Nam +date: 2022-07-18 +category: default +layout: post +--- + +## Test Environment + +``` +# Tested on Ubuntu 18.04 +# CPU: 8, Memory: 8GB +``` + +## How to install ONOS + +``` +wget -P /tmp/ https://boanlab.com/downloads/jdk/jdk-8u202-linux-x64.tar.gz +``` + +``` +sudo mkdir -p /usr/lib/java +sudo tar xvfz /tmp/jdk-8u202-linux-x64.tar.gz -C /usr/lib/java/ +``` + +``` +echo "PATH=$PATH:/usr/lib/java/jdk1.8.0_202/bin" | sudo tee -a /etc/environment +echo "JAVA_HOME=/usr/lib/java/jdk1.8.0_202/" | sudo tee -a /etc/environment +echo "JRE_HOME=/usr/lib/java/jdk1.8.0_202/jre" | sudo tee -a /etc/environment +``` + +``` +. /etc/environment +. ~/.bashrc +``` + +``` +sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/java/jdk1.8.0_202/bin/java" 1 +sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/java/jdk1.8.0_202/bin/javac" 1 +sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/java/jdk1.8.0_202/bin/javaws" 1 +``` + +``` +sudo apt-get update +sudo apt-get -y install git zip unzip curl python +``` + +``` +echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list +curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - +``` + +``` +sudo apt-get update +sudo apt-get -y install bazel bazel-1.2.1 +``` + +``` +cd ~ +git clone -b onos-1.15 https://github.com/opennetworkinglab/onos +``` + +``` +cat << EOF >> ~/.bashrc +export ONOS_ROOT="$(pwd)/onos" +source \$ONOS_ROOT/tools/dev/bash_profile +EOF +``` + +``` +. ~/.bashrc +``` + +``` +cd ~/onos +bazel build onos +``` + diff --git a/docs/wiki/install-openjdk-on-mac.md b/docs/wiki/install-openjdk-on-mac.md new file mode 100644 index 0000000..3849a79 --- /dev/null +++ b/docs/wiki/install-openjdk-on-mac.md @@ -0,0 +1,16 @@ +--- +title: Install OpenJDK on Mac OS X +author: Jaehyun Nam +date: 2022-07-18 +category: default +layout: post +--- + +## Installation + +``` +brew tap adoptopenjdk/openjdk +brew search jdk +brew install --cask adoptopenjdk11 +``` + diff --git a/docs/wiki/l2tp-over-ipsec.md b/docs/wiki/l2tp-over-ipsec.md new file mode 100644 index 0000000..aad4082 --- /dev/null +++ b/docs/wiki/l2tp-over-ipsec.md @@ -0,0 +1,126 @@ +--- +title: Install L2TP over IPSec +author: Jaehyun Nam +date: 2022-07-18 +category: default +layout: post +--- + +## Installation + +``` +sudo apt-get update +sudo apt-get -y install strongswan xl2tpd +``` + +## Configuration + +``` +sudo vi /etc/ipsec.conf +``` + +``` +config setup + +conn %default + ikelifetime=60m + keylife=20m + rekeymargin=3m + keyingtries=1 + keyexchange=ikev1 + authby=secret + ike=aes128-sha1-modp1024,3des-sha1-modp1024! + esp=aes128-sha1-modp1024,3des-sha1-modp1024! + +conn L2TP-PSK + keyexchange=ikev1 + left=%defaultroute + auto=add + authby=secret + type=transport + leftprotoport=17/1701 + rightprotoport=17/1701 + # set this to the ip address of your vpn server + right=[VPN Server IP Address] +``` + +``` +sudo vi /etc/ipsec.secrets +``` + +``` +: PSK "your_pre_shared_key" +``` + +``` +sudo vi /etc/xl2tpd/xl2tpd.conf +``` + +``` +[lac myVPN] +lns = [VPN Server IP Address] +ppp debug = yes +pppoptfile = /etc/ppp/options.l2tpd.client +length bit = yes +``` + +``` +sudo vi /etc/ppp/options.l2tpd.client +``` + +``` +ipcp-accept-local +ipcp-accept-remote +refuse-eap +require-mschap-v2 +noccp +noauth +logfile /var/log/xl2tpd.log +idle 1800 +mtu 1410 +mru 1410 +defaultroute +usepeerdns +debug +connect-delay 5000 +name your_user_name +password your_password +``` + +``` +sudo mkdir -p /var/run/xl2tpd +sudo touch /var/run/xl2tpd/l2tp-control +sudo service strongswan restart +sudo service xl2tpd restart +sudo service ipsec restart +``` + +## Connection + +``` +ipsec up L2TP-PSK +sudo bash -c 'echo "c myVPN" > /var/run/xl2tpd/l2tp-control' +sleep 10 +ip a +``` + +## Routing + +``` +sudo ip route add [specific IP address to connect via VPN] via $(ip address show dev ppp0 | grep -Po '(?<=peer )(\b([0-9]{1,3}\.){3}[0-9]{1,3}\b)') dev ppp0 +``` + +## Disconnection + +``` +sudo bash -c 'echo "d myVPN" > /var/run/xl2tpd/l2tp-control' +ipsec down L2TP-PSK +``` + +## Debugging + +``` +dmesg +less /var/log/xl2tpd.log +``` +