I have a raspberry pi 2 with a lan interface (eth0) and wan interface (wlan0)- usb wifi adapter. My OS is raspbian. I want to use my raspberry as a wifi AP. So, it is necessary to have a ics-dhcp-server running on my wlan0.

I want to have a shared local network, so PCs and wi-fi clients can see each other. So:

  • PC's are connected to router's ( lan with wired connection and they have static ip in range - (except The Raspberry Pi LAN ip is
  • Wi-FI clients are connected to my raspberry pi and should have ip in range of - The Raspberry Pi wlan ip is

An internet goes from lan to wlan using MASQERADE.

My configs are:

cat /etc/dhcp/dhcpd.conf:

subnet netmask {
interface wlan0;
    option broadcast-address;
        option routers;
    default-lease-time 600;
    max-lease-time 7200;
    option domain-name "local";
    option domain-name-servers,,,;
host wlan0 {

cat /etc/default/isc-dhcp-server:


cat /etc/dnsmasq.conf


cat /etc/dhcpcd.conf

interface eth0
static ip_address=
static routers=
static domain_name_servers=
static domain_search=

interface wlan0
static ip_address=
nohook wpa_supplicant
static routers=
static domain_name_servers=
static domain_search=

With this configs i get errors when trying to start isc-dhcp-server:

Multiple interfaces match the same subnet: eth0 wlan0
 Multiple interfaces match the same shared network: eth0 wlan0
 Can't bind to dhcp address: Address already in use

Where is the mistake in my configs?

2 Answers 2


The first mistake is having multiple interfaces in the same subnet. The second mistake is that you're heavily mixing up what a router does (masquerading, serving DHCP) and what an access point does (giving access to the same subnet). In a sense, they actually do opposite things.

  • A router connects two whole networks. It does not connect two halves of the same network – after all, if a host is "is in the same subnet", that literally means that it's accessible without going through a router.

    So if you want to use the Raspberry Pi as a router (with MASQUERADE or without), then the two interfaces have to use different network numbers – it can't be the same on both sides.

    But you said "I want to have a shared local network", so you don't actually want to use your Raspberry Pi as a router – you want to use it as an access point.

  • An access point is not a router, it's a bridge. An access point does not need to serve DHCP, because it simply forwards the DHCP requests to the previous router that you already have. It also doesn't need to 'MASQUERADE' anything, because it only deals with a single network anyway.

    If you want both Wi-Fi and Ethernet to be in a single subnet for an AP, they have to be explicitly bridged together. Once bridged, eth0 and wlan0 will stop having IP addresses of their own – only the bridge itself, "br0", will need an address.

    (An access point can serve DHCP – but only if your main router doesn't. Remember, you wanted a single shared network, and there needs to be only one DHCP server across the entire network.)

So if you want to set up an AP, there are existing articles about "raspbian bridge", specifically https://www.raspberrypi.org/documentation/configuration/wireless/access-point-bridged.md will also work on Raspbian.

(But not https://www.raspberrypi.org/forums/viewtopic.php?t=132674 – that's high up in Google results, but it actually tells you how to set up a router, not a bridge. Ignore that page.)

But in short, what you should do is:

  1. Remove the 'MASQUERADE' firewall rule (it only applies to routers, not to bridges);

  2. Remove both 'interface eth0' and 'interface wlan0' from your dhcpcd.conf;

  3. Configure /etc/systemd/network/br0.netdev to create the bridge through systemd-networkd:


    Don't forget to systemctl enable systemd-networkd.

  4. Similarly, configure systemd-networkd to set eth0 as a member of br0. (Only eth0 – hostapd itself will handle wlan0.)

  5. Assign an IP address to br0, either through systemd-networkd or dhcpcd (doesn't matter).

  6. Tell hostapd to put wlan0 in the bridge as well:


    (This has to be done via hostapd because wlan0 only becomes bridgeable when it's actually switched to "access point" mode.)


Thanks for the answer.

I've done this steps:

  1. Removed firewall rule MASQUERADE

  2. Removed interface eth0 and wlan0 from /etc/dhcpcd.conf

  3. created /etc/systemd/network/br0.netdev with:




  4. created /etc/systemd/network/br0-slave.network with:





  5. created /etc/systemd/network/br0.network with:

    [Match] Name=br0





  6. my /etc/hostapd/hostapd.conf now is:




















  7. Also i've added a "killall wpa_supplicant" in my /etc/rc.local, so now it is:

    rfkill unblock wifi

    killall wpa_supplicant

    exit 0

And rebooted. Now i have a working AP with internet, but when i try to connect to any server/site with my Raspberry, there is no connection (can't do apt-get install ... or ping google.com - host is unreachable). Also i can see old ip address on my eth0 ( though it is commented in my /etc/dhcpcd.conf. Where else i can find my old eth0 ip address for deleting it?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .