You are not logged in.

#1 2014-07-09 22:46:25

rsw
Member
Registered: 2008-10-07
Posts: 25

Method you (personally) use for connecting to the internet

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

#2 2014-07-09 22:50:14

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Method you (personally) use for connecting to the internet

The wiki has a good section on manually connecting...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-07-09 22:59:57

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,354

Re: Method you (personally) use for connecting to the internet

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

#4 2014-07-10 00:17:49

rsw
Member
Registered: 2008-10-07
Posts: 25

Re: Method you (personally) use for connecting to the internet

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

#5 2014-07-10 00:30:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Method you (personally) use for connecting to the internet

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.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2014-07-10 00:38:54

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Method you (personally) use for connecting to the internet

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

#7 2014-07-10 02:32:49

rsw
Member
Registered: 2008-10-07
Posts: 25

Re: Method you (personally) use for connecting to the internet

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

#8 2014-07-10 02:53:36

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Method you (personally) use for connecting to the internet

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

#9 2014-07-10 08:02:06

sugartest
Member
Registered: 2014-07-09
Posts: 38

Re: Method you (personally) use for connecting to the internet

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

#10 2014-07-10 08:44:39

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: Method you (personally) use for connecting to the internet

rsw wrote:

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

#11 2014-07-10 09:59:23

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: Method you (personally) use for connecting to the internet

WonderWoofy wrote:

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

#12 2014-07-10 16:36:18

ratcheer
Member
Registered: 2011-10-09
Posts: 913

Re: Method you (personally) use for connecting to the internet

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

Board footer

Powered by FluxBB