WRY

Where Are You?
You are on the brave land,
To experience, to remember...

0%

PVE 网络瞎折腾

PVE ENV

  • Linux pve 5.15.30-2-pve #1 SMP PVE 5.15.30-3 (Fri, 22 Apr 2022 18:08:27 +0200) x86_64 GNU/Linux
  • Proxmox-ve_7.2-1

Install

Refer to PVE Installation Document.

There is a step to prepare installation media, refer to this.

Setup Bridge

Please refer to Linux 虚拟网络设备 in 《Docker 容器与容器云》读书笔记 之 容器.

In short, you can think of Linux Bridge as a switch and think of an interface as a cable. Add interface to the bridge and another link this interface to your router, as shown below.

image-20220605215506031

Network configure as shown below and configure files will show in Setup AC200 Wireless AP section.

image-20220605215656288

The eno1 interface has a problem, as shown below:

1
2
e1000e 0000:00:19.0 eno1: Detected Hardware Unit Hang:
...........

It can be solved by below script.

1
$ ethtool -K eno1 tx off rx off

tx: Specifies whether TX pause should be enabled.

rx: Specifies whether RX pause should be enabled.

Install Basic Software

1
apt install -y net-tools

Setup AC200 Wireless AP

There are three steps to setup wireless access point (WAP) with Hostapd. Refer Link.

Install Software

1
2
$ apt-get install hostapd
$ apt-get install bridge-utils

Configure Hostapd

Edit /etc/default/hostapd, uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration and hostpad will be started during system boot.

1
DAEMON_CONF="/etc/hostapd/hostapd.conf"

Touch /etc/hostapd/hostapd.conf, input below content. (This configure works with AC200)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## interface name, you can see it with ifconfig command
interface=wlp5s0
## connect to which bridge
bridge=vmbr0
## driver
driver=nl80211
## This is a very important configure, but I am not clear about it yet.
## (IN == INDIA, UK == United Kingdom, US == United Stats and so on ) ###
country_code=DE
## wifi name
ssid=AP
## a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g
hw_mode=b
## This configure is related with country_code
channel=10
## not very clear.
ieee80211d=1
ieee80211n=0
ieee80211ac=1
wmm_enabled=1
## password
wpa=2
wpa_passphrase=17854160892JT

## not very clear
## Key management algorithms ##
wpa_key_mgmt=WPA-PSK
## Set cipher suites (encryption algorithms) ##
## TKIP = Temporal Key Integrity Protocol
## CCMP = AES in Counter mode with CBC-MAC
wpa_pairwise=TKIP
rsn_pairwise=CCMP
## Shared Key Authentication ##
auth_algs=1
## Accept all MAC address ###
macaddr_acl=0

Control command

1
2
3
$ /etc/init.d/hostapd start
$ /etc/init.d/hostapd stop
$ /etc/init.d/hostapd restart

Configure Network Interfaces

Edit /etc/network/interfaces, modify and set it to as shown below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!

auto lo
iface lo inet loopback

auto eno1
iface eno1 inet manual

auto enx000ec6ca56f3
iface enx000ec6ca56f3 inet manual

auto vmbr0
iface vmbr0 inet static
address 192.168.1.30/24
gateway 192.168.1.1
bridge-ports eno1 enx000ec6ca56f3
bridge-stp off
bridge-fd 0

auto wlp5s0
iface wlp5s0 inet manual

What I have changed at beginning has been deleted.

Control command

1
$ service networking restart

Other

You maybe have a driver trouble. You can refer official documents to install related driver.

Complete discussion is in this link.

OpenWrt in PVE

OpenWrt is a free open source route system.

  • Download LEDE OpenWrt IMG URL and get an img.
  • Create VM
    • OS: Do not use any media
    • System: Machine: q35
    • Disk: no disks
    • CPU: Type: Host
    • Network: Model: VirtIO
  • Add Hard Disk
    • Use command qm importdisk <VM ID> <Path to IMG> <Storage> to add disk.
      • Eg: qm importdisk 100 openwrt-x64-R22.5.5-generic-squashfs-combined-efi.img WDCDisk
    • Change disk's Bus/Device to SATA
  • Change Boot Order
    • Mark new disk enabled in Options -> Boot Order.
  • Start VM
  • Change IP
    • Use command ifconfig br-lan 192.168.xxx.xxx to set this vm IP.
  • Use the IP set just to access the website.

You will see screenshoot as shown below.

image-20220606234041449

C90 Machine

Bios Config

  • Enable auto start after plugin in.

    At CMOS Setup --> Chipset --> South Bridge, set Restore AC Power Loss Power On.

  • Enable usb3

    At CMOS Setup --> Chipset --> South Bridge --> USB Configuration, set USB 2.0(EHCI) Support Disabled and XHCI Mode Enabled.

Setup

Boot on the C92 system using a U disk with simple linux installed. Use dd command install openWRT on the disk in C92 as shown below. The img file is the same one used in PVE, refer link.

1
dd if=openwrt.img of=/dev/sda bs=4M

Performance Test

CPU

Test Command

1
2
3
$ openssl speed -evp aes-256-gcm   # AES
$ openssl speed -evp chacha20-poly1305 # ChaCha20-poly1305
$ /etc/coremark.sh && cat /etc/bench.log # Coremark

Test Result

(CpuMark : 16798.301081 Scores)

image-20220618201336550

NetWork

Test Network speed.

1
2
3
4
$ opkg update
$ opkg install iperf3 iftop
$ iperf3 -s # server
$ iperf3 -c 192.168.1.250 -P 5 # client P: thread number

Test Result

1
2
[SUM]   0.00-10.00  sec  1.07 GBytes   922 Mbits/sec    0             sender
[SUM] 0.00-10.00 sec 1.06 GBytes 914 Mbits/sec receiver

OpenWrt in X86 Machine

This version mentioned below is not what I want.

Refer to 易有云 to install iStoreOS.

Software rufus mentioned in the above document can be replaced by balena Etcher.

Ubuntu Set Route

1
2
$ sudo route add default gw 192.168.1.250
$ sudo route -nNvee # 查看路由表

refer link.

Mac

1
$ netstat -nr  # list route in mac

Reference

image-20220624184921476