Changes

Jump to navigation Jump to search
m
no edit summary
Line 1: Line 1: −
This is intended to be a reference for setting up a VM or Server for AllStatLink.
+
[[Category: Infrastructure]]
 +
[[Category: How to]]
 +
{{Notice | 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.  
    
= Server Overview =  
 
= Server Overview =  
Line 36: 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
   −
==== Ubuntu 18 Config ====
+
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 uses the net netplan config.  It's gay as fuck.
+
==== No Netplan Config ====
 +
 
 +
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 53: Line 61:  
  apt-get install ifupdown
 
  apt-get install ifupdown
   −
Configure /etc/network/interfaces
+
Reconfigure network services
    
  systemctl unmask networking
 
  systemctl unmask networking
Line 64: 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 82: Line 90:  
     dns-search allstarlink.org
 
     dns-search allstarlink.org
 
     up /etc/network/firewall.sh
 
     up /etc/network/firewall.sh
 +
 +
==== 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]
 +
       
 +
*Once done run the following and test to make sure the IP address is reachable.  Follow the on-screen instructions:
 +
  netplan try
 +
 +
Refer to [https://netplan.io/examples/ Netplan configuration examples] for more examples on how to configure networking using netplan
    
==== Persistent Interface Names ====
 
==== Persistent Interface Names ====
===== UDEV method =====
+
 
 +
To ensure that interface names are persistent (e.g., ethX) you can choose using either UDEV or Grub. 
 +
 
 +
The Grub method tends to be easier and less prone to locking yourself out of a VM due to an interface naming conflict at reboot.
 +
 
 +
====== UDEV method ======
 
* There is typically only one network interface, and it will be named dynamically.  We must setup this using udev to be persistent
 
* There is typically only one network interface, and it will be named dynamically.  We must setup this using udev to be persistent
   Line 93: Line 127:  
     echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:73:86:06", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0"' >/etc/udev/rules.d/70-persistent-net.rules
 
     echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:73:86:06", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0"' >/etc/udev/rules.d/70-persistent-net.rules
   −
===== Grub method =====
+
====== Grub method ======
* Edit the /etc/default/grub file:
+
* Edit the '''''/etc/default/grub''''' file:
 
   vim /etc/default/grub
 
   vim /etc/default/grub
   −
* Look for "GRUB_CMDLINE"LINUX" and add the following "net.ifnames=0 biosdevname=0"
+
* Look for "GRUB_CMDLINE_LINUX" and add the following "net.ifnames=0 biosdevname=0"
 
   GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
 
   GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
   Line 103: Line 137:  
   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 121: Line 155:  
     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 319: Line 356:     
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