1
2
3
4
不知道从什么时候开始,从virtualbox官网下载的deb包,无法直接在ubuntu 20.04上升级安装。
首先是包依赖问题,索性卸载官方的vbox包,完全使用官方的安装包。
在官方的安装包安装以后,发现vboxdrv的内核驱动模块编译失败。
原因在于编译时候的magicversion不对,直接去修改/usr/include/linux/vermagic.h里面,将对应的magic值写死成当前的kernel magic值即可。
1
2
3
在这个过程中,因为一度怀疑kernel版本的问题,学会了手动切换ubuntu kernel的办法
wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh
可以用这个shell自动下载ubuntu的版本并安装。

  1. 在/etc/netplan/01-network-0manager-all.yaml里面制定了用network-manager来管理网络
  2. 在/etc/NetworkManager/NetworkManager.conf 里面,在[main]章节中,dns的值没有设置,这个在man NetworkManager.conf里面有说明,缺省的default值表示通过当前的active connections里面提供的nameservers来更新到 /etc/resolv.conf中。

2019-12-17更新:
nmcli d wifi connnect SSID password PASS

2020-5-7 更新:

1
2
3
4
5
6
7
在ubuntu 17以后,采用netplan作为网络配置,netplan本身很简单,但是ubuntu处理起来并不容易:
1. 看系统缺省的/etc/netplan下的配置,要关注的点是如果是rederer的选择,如果ubuntu的server版本,采用的是networkd,那配置的命令,基本按照netplan的配置命令走就行,如果renderer选择的是NetowrkManager,则一般是在ubuntu的desktop版本下,就不得不走原来nmcli的套路,ubuntu这几年,翻来覆去的修改这些配置,说明并不明确,造成很大的困扰。
2. 在nmcli下,如果要修改dns地址,就必须通过nmcli的命令走
首先通过nmcli c 列出当前的网络连接
然后nmcli modify "某个连接的名字" ipv4.dns "8.8.8.8"
修改完以后,需要systemctl NetworkManager restart才能生效。
这个配置恶心的地方显然在于,它把dns的配置,和某个具体的连接接口关联在一起。对于这么多年从/etc/resolv.conf修改dns配置的用户来说,这种配置十分的不友善。另外,为了迁就Desktop的nmcli,界面上的修改,也是无效的,这点最令人痛苦,没有命令行就不行了。

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
网络性能测试
服务器端
iperf3 -i 10 -s
-i 带宽更新间隔时间
-s listen as a server

客户端
iperf3 -i 10 -w 1M -t 60 -c [server hostname or ip address]
-w socket buffer size,影响TCP window.
-t 运行的时间
-c 连接指定服务器

测试UDP性能:
iperf -s -u
iperf -u -c server
没有加-b参数的时候,UDP模式缺省采用1MBit/s测试
iperf -u -c server -b 1000M 采用指定带宽测试
iperf -mc 192.168.10.12 测试MTU值
-m 探测MTU

磁盘IO性能测试
顺序读
fio -filename=./test.file -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -size=2G -numjobs=10 -runtime=60 -group_reporting -name=test_r

随机写
fio -filename=./test.file -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=16k -size=2G -numjobs=10 -runtime=60 -group_reporting -name=test_randw

顺序写
fio -filename=./test.file -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=16k -size=2G -numjobs=10 -runtime=60 -group_reporting -name=test_w

混合随机读写
fio -filename=./test.file -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=16k -size=2G -numjobs=10 -runtime=60 -group_reporting -name=test_r_w -ioscheduler=noop

内存速度测试
mbw -q -n 10000 256

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
服务器端
iperf3 -i 10 -s
-i 带宽更新间隔时间
-s listen as a server

客户端
iperf3 -i 10 -w 1M -t 60 -c [server hostname or ip address]
-w socket buffer size,影响TCP window.
-t 运行的时间
-c 连接指定服务器

测试UDP性能:
iperf -s -u
iperf -u -c server
没有加-b参数的时候,UDP模式缺省采用1MBit/s测试
iperf -u -c server -b 1000M 采用指定带宽测试
iperf -mc 192.168.10.12 测试MTU值
-m 探测MTU

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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|version|Traffic Class|Flow Label|Payload Length|Next Header|Hop Limit|Source|Destination|

version: 4bits: 0110 | 60 版本号
Traffice class: 8bits: 00 用于流量优先级控制
前0~4bits的控制含义如下:
0:No Specific traffic
1: background data
2: unattended data traffic
3: reserved
4: Attended bulk data traffic
5: Reserved
6: Interactive traffic
7: Control traffic
其他8~15分配给无须控制优先级的流量(指音频/视频)
Flow Lable: 20bits: 0xf394a
Payload Length:16bits: 71
Next Header: 8bits: TCP(6), UDP(17), ICMPv6(58)
Hot Limit: 8mits: 64: 和IPV4的TTL的含义相同
Source: 128-bits: IPV6
Destination: 128-bits: IPV6
extension headers:.....

