Merge ~kzapalowicz/snappy-hwe-snaps/+git/network-manager:feature/update-documentation into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master
- Git
- lp:~kzapalowicz/snappy-hwe-snaps/+git/network-manager
- feature/update-documentation
- Merge into master
Status: | Merged |
---|---|
Approved by: | Simon Fels |
Approved revision: | 7f5338830414ce8dd2c8fb1cb1048c1c98115608 |
Merged at revision: | 5f2abc005bf79be8167bd54f5f8f66331576aecc |
Proposed branch: | ~kzapalowicz/snappy-hwe-snaps/+git/network-manager:feature/update-documentation |
Merge into: | ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master |
Diff against target: |
537 lines (+387/-33) 9 files modified
docs/configure-cellular-connections.md (+4/-4) docs/configure-wifi-connections.md (+36/-29) docs/edit-connections.md (+155/-0) docs/installation.md (+3/-0) docs/logging-messages.md (+43/-0) docs/metadata.yaml (+8/-0) docs/reference/snap-configuration/wifi-powersave.md (+38/-0) docs/report-bug.md (+4/-0) docs/routing-tables.md (+96/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Simon Fels | Approve | ||
Jim Hodapp (community) | Approve | ||
System Enablement Bot | continuous-integration | Approve | |
Alfonso Sanchez-Beato | Approve | ||
Review via email: mp+323381@code.launchpad.net |
Commit message
Description of the change
Update documentation and improve on the scope of what it covers.
Also fix text treated as HTML tags and not visible in browser.
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
Some comments, but looks very good.
I think that it would be good also to explain how to configure dynamically logging with "nmcli g logging" command. We can add a section for that and also refer to it from the "Report a bug" section.
Simon Fels (morphis) : | # |
Jim Hodapp (jhodapp) wrote : | # |
Some comments inline below.
Alfonso Sanchez-Beato (alfonsosanchezbeato) : | # |
Jim Hodapp (jhodapp) : | # |
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
Thanks for the changes. I still have some comments, see below.
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:c0faa9640d0
https:/
Executed test runs:
FAILURE: https:/
None: https:/
FAILURE: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Jim Hodapp (jhodapp) wrote : | # |
Looking good, some changes still to make.
Jim Hodapp (jhodapp) wrote : | # |
One more fix needed.
Jim Hodapp (jhodapp) wrote : | # |
Found one more typo.
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
LGTM
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:e4dafda8fff
https:/
Executed test runs:
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:7f533883041
https:/
Executed test runs:
SUCCESS: https:/
None: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
Simon Fels (morphis) wrote : | # |
LGTM, thanks for the rework!
Preview Diff
1 | diff --git a/docs/configure-cellular-connections.md b/docs/configure-cellular-connections.md |
2 | index 5f9dd3d..215f2dc 100644 |
3 | --- a/docs/configure-cellular-connections.md |
4 | +++ b/docs/configure-cellular-connections.md |
5 | @@ -86,10 +86,10 @@ $ nmcli c add type gsm ifname <interface> con-name <name> apn <operator_apn> |
6 | $ nmcli r wwan on |
7 | ``` |
8 | |
9 | -where <interface> is the string listed as “primary port” in the output from 'sudo mmcli -m <N>' |
10 | +where <interface> is the string listed as “primary port” in the output from 'sudo mmcli -m <N>' |
11 | (as previously described), |
12 | -<name> is an arbitrary name used to identify the connection, and <operator_apn> is |
13 | -the APN name for your cellular data plan. Note that <interface> is usually a serial |
14 | +<name> is an arbitrary name used to identify the connection, and <operator_apn> is |
15 | +the APN name for your cellular data plan. Note that <interface> is usually a serial |
16 | port with pattern /dev/tty*, not a networking interface. The reason for ModemManager |
17 | to use that instead of the networking interface is that this last one can appear/disappear |
18 | dynamically while the ports do not if the hardware configuration remains unchanged. |
19 | @@ -99,7 +99,7 @@ different each time it is possible to have other ppp connections with, say, VPNs |
20 | After executing these commands, NetworkManager will automatically try to bring up |
21 | the cellular connection whenever ModemManager reports that the modem has |
22 | registered (the state of the modem can be checked with the previously introduced |
23 | -command “sudo modem-manager.mmcli -m <N>”). When done successfully, NetworkManager |
24 | +command “sudo modem-manager.mmcli -m <N>”). When done successfully, NetworkManager |
25 | will create routes for the new network interface, with less priority than |
26 | Ethernet or WiFi interfaces. To disable the connection, we can do: |
27 | |
28 | diff --git a/docs/configure-wifi-connections.md b/docs/configure-wifi-connections.md |
29 | index fc3a72d..1d5a7fa 100644 |
30 | --- a/docs/configure-wifi-connections.md |
31 | +++ b/docs/configure-wifi-connections.md |
32 | @@ -1,10 +1,20 @@ |
33 | --- |
34 | title: "Configure WiFi Connections" |
35 | -table_of_contents: False |
36 | +table_of_contents: True |
37 | --- |
38 | |
39 | # Configure WiFi Connections |
40 | |
41 | +This section explains how to establish a WiFi connection. It covers creating and |
42 | +modyfying connections as well as directly connecting. |
43 | + |
44 | +## Establish a Wireless Connection |
45 | + |
46 | +This section will show how to establish a wifi connection to the wireles |
47 | +network. Note that directly connecting will implicitly create a connection (that |
48 | +can be seen with "nmcli c"). The naming of such will follow "SSID N" pattern, |
49 | +where N is a number. |
50 | + |
51 | First, determine the name of the WiFi interface: |
52 | |
53 | ``` |
54 | @@ -24,51 +34,48 @@ Then, list the available WiFi networks: |
55 | |
56 | ``` |
57 | $ nmcli d wifi list |
58 | -* SSID MODE CHAN RATE SIGNAL BARS SECURITY |
59 | +* SSID MODE CHAN RATE SIGNAL BARS SECURITY |
60 | ... |
61 | - my_wifi Infra 5 54 Mbit/s 89 ▂▄▆█ WPA2 |
62 | + my_wifi Infra 5 54 Mbit/s 89 ▂▄▆█ WPA2 |
63 | ``` |
64 | |
65 | -As an example, to connect to the access point ‘my_wifi’, you would use the |
66 | -following commands: |
67 | +As an example, to connect to the access point 'my_wifi', you would use the |
68 | +following command: |
69 | |
70 | ``` |
71 | -$ nmcli c add con-name <name> ifname wlan0 type wifi ssid my_wifi |
72 | -$ nmcli c modify <name> wifi-sec.key-mgmt wpa-psk wifi-sec.psk <password> |
73 | +$ nmcli d wifi connect my_wifi password <password> |
74 | ``` |
75 | |
76 | -<name> is an arbitrary name given to the connection, and <password> is the |
77 | -password for the connection (this last command can be used to change the |
78 | -password too). The password needs to have 8-63 characters or 64 hexadecimal characters to specify a full 256-bit key. New connections have DHCP enabled |
79 | -for both IPv4 and IPv6 by default. |
80 | +<password> is the password for the connection which needs to have 8-63 |
81 | +characters or 64 hexadecimal characters to specify a full 256-bit key. |
82 | + |
83 | +## Connect to a Hidden Network |
84 | |
85 | -Once a connection has been created, NetworkManager will consider it for |
86 | -a given connection whenever the device’s WiFi is disconnected and NetworkManager |
87 | -detects the access point is available via recent scan results. |
88 | +A hidden network is a normal wireless network that simply does not broadcast |
89 | +it's SSID unless solicited. This means that its name cannot be searched and |
90 | +must be known from some other source. |
91 | |
92 | -The autoconnect behaviour of a connection is enabled by default and can be changed |
93 | -by modifying the connection’s autoconnect property: |
94 | +Issue the following command to create a connection associated with a hidden |
95 | +network <ssid>: |
96 | |
97 | ``` |
98 | -$ nmcli c modify <name> connection.autoconnect [yes|no] |
99 | +$ nmcli c add type wifi con-name <name> ifname wlan0 ssid <ssid> |
100 | +$ nmcli c modify <name> wifi-sec.key-mgmt wpa-psk wifi-sec.psk <password> |
101 | ``` |
102 | |
103 | -Some other interesting commands follow. |
104 | - |
105 | -To show the details of a connection: |
106 | +Now you can establish a connection by typing: |
107 | |
108 | ``` |
109 | -$ nmcli c show <name> |
110 | +$ nmcli c up <name> |
111 | ``` |
112 | |
113 | -To trigger a manual WiFi scan: |
114 | +<name> is an arbitrary name given to the connection and <password> |
115 | +is the password to the network. It needs to have between 8-63 characters or 64 |
116 | +hexadecimal characters in order to specify a full 256-bit key. |
117 | |
118 | -``` |
119 | -$ nmcli d wifi rescan |
120 | -``` |
121 | +## Further Information |
122 | |
123 | -To delete a connection: |
124 | +You will find further information and more detailed examples on following pages: |
125 | |
126 | -``` |
127 | -$ nmcli c delete <name> |
128 | -``` |
129 | +* <https://developer.gnome.org/NetworkManager/unstable/nmcli.html> |
130 | +* <https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Using_the_NetworkManager_Command_Line_Tool_nmcli.html> |
131 | diff --git a/docs/edit-connections.md b/docs/edit-connections.md |
132 | new file mode 100644 |
133 | index 0000000..0c9d087 |
134 | --- /dev/null |
135 | +++ b/docs/edit-connections.md |
136 | @@ -0,0 +1,155 @@ |
137 | +--- |
138 | +title: "Edit Connections" |
139 | +table_of_contents: True |
140 | +--- |
141 | + |
142 | +# Edit Connections |
143 | + |
144 | +This part will show you how to use a network-manager built-in editor to modify |
145 | +the connections as well as provide a reference for setting some of the |
146 | +settings. |
147 | + |
148 | +## Using nmcli Console |
149 | + |
150 | +Aside from offering the possibility to manage and modify the network connections |
151 | +using the command-line, network-manager offers a built-in, interactive |
152 | +console to achieve the same. In order to use it type: |
153 | + |
154 | +``` |
155 | +$ nmcli connection edit |
156 | +``` |
157 | + |
158 | +It will bring up an interactive console. In the first step you will be prompted |
159 | +to enter the connection type. The list of valid connection types will be |
160 | +displayed on the screen. Once you select one you will be taken to the nmcli |
161 | +console where you have the possibility to modify its parameters. |
162 | + |
163 | +Alternatively, if you know the valid connection types, you could jump straight |
164 | +to the nmcli console by providing the type as a parameter: |
165 | + |
166 | +``` |
167 | +$ nmcli connection edit type <type> |
168 | +``` |
169 | + |
170 | +where <type> must be a valid connection type such as 'wifi'. |
171 | + |
172 | +An attempt to edit the wifi connection type would look like: |
173 | + |
174 | +``` |
175 | +$ nmcli c edit |
176 | + |
177 | +Valid connection types: generic, 802-3-ethernet (ethernet), pppoe, |
178 | +802-11-wireless (wifi), wimax, gsm, cdma, infiniband, adsl, bluetooth, vpn, |
179 | +802-11-olpc-mesh (olpc-mesh), vlan, bond, team, bridge, bond-slave, team-slave, |
180 | +bridge-slave, no-slave, tun, ip-tunnel, macvlan, vxlan |
181 | +Enter connection type: wifi |
182 | + |
183 | +===| nmcli interactive connection editor |=== |
184 | + |
185 | +Adding a new '802-11-wireless' connection |
186 | + |
187 | +Type 'help' or '?' for available commands. |
188 | +Type 'describe [<setting>.<prop>]' for detailed property description. |
189 | + |
190 | +You may edit the following settings: connection, 802-11-wireless (wifi), |
191 | +802-11-wireless-security (wifi-sec), 802-1x, ipv4, ipv6 |
192 | +nmcli> |
193 | +``` |
194 | + |
195 | +From now on it is possible to edit the wifi connection settings. The list of |
196 | +settings is provided as in the example above. The nmcli console offers a set of |
197 | +commands that can be used to navigate between settings. To get the list of |
198 | +available commands type 'help' or '?' |
199 | + |
200 | +``` |
201 | +nmcli> ? |
202 | +------------------------------------------------------------------------------ |
203 | +---[ Main menu ]--- |
204 | +goto [<setting> | <prop>] :: go to a setting or property |
205 | +remove <setting>[.<prop>] | <prop> :: remove setting or reset property value |
206 | +set [<setting>.<prop> <value>] :: set property value |
207 | +describe [<setting>.<prop>] :: describe property |
208 | +print [all | <setting>[.<prop>]] :: print the connection |
209 | +verify [all | fix] :: verify the connection |
210 | +save [persistent|temporary] :: save the connection |
211 | +activate [<ifname>] [/<ap>|<nsp>] :: activate the connection |
212 | +back :: go one level up (back) |
213 | +help/? [<command>] :: print this help |
214 | +nmcli <conf-option> <value> :: nmcli configuration |
215 | +quit :: exit nmcli |
216 | +------------------------------------------------------------------------------ |
217 | +nmcli> |
218 | +``` |
219 | + |
220 | +## Change Connection Details |
221 | + |
222 | +This section will show how to change some of the connection details including |
223 | +IPv4 and IPv6 settings. |
224 | + |
225 | +It is important to understand that every option can be modified using either the |
226 | +command-line or the editor. The advantage of the editor is that it shows which |
227 | +options are availabe for modification in contrast to the command-line which does |
228 | +not. |
229 | + |
230 | +It is possible however to learn about the available settings from the |
231 | +command-line by printing the connection details. Type: |
232 | + |
233 | +``` |
234 | +$ nmcli c show <name> |
235 | +``` |
236 | + |
237 | +where <name> is the connection name. |
238 | + |
239 | +The above will bring a fairly long list of text on the terminal, therefore it is |
240 | +best to either use a pager or grep to make the results manageable. |
241 | + |
242 | +### IPv4 and IPv6 Options |
243 | + |
244 | +For example for IPv4 settings one would do: |
245 | + |
246 | +``` |
247 | +$ nmcli c show <name> | grep ipv4 |
248 | +ipv4.method: auto |
249 | +ipv4.dns: |
250 | +ipv4.dns-search: |
251 | +ipv4.dns-options: (default) |
252 | +ipv4.addresses: |
253 | +ipv4.gateway: -- |
254 | +ipv4.routes: |
255 | +ipv4.route-metric: -1 |
256 | +ipv4.ignore-auto-routes: no |
257 | +ipv4.ignore-auto-dns: no |
258 | +ipv4.dhcp-client-id: -- |
259 | +ipv4.dhcp-timeout: 0 |
260 | +ipv4.dhcp-send-hostname: yes |
261 | +ipv4.dhcp-hostname: -- |
262 | +ipv4.dhcp-fqdn: -- |
263 | +ipv4.never-default: no |
264 | +ipv4.may-fail: yes |
265 | +ipv4.dad-timeout: -1 (default) |
266 | +``` |
267 | + |
268 | +For example setting up the DNS server would require typing: |
269 | + |
270 | +``` |
271 | +$ nmcli c modify <name> ipv4.dns "8.8.8.8" |
272 | +``` |
273 | + |
274 | +The rest of the settings can be modified in the same fashion. |
275 | + |
276 | +### WiFi Powersave Option |
277 | + |
278 | +The WiFi powersave option can have one of the following values: |
279 | + |
280 | +| Value | Meaning | |
281 | +|-------|---------------------------------------------------| |
282 | +| 0 | Default | |
283 | +| 1 | Ignore, do not touch currently configured setting | |
284 | +| 2 | Disable | |
285 | +| 3 | Enable | |
286 | + |
287 | +Changing it is as simple as: |
288 | + |
289 | +``` |
290 | +$ nmcli c modify <name> 802-11-wireless.powersave 2 |
291 | +``` |
292 | diff --git a/docs/installation.md b/docs/installation.md |
293 | index 2f6872d..6169238 100644 |
294 | --- a/docs/installation.md |
295 | +++ b/docs/installation.md |
296 | @@ -56,3 +56,6 @@ Now you have NetworkManager successfully installed. |
297 | * [Explore Network Status](explore-network-status.md) |
298 | * [Configure WiFi Connections](configure-wifi-connections.md) |
299 | * [Configure Cellular Connections](configure-cellular-connections.md) |
300 | + * [Edit Network Connections](edit-connections.md) |
301 | + * [Routing Tables](routing-tables.md) |
302 | + * [Logging Messages](logging-messages.md) |
303 | diff --git a/docs/logging-messages.md b/docs/logging-messages.md |
304 | new file mode 100644 |
305 | index 0000000..d242808 |
306 | --- /dev/null |
307 | +++ b/docs/logging-messages.md |
308 | @@ -0,0 +1,43 @@ |
309 | +--- |
310 | +title: "Logging Messages" |
311 | +table_of_contents: False |
312 | +--- |
313 | + |
314 | +# Logging Messages |
315 | + |
316 | +This section will show how to modify the logging levels by NetworkManager. |
317 | + |
318 | +NetworkManager supports on the fly changing of the logging levels and allows for |
319 | +a fine control over what is logged. |
320 | + |
321 | +First check what is the current logging setup, type: |
322 | + |
323 | +``` |
324 | +$ nmcli general logging |
325 | +``` |
326 | + |
327 | +As a result you will be presented with the information about the current |
328 | +configuration: |
329 | + |
330 | +``` |
331 | +LEVEL DOMAINS |
332 | +INFO PLATFORM,RFKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,AGENTS,SETTINGS,SUSPEND,CORE,DEVICE,OLPC,INFINIBAND,FIREWALL,ADSL,BOND,VLAN,BRIDGE,TEAM,CONCHECK,DCB,DISPATCH,AUDIT,SYSTEMD |
333 | +``` |
334 | + |
335 | +It is possible to change the level either globally or for each domain |
336 | +separately. The command to achieve this is: |
337 | + |
338 | +``` |
339 | +$ nmcli general logging [level <level> [domain <domain>]] |
340 | +``` |
341 | + |
342 | +The <level> is the desired log level. You can choose from the following: |
343 | + |
344 | +* **ERR:** will log only critical errors |
345 | +* **WARN:** will log warnin messages |
346 | +* **INFO:** will log various informational messages |
347 | +* **DEBUG:** enables verbose logging for debugging purposes |
348 | + |
349 | +<domain> is the category of messages that shall be logged with given |
350 | +severity. **WIFI** will include only WiFi related messages, **IP4** will include |
351 | +only IPv4 related messages and so on.. |
352 | diff --git a/docs/metadata.yaml b/docs/metadata.yaml |
353 | index 477b29d..b9c4f41 100644 |
354 | --- a/docs/metadata.yaml |
355 | +++ b/docs/metadata.yaml |
356 | @@ -17,12 +17,20 @@ navigation: |
357 | location: configure-cellular-connections.md |
358 | - title: Enable Ethernet Support |
359 | location: enable-ethernet-support.md |
360 | + - title: Edit Connections |
361 | + location: edit-connections.md |
362 | + - title: Routing Tables |
363 | + location: routing-tables.md |
364 | + - title: Logging Messages |
365 | + location: logging-messages.md |
366 | - title: Reference |
367 | children: |
368 | - title: Snap Configuration |
369 | children: |
370 | - title: Wake on WLAN |
371 | location: reference/snap-configuration/wowlan.md |
372 | + - title: WiFi Powersave |
373 | + location: reference/snap-configuration/wifi-powersave.md |
374 | - title: Available Commands |
375 | location: reference/available-commands.md |
376 | - title: DBUS API |
377 | diff --git a/docs/reference/snap-configuration/wifi-powersave.md b/docs/reference/snap-configuration/wifi-powersave.md |
378 | new file mode 100644 |
379 | index 0000000..8b9e68f |
380 | --- /dev/null |
381 | +++ b/docs/reference/snap-configuration/wifi-powersave.md |
382 | @@ -0,0 +1,38 @@ |
383 | +--- |
384 | +title: WiFi Powersave |
385 | +table_of_contents: True |
386 | +--- |
387 | + |
388 | +# WiFi Powersave |
389 | + |
390 | +WiFi Powersave is a feature that allows a device to suspend its radio activity |
391 | +after a fixed period of inactivity. The device remains idle for a fixed time, |
392 | +usualy about 100ms, and once it is reached it wakes up to check if the |
393 | +infrastructure has any packets queued up for it. |
394 | + |
395 | +The NetworkManager snap allows to configure this option by either enabling or |
396 | +disabling the powersave feature. |
397 | + |
398 | +You can read more about the WiFi Powersave feature on the following sites: |
399 | + |
400 | +* |
401 | +<https://wireless.wiki.kernel.org/en/developers/documentation/ieee80211/power-savings> |
402 | + |
403 | +### Enable WiFi Powersave |
404 | + |
405 | +To allow users to enable or disable WiFi Powersave, the snap provides a single |
406 | +configuration option: |
407 | + |
408 | +* wifi.powersave |
409 | + |
410 | +Option can be set via the configuration API snaps provide. See |
411 | +<https://docs.ubuntu.com/core/en/guides/build-device/config-hooks> for more |
412 | +details. |
413 | + |
414 | +#### wifi.powersave |
415 | + |
416 | +This configuration option accepts the following values: |
417 | + |
418 | +* **disabled (default):** WiFi powersaving is disabled |
419 | +* **enabled:** WiFi powersaving is enabled |
420 | + |
421 | diff --git a/docs/report-bug.md b/docs/report-bug.md |
422 | index 9ec4b89..faa9853 100644 |
423 | --- a/docs/report-bug.md |
424 | +++ b/docs/report-bug.md |
425 | @@ -18,6 +18,10 @@ $ nmcli d |
426 | $ nmcli c |
427 | ``` |
428 | |
429 | +It is a good idea to set the log level to DEBUG so that the verbose information |
430 | +is provided. To do this for NetworkManager please see the [Logging Messages](logging-messages.md) |
431 | +page. |
432 | + |
433 | If there is a modem and the modem-manager snap is installed, also add the output |
434 | of |
435 | |
436 | diff --git a/docs/routing-tables.md b/docs/routing-tables.md |
437 | new file mode 100644 |
438 | index 0000000..85b4ff8 |
439 | --- /dev/null |
440 | +++ b/docs/routing-tables.md |
441 | @@ -0,0 +1,96 @@ |
442 | +--- |
443 | +title: "Routing Tables" |
444 | +table_of_contents: True |
445 | +--- |
446 | + |
447 | +# Routing Tables |
448 | + |
449 | +This section describes the way to setup routing table as well as it explains the |
450 | +logic used to prioritize interfaces. |
451 | + |
452 | +The routing table is stored in the kernel which merely acts upon it. The route |
453 | +itself is set by the user-space tools. There is no preference as any tool |
454 | +created for this reason will do. It can be either a DHCP client, ip command or |
455 | +route command. |
456 | + |
457 | +It is important to understand that NetworkManager changes the routing table |
458 | +whenever it creates a new connection. |
459 | + |
460 | +Routing table acts as a junction and is there to show where the different |
461 | +network subnets will be routed to. An example of a routing table is shown below. |
462 | + |
463 | +``` |
464 | +$ ip route |
465 | +default via 10.0.0.1 dev wlp3s0 proto static metric 600 |
466 | +10.0.0.0/24 dev wlp3s0 proto kernel scope link src 10.0.0.73 metric 600 |
467 | +10.0.1.0/24 dev lxcbr0 proto kernel scope link src 10.0.1.1 |
468 | +169.254.0.0/16 dev docker0 scope link metric 1000 linkdown |
469 | +172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown |
470 | +192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown |
471 | +``` |
472 | + |
473 | +The first column is the <Destination> subnet with the "default" being a |
474 | +wildcard for everything else. The "via" fragment points to the <Gateway> |
475 | +however when it is missing it indicates that that network is connected directly |
476 | +and instead it describes a source address. |
477 | + |
478 | +The <Metric> column translates to the number of hops required to reach the |
479 | +destination and is used to determine which route shall be preferred when there |
480 | +are more than one route available for a specific destination. Since it |
481 | +reassembles the concept of distance the lower it's value is the better. |
482 | + |
483 | +The <Metric> value can be set manually however when NetworkManager creates |
484 | +a connection the following defaults are applied: |
485 | + |
486 | +* Ethernet is preferred over WiFi |
487 | +* WiFi is preferred over WWAN |
488 | + |
489 | +# Editing the Routing Tables |
490 | + |
491 | +The routing table can be added or modified using the standard *ip* command which |
492 | +is available on Ubuntu Core. |
493 | + |
494 | +You can find more information on it on the following page: |
495 | + |
496 | +* <https://linux.die.net/man/8/ip?> |
497 | + |
498 | +Separately it is possible to modify routing information per single connection |
499 | +using the nmcli tool. The parameters such as: gateway, routes and metrics can be |
500 | +modified. |
501 | + |
502 | +The following options are responsible: |
503 | + |
504 | +``` |
505 | +ipv4.gateway: |
506 | +ipv4.routes: |
507 | +ipv4.route-metric: |
508 | + |
509 | +ipv6.gateway: |
510 | +ipv6.routes: |
511 | +ipv6.route-metric: |
512 | +``` |
513 | + |
514 | +These options can be modified in a following way: |
515 | + |
516 | +``` |
517 | +$ nmcli connection modify <name> +ipv4.routes <destination> ipv4.gateway <gateway> |
518 | +$ nmcli connection modify <name> ipv4.route-metric <metric> |
519 | +``` |
520 | + |
521 | +Where <name> is the connection name. You can obtain it by listing |
522 | +available connections on the system: |
523 | + |
524 | +``` |
525 | +$ nmcli c show |
526 | +``` |
527 | + |
528 | +<destination> is the destination network provided as a static IP address, |
529 | +subnet or "default". <gateway> is the new gateway information. |
530 | +<metric> is the new metric information. |
531 | + |
532 | +Note that this kind of changes can be made separately for each connection thus |
533 | +it is possible to provide a fine grained control over how the packets directed |
534 | +to different networks are routed. |
535 | + |
536 | +It is also important to understand that bringing up and down connections with |
537 | +different values set for these options is in fact changing the routing table. |
PASSED: Continuous integration, rev:fc30fc56c87 cb8992def0516ed 7b5f6882ac0702 /jenkins. canonical. com/system- enablement/ job/generic- build-snap/ 1506/ /jenkins. canonical. com/system- enablement/ job/generic- build-snap- worker/ 1305 /jenkins. canonical. com/system- enablement/ job/generic- update- snap-mp/ 1414/console /jenkins. canonical. com/system- enablement/ job/generic- test-snap/ 1731 /jenkins. canonical. com/system- enablement/ job/generic- cleanup- snap/916/ console
https:/
Executed test runs:
SUCCESS: https:/
None: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/system- enablement/ job/generic- build-snap/ 1506/rebuild
https:/