I am working on creating a mesh network setup using the batman-adv routing protocol and a couple of Pis. One of my issues right now is turning one of those Pi nodes into a gateway node, which is connected to the outside internet. In order to do that, I use both the internal wifi adapter and an external USB adapter. However, the internal wifi adapter (wlan0) needs to be utilized by the batman-adv setup. How do I set up the Pi to therefore only utilize my external USB adapter to connect to the internet? Right now when I connect to a network through the Pi, it always defaults through the built in wifi card.


You can prevent dhcpcd from configuring an interface by editing /etc/dhcpcd.conf

Add denyinterfaces wlan0 to the end of the file (but above any other added interface lines) and save the file.

  • Does this still allow me to utilize wlan0 for other things, and just not for automatically connecting to the internet? Reason being I hope to use the internal wifi adapter as part of setting up the batman-adv mesh network, so I don't want to disable it entirely. Sorry if the answer's obvious, I'm not extremely knowledgeable on networking configuration stuff – Yuerno Nov 8 '17 at 0:56
  • @Yuerno I have not done so myself, but this is often used in setting up an Access Point. This should just stop dhcpcd from managing the interface. It depends on how you then setup wlan0. – Milliways Nov 8 '17 at 1:36
  • Sounds good, thank you! I'm not able to test it out at the moment, but as soon as I do, I'll get back and update this question – Yuerno Nov 8 '17 at 3:33
  • @Yuerno After more than 2 years do you got it to work? What's about your promise? – Ingo Jan 28 '20 at 11:30

With every network management system, no matter if it is ifupdown, dhcpcd, systemd-networkd or Networkmanager (not supported with Raspbian), you are able to configure what interface (wlan0 or wlan1) is connected to what subnet. You don't tell us anything about your network environment so I can only suggest to look at your network setup how it manages to connect an interface to a subnet. In addition you can try to disable wlan0 completely. Set this option in /boot/config.txt:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.