isc-dhcp-server on ubuntu server
by giesbert from LinuxQuestions.org on (#5R78V)
I have a problem setting up a dhcp-server on the wifi interface.
At the moment I have:
An Intel Nuc with Ubuntu server, docker container with Pi-Hole on port 53 dns. No dhcp.
A Raspberry Pi with openwrt with its own wifi network.
Both are wired connected to a Fritz Router.
What I really want is dish the rpi and integrate a separated wifi in the Nuc with dhcp.
I installed hostapd and set up a access point. That works well in the way that there is a ssid in the air, but I could not connect because of the missing dhcp for the client.
I wanted to set up a dhcp-server. Therefor I tried isc-dhcp-server. But this gave me problems. The service does not start. I also tried dnsmasq, but then I get conflicts on port 53 with pi-hole. I was not able to separate (listen/bind) dns on the both interfaces.
Ubuntu uses netplan. I switched from networkd to Network-manager. Because I've read that setting the wireless adapter in ap mode would be easier/possible with rendered: networkmanager.
I tried to bind wireless interface wlp2s0 to isc-dhcp-server as "INTERFACESv4="wlp2s0"" in /etc/default/isc-dhcp-server
And in /etc/dhcp/dhcpd/conf I have:
Code:subnet 192.168.148.0 netmask 255.255.255.0 {
range 192.168.148.10 192.168.148.30;
option broadcast-address 192.168.148.255;
option routers 192.168.148.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name-servers 192.168.188.1, 1.1.1.1;
}/etc/hostapd/hostapd.conf is configured as:
Code:interface=wlp2s0
driver=nl80211
ssid=my-own-ssid
country_code=NL
hw_mode=g
channel=10
own_ip_addr=192.168.148.1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=my-own-password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMPIn Netplan I tried different settings. I have the feeling that my problems start there.
/etc/netplan/01-netcfg.yaml
Code:# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: NetworkManager
ethernets:
enp3s0:
dhcp4: true
addresses: [192.168.188.49/24]
gateway4: 192.168.188.1
dhcp6: false
nameservers:
addresses: [192.168.188.1]
wifis:
wlp2s0:
dhcp4: true
access-points:
"my-own-ssid":
password: "my-own-password"
mode: ap
addresses: [192.168.148.1/24]This last config is accepted by netplan. But sudo ip -br a s shows me that wlp2s0 is still down.
edit: When I:
Code:ip link set wlp2s0 up
ip addr add 192.168.148.1/24 dev wlp2s0Then I could start isc-dhcp-server. But wlp2s0 is still down.
Code: sudo ip -br a s
lo UNKNOWN 127.0.0.1/8 ::1/128
enp3s0 UP 192.168.188.49/24
wlp2s0 DOWNAnd My phone does not get an ip-address from the server.
Is this possible what I want? Is this possible with a dhcp-server listening on wlp2s0 interface only. What would be the content of netplan?
Could anyone advise how to get this running?
At the moment I have:
An Intel Nuc with Ubuntu server, docker container with Pi-Hole on port 53 dns. No dhcp.
A Raspberry Pi with openwrt with its own wifi network.
Both are wired connected to a Fritz Router.
What I really want is dish the rpi and integrate a separated wifi in the Nuc with dhcp.
I installed hostapd and set up a access point. That works well in the way that there is a ssid in the air, but I could not connect because of the missing dhcp for the client.
I wanted to set up a dhcp-server. Therefor I tried isc-dhcp-server. But this gave me problems. The service does not start. I also tried dnsmasq, but then I get conflicts on port 53 with pi-hole. I was not able to separate (listen/bind) dns on the both interfaces.
Ubuntu uses netplan. I switched from networkd to Network-manager. Because I've read that setting the wireless adapter in ap mode would be easier/possible with rendered: networkmanager.
I tried to bind wireless interface wlp2s0 to isc-dhcp-server as "INTERFACESv4="wlp2s0"" in /etc/default/isc-dhcp-server
And in /etc/dhcp/dhcpd/conf I have:
Code:subnet 192.168.148.0 netmask 255.255.255.0 {
range 192.168.148.10 192.168.148.30;
option broadcast-address 192.168.148.255;
option routers 192.168.148.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name-servers 192.168.188.1, 1.1.1.1;
}/etc/hostapd/hostapd.conf is configured as:
Code:interface=wlp2s0
driver=nl80211
ssid=my-own-ssid
country_code=NL
hw_mode=g
channel=10
own_ip_addr=192.168.148.1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=my-own-password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMPIn Netplan I tried different settings. I have the feeling that my problems start there.
/etc/netplan/01-netcfg.yaml
Code:# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: NetworkManager
ethernets:
enp3s0:
dhcp4: true
addresses: [192.168.188.49/24]
gateway4: 192.168.188.1
dhcp6: false
nameservers:
addresses: [192.168.188.1]
wifis:
wlp2s0:
dhcp4: true
access-points:
"my-own-ssid":
password: "my-own-password"
mode: ap
addresses: [192.168.148.1/24]This last config is accepted by netplan. But sudo ip -br a s shows me that wlp2s0 is still down.
edit: When I:
Code:ip link set wlp2s0 up
ip addr add 192.168.148.1/24 dev wlp2s0Then I could start isc-dhcp-server. But wlp2s0 is still down.
Code: sudo ip -br a s
lo UNKNOWN 127.0.0.1/8 ::1/128
enp3s0 UP 192.168.188.49/24
wlp2s0 DOWNAnd My phone does not get an ip-address from the server.
Is this possible what I want? Is this possible with a dhcp-server listening on wlp2s0 interface only. What would be the content of netplan?
Could anyone advise how to get this running?