You are not logged in.
I'm composing a reference guide (mostly intended for use by myself, though it could be published) on using the terminal for accomplishing tasks usually relegated to GUI applications. I'm currently stuck on a section I must admit I haven't got enough experience to fill out alone. I can remember connecting to the internet using ifconfig and dhcpcd while setting up Gentoo back in 2004, although from what I understand this is not acceptable this decade. The guide I'm writing should be comprised of commands and methods sufficiently generic enough to work on all hardware and network configurations without too variation, while still being simple and succint. Connecting to the internet is only a small part of the guide, so I don't want to get too in depth. In order to keep the scope of the networking section sufficiently broad, I'll need like a "bird's eye view," as a manner of speaking, of how people connect to the internet via terminal commands.
This is what it looks like at the moment:
Activiate wireless interface: sudo ifconfig wlan0 up
List available wireless access points: iwlist wlan0 scan
Connect: iwconfig wlan0 essid wifiaccesspointname
Get IP: dclient wlan0
Obviously this requires an update with respect to the "ip" tool. Unfortunately, I haven't had the priviledge to use ip, and the name "ip" is vague enough to make Googling quite useless. So if readers would like to help, I'd appreciate sharing the commands they use for connecting to the internet, minus security bits (obviously, I hope). With enough examples from a variety of configurations writing this section of the guide ought to be much easier.
Offline
The wiki has a good section on manually connecting...
Offline
ip also has a good collection of man pages. man ip gives the major commands (link, addr, etc...) you can also do a man ip-addr to get an entire article on the ip addr command. This hyphenated form works for all of ip's commands.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Right, I have those resources open and am working with them currently. What they're missing though is samples of the commands being used "in the wild." I see plenty technical documentation, and no relevant practical examples.
Offline
Well, the only variables that change (for me, anyway) are the device name, SSID and passphrase; none of which are of any use to your guide.
I supose you could also list the non-GUI to manage connections like systemd-networkd and connman, etc.
Offline
Why do you need samples "in the wild"? The Manual Setup section of the wiki's Wireless page easily covers the four steps you listed above, and plenty more also.
Offline
I guess it's a learning method, like studying the source of other people's web pages for learning HTML, or checking out someone elses Openbox config files for keybinding tricks. I'm self-taught in a variety of disciplines and it's mostly a 'learn from example' process. I'll always study the wikis or manual and frequently those are adequate, but real-world scenarios are sometimes better.
Offline
I personally use wpa_supplicant@wlp3s0.service to associate with the AP. Then systemd-networkd.service and systemd-resolved.service handle the dhcp client stuff and whatnot.
Recently, I discovered that wpa_supplicant's config can actually allow for multiple AP configurations, meaning that it can handle roaming itself. Though using systemd-networkd with it means that I either have to have a static IP everywhere or use dhcp everywhere.
Offline
I personally use the wifi-menu (part of netctl) and sometimes the Network-Manager command line, I couldn't give you a precise command line, as jasonwryan the commonly used variables of most command line utilities used to connect a network are SSID passphrase NIC and sometimes BSSID could be required (not hidden networks).
An Arch Linux enthousiast and a Linux fan in general, mostly interrested in command line use, security issues, code learning and networks.
Offline
Obviously this requires an update with respect to the "ip" tool. Unfortunately, I haven't had the priviledge to use ip, and the name "ip" is vague enough to make Googling quite useless.
When searching for the "ip" command, try adding iproute or iproute2 to the query, as that is the package containing this utility.
As for connecting to the net, I personally use OpenRC instead of systemd, in which I use the
/etc/conf.d/network
file to configure the network.
The contents of this file are sourced at boot through the network service. Sample contents,
ip_eth0="192.168.1.2/24"
defaultiproute="via 192.168.1.1"
Sometimes, when using a wireless card, I use wicd and dhcpcd, for connecting to wireless networks.
Offline
I personally use wpa_supplicant@wlp3s0.service to associate with the AP. Then systemd-networkd.service and systemd-resolved.service handle the dhcp client stuff and whatnot.
Recently, I discovered that wpa_supplicant's config can actually allow for multiple AP configurations, meaning that it can handle roaming itself. Though using systemd-networkd with it means that I either have to have a static IP everywhere or use dhcp everywhere.
If you use dhcpcd instead of systemd-networkd you can have a profile per SSID (the AP's name)
Here's a setup where we probe for static routers on eth0 and eth2 and fixed SSID profiles.
Everything else defaults or falls back to DHCP
interface eth0
fallback probe
interface eth2
fallback probe
interface wlan0
# default to dhcp, unless we connect to ssid foo or bar
profile probe
arping 192.168.1.1
arping 10.10.1.1
profile 192.168.1.1
static ip_address=192.168.1.2
static domain_name_servers=192.168.1.1
profile 192.168.1.1
static ip_address=192.168.1.2
static domain_name_servers=192.168.1.1
ssid foo
static ip_address=192.168.2.4
static domain_name_servers=192.168.2,1
ssid bar
arping 192.168.1.1
So you can see, it's fairly powerful and allows for complex setups.
Offline
I personally configured my wired and wireless networks manually, by following the Wiki.
My ethernet connection always fails during startup, but it is working by the time I have a login prompt. Maybe I missed something in the configuration instructions, but I don't think so, as it works very well after it actually gets going.
Tim
Offline