King Zone - vlan
type: channel
link: https://kingtam.win/tag/vlan/
items: Configuring VLANs on a Host for Proxmox VE
items: Setting a Static IP address in Linux
items: ZeroTier 新增 Moon節點

Configuring VLANs on a Host for Proxmox VE
type: item
date: 2023-03-24T14:40:00+08:00
description: Configuring VLANs on a Host for Proxmox VEConfiguring VLANs on a Host for Proxmox VE.pngPic from unsplashIn today's increasingly complex networking environments, Virtual Local Area Networks (VLANs) have become a crucial tool for managing network traffic and ensuring optimal performance. This blog post provides a step-by-step guide on configuring VLANs on a host for Proxmox Virtual Environment (VE), a popular open-source virtualization platform.Why use VLANs with Proxmox VE?VLANs allow you to segregate network traffic into isolated broadcast domains, improving security and reducing network congestion. By configuring VLANs on a Proxmox VE host, you can:Improve network performance by reducing broadcast traffic.Enhance security by isolating sensitive virtual machines (VMs) and containers.Simplify network management and troubleshooting.PrerequisitesBefore proceeding, ensure you have the following:A Proxmox VE host installed and configured.A managed network switch that supports VLAN tagging (IEEE 802.1Q).Procedures:This guide provides procedures for configuring VLANs on a host for Proxmox Virtual Environment (VE). This guide provides instructions for configuring VLANs, with separate sections for both the command line interface (CLI) and the graphical user interface (GUI).The Command Line Interface (CLI) Configuration Step 1: A Proxmox VE host configurration Edit configuration file for the VLAN interface in /etc/network/interfaces.vi /etc/network/interfacesThe eno1 is a physical network interface and vmbr0 is a Linux Bridge.the following configuration, adjusting the address and gateway parameters as neededUse VLAN 2 for the Proxmox VE management IP with VLAN aware Linux bridgeauto lo iface lo inet loopback iface eno1 inet manual auto vmbr0.2 iface vmbr0.2 inet static address 10.2.2.254/24 gateway 10.2.2.1 auto vmbr0 iface vmbr0 inet static bridge-ports eno1 bridge-stp off bridge-fd 0 bridge-vlan-aware yes bridge-vids 1-4094Save the file and exit the editor use :wqApply the…

Setting a Static IP address in Linux
type: item
date: 2022-03-18T13:00:00+08:00
description: Setting a Static IP address in LinuxSetting a static IP address in Linux.pngIntroduction: Usually, IP addresses are dynamically assigned by the router's DHCP server on most network devices. But using a static IP address on the server makes the provided services more stable. If the DHCP server is not working, it will affect the computers in the local area network to obtain IP addresses, thereby affecting access to services, while servers with static IP addresses are not affected, so static IP is also necessary (on devices providing services).Table of Contents: Configuring a static IP address in RHEL/CentOS/Fedora:Setting a static IP address in Debian / Ubuntu (versions prior to 17.10):Setting a static IP address in Ubuntu (newer versions):Setting up VLAN in Ubuntu:Setting up Bridge in Debian:Bridge without VLANBridge with VLANConfiguring a static IP address in RHEL/CentOS/Fedora: To set a static IP address in RHEL / CentOS / FedoraFirst check the local network interface name:2022-03-18_121212.pngThe above figure shows that the network interface name of the local machine is eth0, representing the edited network file ifcfg-eth0Use nano or vim to edit:vim /etc/sysconfig/network-scripts/ifcfg-eth0Make changes to the ifcfg-eth0 file based on your own network:DEVICE="eth0" BOOTPROTO="static" DNS1="8.8.8.8" DNS2="1.1.1.1" GATEWAY="192.168.0.1" HOSTNAME="linux.kingtam.win" HWADDR="00:19:99:A4:46:AB" IPADDR="192.68.0.100" NETMASK="255.255.255.0" NM_CONTROLLED="yes" ONBOOT="yes" TYPE="Ethernet" UUID="8105c095-799b-4f5a-a445-c6d7c3681f07"You need to edit the following settings:BOOTPROTO is dhcp (default) or static (static)DNS1 and DNS2 can use public DNS services such as 8.8.8.8, 1.1.1.1Gateway (GATEWAY) is the IP of the router or firewallHost name (HOSTNAME) customizableNetwork mask (NETMASK) is usually 255.255.255.0 (/24) modify according to your own network parametersIP address (IPADDR) the local IP addressONBOOT whether to start automatically is yes or noThen edit: resolve.…

