Difference between revisions of "Installation (Ubuntu)"

Jump to navigation Jump to search
2,773 bytes added ,  07:42, 8 October 2020
m
(Moved VM Tools install to VM Tools_Install_(Ubuntu))
 
(14 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 143: Line 148:
         address 192.168.1.150
         address 192.168.1.150
         netmask 255.255.255.0
         netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
         gateway 192.168.1.1
         gateway 192.168.1.1
        dns-search domain.com
 
        dns-search anotherdomain.com
dns-nameservers 192.168.1.20 8.8.8.8
         dns-nameservers 192.168.1.20 127.0.0.1
dns-domain localdomain.com
dns-search localdomain.com anotherdomain.com
          
</pre>
</pre>
* Then check the local hosts file <code>/etc/hosts</code>, so that the IP v4 part looks like this (so the host can resolve itself)...
* Then check the local hosts file <code>/etc/hosts</code>, so that the IP v4 part looks like this (so the host can resolve itself)...
Line 159: Line 164:
** <code> service networking restart </code>
** <code> service networking restart </code>


* Confirm network config is as expected with
* Confirm network interface config is as expected with
** <code>ifconfig</code>
** <code>ifconfig</code>
* Confirm DNS config is as expected with
** <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 169: 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 185: 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> service ntp restart </code>
#* <code> systemctl restart ntp </code>
# Verify using the following commands
# Verify using the following commands
#* <code> ntpq -np </code>
#* <code> ntpq -np </code>

Navigation menu