Итак, я наконец решил использовать свой ноутбук и сделать из него маршрутизатор Ubuntu Server. У меня есть две сетевые карты: wlp1s0, используемый как WiFi для моей WAN, и мой ethernet enp2s0, как моя локальная сеть.
Я следую этому руководству.
Проблема, с которой я столкнулся, заключается в том, что без назначения IP-адреса вручную enp2s0
(LAN) мой isc-dhcp-server
не запустится:
● isc-dhcp-server.service - ISC DHCP IPv4 server
Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2019-09-29 17:20:01 CEST; 9s ago
Docs: man:dhcpd(8)
Process: 1059 ExecStart=/bin/sh -ec CONFIG_FILE=/etc/dhcp/dhcpd.conf; if [ -f /etc/ltsp/dhcpd.conf ]; then CONF Main PID: 1059 (code=exited, status=1/FAILURE)
router dhcpd[1059]:
router dhcpd[1059]: Not configured to listen on any interfaces!
router dhcpd[1059]:
router dhcpd[1059]: If you think you have received this message due to a bug rather
router dhcpd[1059]: than a configuration issue please read the section on submitting
router dhcpd[1059]: bugs on either our web page at www.isc.org or in the README file
router dhcpd[1059]: before submitting a bug. These pages explain the proper
router dhcpd[1059]: process and the information we find helpful for debugging..
router dhcpd[1059]:
router dhcpd[1059]: exiting.
Когда я назначу IP-адрес моему enp2s0
(LAN) с использованием:
ifconfig enp2s0 192.168.4.1 netmask 255.255.255.0
isc-dhcp-server
запускается, но с ошибкой, ссылающейся на wlp1s0
(WAN):
router dhcpd[1297]: in your dhcpd.conf file for the network segment
router dhcpd[1297]: to which interface wlp1s0 is attached. **
Netplan conf:
network:
version: 2
renderer: networkd
ethernets:
enp2s0:
optional: true #I use this to not be delayed with a 2-minute waiting time upon reboot.
dhcp4: false
addresses: [192.168.4.1/24]
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
search: []
wifis:
wlp1s0:
dhcp4: yes
access-points:
:
password:
dhcpd.conf
:
option domain-name "router";
option domain-name-servers 8.8.8.8, 8.8.4.4;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
authoritative;
log-facility local7;
subnet 192.168.4.0 netmask 255.255.255.0 {
range 192.168.4.101 192.168.4.200;
option subnet-mask 255.255.255.0;
option routers 192.168.4.1;
option broadcast-address 192.168.4.255;
}
ifconfig wlp1s0
вывод:
wlp1s0: flags=4163 mtu 1500
inet 192.168.2.2 netmask 255.255.255.0 broadcast 192.168.2.255
inet6 fe80::e2ce:c3ff:fe4d:3af1 prefixlen 64 scopeid 0x20
ether e0:ce:c3:4d:3a:f1 txqueuelen 1000 (Ethernet)
RX packets 317 bytes 29949 (29.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 204 bytes 44963 (44.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Что происходит?