“-l <IP地址:端口>”选项指定了超级节点的监听 IP 地址和端口号。为了冗余,你可以指定最多两个不同的超级节点(比如 -l <超级节点 A> -l <超级节点 B>)。
“-p <端口>” 边缘节点暴露端口
“-m ”给 TAP 接口分配了一个静态的 MAC 地址。不使用这个参数的话,edge 命令将会随机生成一个 MAC 地址。事实上,为一个 VPN 接口强制指定一个静态的 MAC 地址是被强烈推荐的做法。否则,比如当你在一个节点上重启了 edge 守护程序的时候,其它节点的 ARP 缓存将会由于新生成的 MAC 地址而遭到污染,它们将不能向这个节点发送数据,直到被污染的 ARP 记录被消除。
ubuntu@master01:~/project/n2n$ ip r
default via 172.16.0.1 dev eth0 proto dhcp src 172.16.0.6 metric 10010.233.233.0/24 dev edge0 proto kernel scope link src 10.233.233.1
1
2
3
ubuntu@master02:~/project/n2n$ ip r
default via 172.16.0.1 dev eth0 proto dhcp src 172.16.0.6 metric 10010.233.233.0/24 dev edge0 proto kernel scope link src 10.233.233.2
ping测试
1
2
3
4
5
6
7
8
9
10
11
12
13
14
ubuntu@master01:~/project/n2n$ ping -c 1 10.233.233.2
PING 10.233.233.2 (10.233.233.2) 56(84) bytes of data.
64 bytes from 10.233.233.2: icmp_seq=1ttl=64time=39.1 ms
--- 10.233.233.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 39.125/39.125/39.125/0.000 ms
ubuntu@master01:~/project/n2n$ ping -c 1 10.233.233.3
PING 10.233.233.3 (10.233.233.3) 56(84) bytes of data.
64 bytes from 10.233.233.3: icmp_seq=1ttl=64time=39.1 ms
--- 10.233.233.3 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 39.138/39.138/39.138/0.000 ms
查看vlan中的节点
1
2
3
4
5
6
7
8
9
10
11
12
13
ubuntu@master01:~/project/n2n$ sudo nmap -sP 10.233.233.0-255
Starting Nmap 7.60 ( https://nmap.org ) at 2019-08-25 12:00 CST
Nmap scan report for 10.233.233.2
Host is up (-0.16s latency).
MAC Address: 6E:30:77:C9:4F:BF (Unknown)Nmap scan report for 10.233.233.3
Host is up (-0.11s latency).
MAC Address: 82:E9:FC:BE:E9:A7 (Unknown)Nmap scan report for VM-0-6-ubuntu (10.233.233.1)Host is up.
Nmap done: 256 IP addresses (3 hosts up) scanned in 5.31 seconds