ZeroTier 新增 Moon節點
type: item
date: 2021-09-29T11:03:00+08:00
description: ZeroTier 新增 Moon節點zerotier_logo_black.png前言:ZeroTier實在是是太優秀，設定簡單，可以應用於多個網絡環境互通(我理解為內網穿透)。因為ZeroTier根伺服器在海外，高峰用量時段連線會有不穩定，所以搭建Moon節點可以作為一個中轉站，彌補線路的的不足。條件限制:在已使用的ZeroTier 點對點虛擬網絡內建立Moon節點節點伺服器需要公網連線及開通 9993 端口(PORT)開始部署:在公網的伺服器上安裝ZeroTier2021-09-27_114407.pngsudo curl -s https://install.zerotier.com | sudo bash在Zerotier控制中心 查看NETWORK ID2021-09-27_114509.png在公網的伺服器上加入到ZeroTier虛擬網絡2021-09-27_114933.pngsudo zerotier-cli join 565799d8fxxxxxxx在Zerotier控制中心 允許加入2021-09-27_115053.png選取後，可獲得分配的虛擬網絡IP地址配置Moon進入到ZeroTier所在的目錄cd /var/lib/zerotier-one/生成 moon.json 配置文件zerotier-idtool initmoon identity.public >> moon.json編輯 moon.json 配置文件2021-09-27_115538.pngsudo vi moon.json將配置文件中的 "stableEndpoints": [] 修改成 "stableEndpoints": ["PublicIP/9993"]，將 PublicIP 替換成雲服務器的公網IP。建立 000000*.moon 簽名文件：sudo zerotier-idtool genmoon moon.json新建 moons.d 目錄，並將 000000*.moon 文件移動到其目錄下：sudo mkdir moons.d sudo mv 000000*.moon moons.d* 代表節點id，我這裡00000019b9e0bc9d.moon。重啟ZeroTier服務sudo systemctl restart zerotier-one(ZeroTier客戶端)加入到Moon節點Linux系統添加Moon節點查看可加入的節點id2021-09-28_083920.pngsudo zerotier-cli peers | grep -i 'moon'這裡查看到的節點是19b9e0bc9d加入到Moon節點2021-09-28_083138.pngsudo zerotier-cli orbit 19b9e0bc9d 19b9e0bc9d重啟ZeroTier服務使之生效/etc/init.d/zerotier restart或者sudo systemctl restart zerotier-oneWindows系統添加Moon節點系統管理員身份開啟PowerShell2021-09-27_120257.png查看可加入的節點id2021-09-28_113719.pngzerotier-cli.bat peers | Select-String "MOON"查看到的節點是19b9e0bc9d加入到Moon節點2021-09-27_120355.pngzerotier-cli.bat orbit 19b9e0bc9d 19b9e0bc9d重啟電腦使之ZeroTier服務生效手動添加Moon節點在ZeroTier 程序的目錄建立moons.d資料夾，將 000000*.moon 簽名文件復制到該資料夾中。以Windows10為範例:Windows10的 ZeroTier 目錄位置: %PROGRAMDATA%\ZeroTier\One2021-09-29_104330.png新增moons.d目錄2021-09-29_104654.png將Moon節點的簽名文件 000000*.moon 復制到該目錄中。重啟電腦或者服務使之ZeroTier服務生效[tip type="red"]以下是各個系統下 ZeroTier 目錄位置 ：Macintosh: /Library/Application Support/ZeroTier/One Linux: /var/lib/zerotier-one FreeBSD/OpenBSD: /var/db/zerotier-one[/tip]參考資料:ZeroTier 搭建 moon 服務器簡單搭建 Zerotier Moon 為虛擬網絡加速Private Root Servers