Changes

Jump to navigation Jump to search
Added netplan configuration info
Line 1: Line 1:  +
[[Category: Infrastructure]]
 +
[[Category: How tos]]
 
{{ Note|'''This document reflects the current Infrastructure as of 2021-01-17''' }}
 
{{ Note|'''This document reflects the current Infrastructure as of 2021-01-17''' }}
 
This is intended to be a reference for setting up a VM or Server for PTTLink.  
 
This is intended to be a reference for setting up a VM or Server for PTTLink.  
Line 37: Line 39:  
  apt-get install ntp ntpdate python vim screen ipsec-tools strongswan fail2ban snmp haveged libacl1-dev python3-dev libssl-dev gcc g++ fio pbzip2 ncdu
 
  apt-get install ntp ntpdate python vim screen ipsec-tools strongswan fail2ban snmp haveged libacl1-dev python3-dev libssl-dev gcc g++ fio pbzip2 ncdu
   −
=== Mandatory Configs ===
+
=== Configuration ===
 +
There are two types of configuration presented below:
 +
*No Netplan config - removes netplan and swtiches back to ifupdown
 +
*Netplan config - keeps netplan
 +
 
 +
As new versions of Ubuntu are released, it is very possible that netplan will become the only officially supported means to configure networking.  Keeping that in mind, all efforts should be made to configure Ubuntu 20+ servers using netlpan with a fallback to the no netplan config as the last resort.
   −
==== Ubuntu 18 Config ====
+
==== No Netplan Config ====
   −
Ubuntu 18 uses the net netplan config.  It sucks badly.
+
You can remove this and go back to ''ifupdown'' as follows.
    
First you need to disable the resolved service:
 
First you need to disable the resolved service:
Line 54: Line 61:  
  apt-get install ifupdown
 
  apt-get install ifupdown
   −
Configure  /etc/network/interfaces
+
Configure  '''''/etc/network/interfaces'''''
    
  systemctl unmask networking
 
  systemctl unmask networking
Line 65: Line 72:  
  apt-get --assume-yes purge nplan netplan.io
 
  apt-get --assume-yes purge nplan netplan.io
   −
==== Network Config ====
+
Network Config
 
* The network should be configured to use /etc/network/interfaces, and add DNS and the firewall to it and search in the allstarlink.org domain
 
* The network should be configured to use /etc/network/interfaces, and add DNS and the firewall to it and search in the allstarlink.org domain
   Line 84: Line 91:  
     up /etc/network/firewall.sh
 
     up /etc/network/firewall.sh
   −
===== Persistent Interface Names =====
+
==== Netplan config ====
 +
 
 +
Configure the network using /etc/netplan files.  You should remove any existing files and create a new one called 01-netcfg.yaml with the following:
 +
 
 +
  network:
 +
    version: 2
 +
    rendered: networkd
 +
    ethernets:
 +
      eth0:
 +
        addresses:
 +
          - 44.98.254.1/24
 +
        gateway4: 44.98.254.1
 +
        nameservers:
 +
          search: [allstarlink.org]
 +
          addresses: [1.1.1.1]
 +
       
 +
Refer to [https://netplan.io/examples/ Netplan configuration examples] for more examples on how to configure networking using netplan
 +
 
 +
==== Persistent Interface Names ====
    
To ensure that interface names are persistent (e.g., ethX) you can choose using either UDEV or Grub.   
 
To ensure that interface names are persistent (e.g., ethX) you can choose using either UDEV or Grub.   
Line 100: Line 125:     
====== Grub method ======
 
====== Grub method ======
* Edit the /etc/default/grub file:
+
* Edit the '''''/etc/default/grub''''' file:
 
   vim /etc/default/grub
 
   vim /etc/default/grub
   Line 109: Line 134:  
   sudo grub-mkconfig -o /boot/grub/grub.cfg
 
   sudo grub-mkconfig -o /boot/grub/grub.cfg
   −
==== Other required config items ====
+
==== Other config items ====
    
* configure screen to use the scroll back buffer
 
* configure screen to use the scroll back buffer
Line 127: Line 152:  
     Then select #3 vim.basic
 
     Then select #3 vim.basic
   −
* setup a firewall as /etc/network/firewall.sh and chmod +x it.  You'll need to edit this based on the machine. Note the stuff in tampa uses a firewall on the HV too.
+
* setup a firewall and chmod +x it.  You'll need to edit this based on the machine.
 +
**For netplan place this file in '''''/etc/networkd-dispatcher/routable.d/50-ifup-hooks'''''
 +
**For ifupdown place this file in '''''/etc/network/firewall.sh'''''
 +
 
 
     #!/bin/bash
 
     #!/bin/bash
 
      
 
      
Line 325: Line 353:     
Please ensure it's being watched in librenms by asking on the admin list or in the slack.
 
Please ensure it's being watched in librenms by asking on the admin list or in the slack.
  −
[[Category: Infrastructure]]
 

Navigation menu