2,187
edits
m (→Change IP Address (v18 onwards): Yet another typo) |
m (→Persistent Route: Typo fix) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 195: | Line 195: | ||
== Change IP Address (v18 onwards) == | == Change IP Address (v18 onwards) == | ||
Ubuntu now uses [https://netplan.io Netplan], do not use the <code>/etc/network/interfaces</code> config file. | Ubuntu now uses [https://netplan.io Netplan], do not use the <code>/etc/network/interfaces</code> config file, use either <code>/etc/netplan/01-netcfg.yaml</code> or <code>/etc/netplan/50-cloud-init.yaml</code>. Formatting is very important with YAML files, indents especially. | ||
# Find the interface name (eg <code>ens2</code>) | # Find the interface name (eg <code>ens2</code>) | ||
Line 215: | Line 215: | ||
nameservers: | nameservers: | ||
addresses: [192.168.1.1,8.8.8.8] | addresses: [192.168.1.1,8.8.8.8] | ||
</pre> | |||
=== Persistent Route === | |||
To add a persistent route to an interface, add using the following syntax (example sends traffic to 172.32.1.0/24 via eth1 to 192.168.2.100) to add the <code>routes</code> config to the interface the traffic should go through. | |||
<pre> | |||
ens2: | |||
addresses: | |||
- 192.168.2.50/24 | |||
dhcp4: no | |||
routes: | |||
- to: 172.32.1.0/24 | |||
via: 192.168.2.100 | |||
</pre> | </pre> | ||
Line 230: | Line 243: | ||
#* <code>dpkg --get-selections | grep linux-image</code> | #* <code>dpkg --get-selections | grep linux-image</code> | ||
# Remove unwanted versions (don't remove the current or base/unversioned image) | # Remove unwanted versions (don't remove the current or base/unversioned image) | ||
#* EG <code>apt-get purge linux-image-3.2.0-32-virtual <code> | #* EG <code>apt-get purge linux-image-3.2.0-32-virtual </code> | ||
#* If you've got lots to remove its easier to do lots in one go | #* If you've got lots to remove its easier to do lots in one go | ||
#** EG <code> apt-get purge linux-image-3.2.0-51-virtual linux-image-3.2.0-52-virtual </code> | #** EG <code> apt-get purge linux-image-3.2.0-51-virtual linux-image-3.2.0-52-virtual </code> |