How to Set up a Wireless Network in Linux Via the Command Line
A walkthrough of wireless (IEEE 802.11 also known as WiFi) home networking with Linux.
Steps
- 1Note that if you are buying a router, all routers are compatible with Linux. It is wireless adapters that have varying levels of Linux compatibility. If your router isn't new, then turn it on and skip to "Detecting your wireless adapter" (below).
- 2Set up your new router.
- Plug your router into your internet socket if you want to share your internet
- Plug your router into your PC with an Ethernet cable
- 3Go to your browser and type in the address: "192.168.0.1"
- 4Enter your username and password from your router (often "admin" and "admin") then your internet service provider.
- 5Enable wireless and set your encryption (WEP or WPA) and type a memorable passkey.
- 6Detecting your wireless adapter: Your wireless adapter should be detected automatically by your distribution.
- Type ifconfig into the terminal to determine whether it's been detected.
- lshw -C network
- Type ifconfig into the terminal to determine whether it's been detected.
- 7Use ndiswrapper, if needed, and your Windows driver.
- 8Connect to a network.
- sudo ifconfig <interface> down
- sudo dhclient -r <interface>
- sudo ifconfig <interface> up
- sudo iwconfig <interface> essid "ESSID_IN_QUOTES"
- sudo iwconfig <interface> mode Managed
- sudo dhclient <interface>
- 9Connecting to a network on boot.
- Add those commands to /etc/rc.local
- Make /etc/rc.local executable with chmod
- Add those commands to /etc/rc.local
Sources and Citations
- Ubuntu forums How To: Manual Network Configuration without the need for Network Manager
Article Info
Categories: Summarization | Wireless Networking