如何解决n2n为超级节点和边缘设置DHCP,获得未知主机
我在AWS上有两个ubuntu实例,一个是 supernode ,另一个是使用n2n的 edge 。我试图连接也托管在超级节点上的dhcp服务器,以便在加入时可以自动分配边缘的ip。
在超级节点上,我安装了:
sudo apt install isc-dhcp-server
我的/etc/dhcp/dhcpd.conf
:
ubuntu@ip-172-31-31-176:~$ cat /etc/dhcp/dhcpd.conf
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# Attention: If /etc/ltsp/dhcpd.conf exists,that will be used as
# configuration file instead of this file.
#
# option definitions common to all supported networks...
authoritative;
default-lease-time 3600;
max-lease-time 7200;
subnet 192.168.233.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.233.1 192.168.233.255;
}
我的/etc/default/isc-dhcp-server
:
INTERFACES="A5TAP" #added by myself just to test if it helps
INTERFACESv4="A5TAP"
INTERFACESv6=""
在端口1234上运行超级节点:
supernode -l 1234
然后在超级节点上运行边缘以连接我的DHCP服务器:
sudo edge -r -d A5TAP -c a5 -k mykey -a 192.168.233.0 -l 127.0.0.1:1234
然后我重新启动dchp服务器:
sudo service isc-dhcp-server restart
检查日志以查看是否成功:
sudo systemctl status isc-dhcp-server.service
它是:
ubuntu@ip-172-31-31-176:~$ sudo systemctl status isc-dhcp-server.service
● isc-dhcp-server.service - ISC DHCP IPv4 server
Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-10-17 13:17:02 UTC; 13min ago
Docs: man:dhcpd(8)
Main PID: 1215 (dhcpd)
Tasks: 4 (limit: 1134)
Memory: 4.7M
CGroup: /system.slice/isc-dhcp-server.service
└─1215 dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf /etc/dhcp/dhcpd.conf A5TAP
Oct 17 13:17:02 ip-172-31-31-176 sh[1215]: PID file: /run/dhcp-server/dhcpd.pid
Oct 17 13:17:02 ip-172-31-31-176 dhcpd[1215]: Wrote 0 leases to leases file.
Oct 17 13:17:02 ip-172-31-31-176 sh[1215]: Wrote 0 leases to leases file.
Oct 17 13:17:02 ip-172-31-31-176 dhcpd[1215]: Listening on LPF/A5TAP/76:65:04:e2:60:00/192.168.233.0/24
Oct 17 13:17:02 ip-172-31-31-176 sh[1215]: Listening on LPF/A5TAP/76:65:04:e2:60:00/192.168.233.0/24
Oct 17 13:17:02 ip-172-31-31-176 dhcpd[1215]: Sending on LPF/A5TAP/76:65:04:e2:60:00/192.168.233.0/24
Oct 17 13:17:02 ip-172-31-31-176 sh[1215]: Sending on LPF/A5TAP/76:65:04:e2:60:00/192.168.233.0/24
Oct 17 13:17:02 ip-172-31-31-176 dhcpd[1215]: Sending on Socket/fallback/fallback-net
Oct 17 13:17:02 ip-172-31-31-176 sh[1215]: Sending on Socket/fallback/fallback-net
Oct 17 13:17:02 ip-172-31-31-176 dhcpd[1215]: Server starting service.
然后在我的边缘:
sudo edge -r -d A5TAP -c a5 -k mykey -a dhcp:192.168.233.0 -l my-super-node-ip:1234
但是我得到了unknown host
:
dhcp:192.168.233.0: Unknown host
ifconfig: `--help' gives usage information.
17/Oct/2020 13:17:20 [tuntap_linux.c: 38] Interface A5TAP has MAC 12:13:17:11:4F:AA
我尝试过的事情:
我试图ping -c 1 192.168.233.0
处于优势,但得到了
ubuntu@ip-172-31-21-149:~$ ping -c 1 192.168.233.0
Do you want to ping broadcast? Then -b. If not,check your local firewall rules.
因此,我尝试再次执行上述步骤,并将超级节点上的边缘(dhcp服务器)IP从192.168.233.0更改为192.168.233.1。结果相同。 我还手动将ip分配给了我的边缘以加入超节点,因此我可以测试192.168.233.1是否可以访问以及是否可以访问。 在边缘:
sudo edge -r -d A5TAP -c a5 -k mykey -a 192.168.233.2 -l super-node-ip:1234
ping -c 1 192.168.233.1
输出:
ubuntu@ip-172-31-21-149:~$ ping -c 1 192.168.233.1
PING 192.168.233.1 (192.168.233.1) 56(84) bytes of data.
64 bytes from 192.168.233.1: icmp_seq=1 ttl=64 time=0.328 ms
将dhcp服务器添加到我的超级节点和n2n中的边缘时,我做错了吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。