I'm trying to host a server:

  • OS is Ubuntu 16.04
  • Router is Xfinity Gateway
  • Using TP-Link TL-WN722N for wifi

I know that the issue is with the Ubuntu computer because I can port forward and run the server on my Windows laptop. To connect to my router, the computer uses a TP-link because it only has ethernet capabilities. I attempted to edit the etc/network/interfaces file but when I rebooted the computer no longer listed available Wifi networks. The interface representing the TP-link is named wlx90f65208f713. My current interfaces file only deals with the loopback:

auto lo

iface lo inet loopack

Also, the "gateway" IP is and the "address" ip is

What should I add to the interfaces file to make my computer have a static IP?

  • The TL;DR from below is "Nothing should go into /etc/network/interfaces for your wifi card", and "You need to configure this all for Network Manager for the given wifi connection". Which I've put in my answer. – Thomas Ward Jun 6 '17 at 0:46

The answer is to put absolutely nothing for the wifi adapter into your /etc/network/interfaces file, regardless of what other sites or such state to do for configuring a static IP address for an interface. Adding anything to /etc/network/interfaces for the wifi interface will have Network Manager not manage the wifi device, which is what you saw when it shows no networks.

When working with wireless networks and Network Manager, (or Ethernet connections and Network Manager, it's the same basic process) you have to configure network manager for how to handle the connections. That is, you need to set the static IP in the network settings specifically for a given wifi network, like so for a given network:

"Edit Network > WIFI NETWORK > IPv4 Settings > Setting a static IP

That is, I connected to the wifi network (in this case an Xfinity gateway), then afterwards I went into the Network Manager settings via left-clicking the icon and selecting "Edit Connections...", selecting the wifi network, opening it in "edit", and setting the address (in this case,, netmask (it's a last-octet-variable network, so all IPs are within the and range, which is for the netmask - or '24' for CIDR range designation), and gateway (, the router) accordingly for my network. You'll probably want to put and into the DNS servers field, though, so you can actually resolve domains.

Hit "Save", close the "Edit Connections" window, disconnect from the wifi network, and reconnect by clicking the wifi network in the networks list. Static IP addressing is now enabled for the network and in effect, so you won't need to rely on DHCP.

You'll need to do this for every wifi network you want to set up with a static IP though. It's not a 'global' setting.

  • What is the separator character between DNS servers to list multiple? Also, should I use the Google DNS servers you provided or the ones that my computer was already using? – Max K Jun 6 '17 at 0:49
  • @MaxK regarding separating DNS servers, you can do it with commas or spaces. Network Manager GUI is a bit adaptive for it, and can handle either method. I use commas for multiple IPs for DNS servers though. As for which DNS servers you use, that's up to you. I don't like Comcast's DNS servers, so I either run my own recursive resolver or use Google DNS servers instead. – Thomas Ward Jun 6 '17 at 0:50
  • You answered my question, thank you. Unfortunately, the server is still not connecting outside of the router. However, I'm certainly a step closer to resolving the overall issue. – Max K Jun 6 '17 at 1:06
  • @MaxK That's where you have to set up port forwarding at the router, and make sure it's set up correctly and you're not blocking on either the server OR the router at that point. But that's beyond the scope of this question :P – Thomas Ward Jun 6 '17 at 1:09
  • Right, which is why I marked your answer as correct. I appreciate your quick response. – Max K Jun 6 '17 at 1:10

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.