2,187
edits
m (→v12 Precise Pangolin: Updated) |
m (→Persistent Route: Typo fix) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 87: | Line 87: | ||
=== Enable Root === | === Enable Root === | ||
# Use the command <code> sudo passwd root </code> | # Use the command <code> sudo passwd root </code> | ||
# Enter your user password | |||
# Enter a strong password for the root account | |||
For Ubuntu 18... | |||
# Use the command <code> sudo passwd</code> | |||
# Enter your user password | # Enter your user password | ||
# Enter a strong password for the root account | # Enter a strong password for the root account | ||
Line 104: | Line 109: | ||
#* <code> mdadm --misc -D /dev/md1 </code> | #* <code> mdadm --misc -D /dev/md1 </code> | ||
== Change IP Address == | == Change IP Address (Pre v18) == | ||
=== v8 Hardy Heron / v10 Lucid Lynx === | === v8 Hardy Heron / v10 Lucid Lynx === | ||
* Edit the <code> /etc/network/interfaces </code> file in the following fashion to set static address details | * Edit the <code> /etc/network/interfaces </code> file in the following fashion to set static address details | ||
Line 163: | Line 168: | ||
* Confirm DNS config is as expected with | * Confirm DNS config is as expected with | ||
** <code>less /etc/resolv.conf</code> | ** <code>less /etc/resolv.conf</code> | ||
=== 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.1.100 | |||
up route add -net 172.32.1.0/24 gw 192.168.1.100 dev eth1 | |||
=== Additional IPs / Multihome === | |||
To add additional IP addresses to an interface, create sub-interfaces as below. | |||
<pre> | |||
auto eth0:1 | |||
auto eth0:2 | |||
# Sub 1 | |||
iface eth0:1 inet static | |||
address 192.168.1.160 | |||
netmask 255.255.255.0 | |||
# Sub 2 | |||
iface eth0:2 inet static | |||
address 192.168.1.161 | |||
netmask 255.255.255.0 | |||
</pre> | |||
'''RTNETLINK answers: File exists''' - Note that you can't use the same default gateway twice, doing so will cause this error | |||
== Change IP Address (v18 onwards) == | |||
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>) | |||
#* <code> ip link </code> | |||
# Edit the <code>/etc/netplan/01-netcfg.yaml</code> config file as show below | |||
# Apply the changes | |||
#* <code> netplan apply</code> | |||
<pre> | |||
network: | |||
version: 2 | |||
renderer: networkd | |||
ethernets: | |||
ens2: | |||
dhcp4: no | |||
addresses: | |||
- 192.168.1.50/24 | |||
gateway4: 192.168.1.1 | |||
nameservers: | |||
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> | |||
== Update the OS == | == Update the OS == | ||
Line 171: | Line 237: | ||
#* If updates are being held back (eg linux image), then use <code> aptitude safe-upgrade</code> | #* If updates are being held back (eg linux image), then use <code> aptitude safe-upgrade</code> | ||
# If running in VMware VM, [[VM Tools_Install_(Ubuntu)|install VM Tools]] | # If running in VMware VM, [[VM Tools_Install_(Ubuntu)|install VM Tools]] | ||
=== Remove Old Version === | |||
Old kernel images will tend to linger in <code>/boot</code> and source code will remain in <code>/user/src</code>. These can be safely removed so long as you're completely certain which you are using (normally the latest) | |||
# Get the versions currently installed | |||
#* <code>dpkg --get-selections | grep linux-image</code> | |||
# 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> | |||
#* 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> | |||
To remove old source, just delete manually, | |||
* EG <code> rm -fr /usr/src/linux-headers-3.2.0-51 </code> | |||
== NTP == | == NTP == | ||
Line 187: | Line 265: | ||
#* <code> server 3.europe.pool.ntp.org </code> | #* <code> server 3.europe.pool.ntp.org </code> | ||
# Restart the NTP service | # Restart the NTP service | ||
#* <code> | #* <code> systemctl restart ntp </code> | ||
# Verify using the following commands | # Verify using the following commands | ||
#* <code> ntpq -np </code> | #* <code> ntpq -np </code> |