https://www.jool.mx/en/intro-xlat.html jool是目前最好的NAT64项目, stateful
http://www.litech.org/tayga/ 曾经比较流行的NAT64解决方案,stateless
https://www.wrapsix.org/ 在用户层实现的NAT64项目,号称比TAYGA好, stateless


RFC2460 Internet Protocol Version 6 Specification (作废)
RFC2472 Definition of the Differentiated Service Field(DS Field) in the IPv4 and IPv6 Headers
RFC2675 IPv6 Jumbograms
RFC2766 Network Address Translation - Protocol Translation (NAT-PT)
RFC3056 Connection of IPv6 Domains via IPv4 Clouds
RFC3168 The Addition of Explicit Congestion Notification(ECN) to IP
RFC3260 New Terminology and Clarifications for DiffServ
RFC3697 IPv6 Flow Label Specification
RFC4302 IP Authentication Header
RFC4966 Reasons to Move the Network Address Translator - Protocol Translator(NAT-PT) to Historic Status
RFC5095 Deprecation of Type 0 Routing Headers in IPv6
RFC4727 Experimental Values in IPv4, IPv6, ICMPv4, ICMPv6, UDP, and TCP Headers
RFC5533 Shim6:Level 3 Multihoming Shim Protocol for IPv6
RFC6052 IPv6 Addressing of IPv4/IPv6 Translators (Jool Fully compliant)
RFC6144 Framework for IPv4/IPv6 Translation (废掉RFC2766) (Jool Fully compliant)
RFC6145 IP/ICMP Translation Algorithm(作废)
RFC6146 Stateful NAT64:Network Address and Protocol Translation from IPv6 Clients to IPv4 Servers (Jool Fully compliant)
RFC6147 DNS64:DNS Extensions for Network Address Translation from IPv6 Clients to IPv4 Servers
RFC6384 An FTP Application Layer Gateway (ALG) for IPv6-to-IPv4 Translation (Jool Not yet compliant)
RFC6437 IPv6 Flow Label Specification
RFC6554 An IPv6 Routing Header for Source Routes with the Routing Protocol for Low-Power and Lossy Networks(RPL)
RFC6586 Experiences from an IPv6-Only Network
RFC6791 Stateless Source Address Mapping for ICMPv6 Packet (In short, this RFC wants two things: A pool of IPv4 addresses and an ICMP header extension. Jool implements the former but not the latter.)
RFC6877 464XLAT: Combination of Stateful and Stateless Translation
RFC6980 Security Implications of IPv6 Fragmentation with IPv6 Neighbor Discovery
RFC7112 Implications of Oversized IPv6 Header Chains
RFC7113 Implementation Advice for IPv6 Router Advertisement Guard(RA-Guard)
RFC7401 Host Identity Protocol Version2(HIPv2)
RFC7422 Deterministic Address Mapping to Reduce Logging in Carrier-Grade NAT Deployments (ip6tables的 --mark plugin包含了这个功能)
RFC7755 SIIT-DC: Stateles IP/ICMP Translation for IPv6 Data Center Environments (Jool Fully compliant)
RFC7756 Stateless IP/ICMP Translation for IPv6 Internet Data Center Environments(SIIT-DC):Dual Translation Mode (Jool Fully compliant)
RFC7757 (EAM) Explicit Address Mapping for Stateless IP/ICMP Translation (扩展了RFC6145定义的算法,废掉6145的前奏)(Jool Fully compliant)
RFC7915 IP/ICMP Translation Algorithm(废掉RFC6145)(定义了SIIT) (Jool Fully compliant)
RFC8021 Generation of IPv6 Atomic Fragments Considered Harmful (提出了废掉RFC2460的动机) (Jool Fully compliant)
RFC8200 Internet Protocol, Version 6(IPv6) Specification (废掉RFC2460)

1
2
3
ubuntu-driver s devices
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo ubuntu-drivers autoinstall

同一张银行卡,可以捆绑三个不同的支付宝帐号;
同一个人,可以拥有6个不同的支付宝帐号;
如果支付宝帐号不捆绑银行卡,则只有在通过实名认证以后,才可以用余额支付;
实名认证的两种方法:1.通过银行卡认证,必须要知道银行卡绑定的手机号码;2.通过人脸识别认证,需要活人眨眼睛