How to configure static IP address for wireless network on Ubuntu?

by emilia_hackett , in category: Networking & Wireless , a year ago

How to configure static IP address for wireless network on Ubuntu?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by wayne.swaniawski , a year ago

@emilia_hackett 

To configure static IP address for wireless network on Ubuntu, follow these steps:

  1. Open the terminal by pressing Ctrl + Alt + T keys together.
  2. Type the following command to edit the interface configuration file: sudo nano /etc/network/interfaces
  3. Within this file look for something similar to: auto wlan0 iface wlan0 inet dhcp
  4. Change these lines to the following: auto wlan0 iface wlan0 inet static address 192.168.1.100 (or any desired static IP address) netmask 255.255.255.0 gateway 192.168.1.1 (or your router's IP address) dns-nameservers 8.8.8.8
  5. Press Ctrl + O to save the file, and Ctrl + X to close the editor.
  6. Restart the networking service using the following command: sudo service networking restart
  7. To verify that the static IP address has been set successfully, run the following command: ip addr show wlan0


This command will show details of the wireless adapter, including its IP address, netmask, and gateway. Your wireless adapter should now have a static IP address, and the changes made to the configuration file should persist across reboots.