apt get life

Life around technology

  • Technology
    • Guides
    • Linux
    • Development
      • Laravel
    • Misc
    • Raspberry Pi
  • Writing
  • Crafts
    • Crochet
    • Model Making
    • Painting
  • Privacy Policy
You are here: Home / Archives for Technology / Guides

Setting up a bond and a bridge in Netplan on Ubuntu Server 20.04

2020/06/03 by sudo 2 Comments

I’m in the process of updating my KVM servers from Ubuntu 18.04 to Ubuntu 20.04. Along with the new version of Ubuntu there’s been some changes in netplan.

What I’ve done is edit the default file created after the Ubuntu Server installation /etc/netplan/00-installer-config.yaml and setup the following:

network:
  bonds:
    bond0:
      interfaces:
      - eno1
      - eno2
      parameters:
        mode: active-backup
  ethernets:
    eno1: {}
    eno2: {}
  version: 2
  bridges:
    br0:
      dhcp4: true
      interfaces:
        - bond0
      mtu: 1500
      parameters:
        stp: false
        forward-delay: 4

This has my two interfaces eno1 and eno2 and created bond0 as an active backup. There’s a few different networking modes you can chose from:

Bond ModeDescription
balance-rrRound robin network configuration. Packets are send in sequential order from the first connection listed, going down the chain
active-backupOnly the first connection is used, unless it fails, in which case another connection is used
balance-xorThis uses a transmission policy to route between interfaces and provides both load balancing and fault tolerance
broadcastNot sure why you’d use this – sends data on all interfaces
802.3adThis is an IEEE standard. It does require switches to support the same protocol. This mode aggregates the connection to provide the benefit of bandwidth from all configured interfaces.
balance-tlbManages load between the the network adapters based on demand and availability
balance-albIncludes both transmission load balancing (balance-tlb) and receive load balancing.

Then, the bridge br0 connects to bond0. This is where you configure the network type – DHCP or static IP. In this case I’m using DHCP as the firewall I have in place manages IP address assignments and it has the server set to a static address. If you want to specify a static IP address in this configuration file, you can do it like below:

network:
  bonds:
    bond0:
      interfaces:
      - eno1
      - eno2
      parameters:
        mode: active-backup
  ethernets:
    eno1: {}
    eno2: {}
  version: 2
  bridges:
    br0:
      addresses:
        - 192.168.10.30/24
      dhcp4: false
      gateway4: 192.168.10.1
      nameservers:
        addresses:
          - 192.168.10.1
          - 192.168.10.2
        search: []
      interfaces:
        - bond0

You can find out more information here:
https://netplan.io/examples

There’s a version of this post for 18.04 here (see the comments with suggested fixes):
https://www.aptgetlife.co.uk/setting-up-a-bond-and-bridge-in-netplan-on-ubuntu-18-04/

Filed Under: Guides, Linux, Technology Tagged With: networking, ubuntu, ubuntu 20.04, ubuntu server

Add a policy to ImageMagick in Debian

2016/05/04 by sudo

As Arstechnica have recently reported, there is a critical security vulnerability in ImageMagick, an image processing library used by many websites. While official patches are being worked on, this is a reccomended workaround to secure ImageMagick on Debian.

1. Check loaded Imagick policies

From a terminal, check to see if any policies are loaded. There will almost certainly be none returned if you’ve not configured any previously.

convert -list policy

2. Open Imagick’s policy.xml file

In Debian, you can find the ImageMagick policy file in /etc/ImageMagick:

nano /etc/ImageMagick/policy.xml

In other operating systems your best bet is to run a find:

find /usr | grep "policy.xml"

3. Edit policy.xml

Now we need to edit policy.xml. The current reccomended settings related to the vulnerability are here: https://gist.github.com/rawdigits/d73312d21c8584590783a5e07e124723 It’s best to check this URL for the latest version. Alternatively here’s the code at time of writing:

<policymap>
  <policy domain="coder" rights="none" pattern="EPHEMERAL" />
  <policy domain="coder" rights="none" pattern="URL" />
  <policy domain="coder" rights="none" pattern="HTTPS" />
  <policy domain="coder" rights="none" pattern="MVG" />
  <policy domain="coder" rights="none" pattern="MSL" />
</policymap>

Remember it’s Ctrl + x to exit nano and you do want to save the changes. If you’re told you don’t have write permissions try closing the file and opening it again with sudo.

4. Check the Imagick policy is loaded

Now re-run the first step to make sure the policy has been loaded properly.

convert -list policy

You should get the following output:

#
Path: [built-in]
  Policy: Undefined
    rights: None 

Path: /etc/ImageMagick/policy.xml
  Policy: Coder
    rights: None 
    pattern: EPHEMERAL
  Policy: Coder
    rights: None 
    pattern: URL
  Policy: Coder
    rights: None 
    pattern: HTTPS
  Policy: Coder
    rights: None 
    pattern: MVG
  Policy: Coder
    rights: None 
    pattern: MSL

For more details on the problem, check out the ArsTechnica post here, and the ImageMagick forum announcement on the subject here.

Official patches are due to be distributed over the weekend, but may take longer to enter your distributions package manager.

Filed Under: Guides, Technology Tagged With: ImageMagick, security

Installing FFMpeg on Linux Mint 17.3

2016/02/13 by sudo

There seems to be a lot of trouble with FFMpeg and AVConv packages in Ubuntu and derivatives lately. Instead of delving into why, I’m more interested in how to get one of these fantastic video converters installed on Linux Mint 17.3 so I can get on with my encoding. One of the former PPAs is no longer available, however it is possible to use this one now linked to from the FFMpeg site: https://launchpad.net/~mc3man/+archive/ubuntu/trusty-media

To setup the PPA and install FFMpeg run the following:

sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg

Since Linux Mint 17.* are all based on Ubuntu 14.04 (Trusty), using the trusty PPA will work.

Filed Under: Guides Tagged With: ffmpeg, Linux Mint 17

T420 Smooth Surface Touchpad

2016/01/02 by sudo

So, I’ve been repairing some Lenovo T420 laptops recently and a few of them have had really worn touchpads. Unlike the older generation of Thinkpads, the T420 has little dots all over the touchpad, giving it a textured finish.

W520 Touchpad

Textured Touchpad

I’m not quite sure what the design motivation was behind this, but they seem to wear off quickly, leaving the touchpad looking quite unsightly. One of the T420’s actually had a smooth area in the centre of the touchpad that all the dimples had worn off from, which gave me an idea. I wonder if you can simply scrape off the textured dimples?

T420 Smooth Finish Touchpad

T420 Smooth Finish Touchpad

In order to remove the textured surface from the touchpad, you’ll need something ridged but not abrasive. A knife is not a good idea. Use something like a finger nail or old bank card and carefully scratch a the surface layer of the touchpad. On my first attempt this was easy, the dimples had erroded in the centre allowing me to start from there and work outwards towards the edges of the touchpad. I’d assume if the touchpad isn’t in such bad condition simply using friction would yield the same results. By the time I’d finished I had a smooth touchpad, similar to that of the T500 range. There was some leftover glue residue which can be removed using furniture polish sprayed onto a cloth or kitchen towel and gently rubbed over the affected area.

An alternative to this is you can buy replacement touchpad stickers with the texture on eBay or similar – searching for “T420 touchpad” seemed to return plenty of results.

Filed Under: Guides, Technology Tagged With: hacks, laptops, lenovo, t420

Install Docker on Linux Mint 17.2

2015/10/21 by sudo

This post provides practical steps to setting up docker to run on Linux Mint 17.2, which is what I’m using on my development machine at the moment.

Before beginning, make sure you have remove any existing version(s) of Docker from your system.

First, add the Docker repository key

sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609

Then create a new file for apt to find the Docker repository

sudo nano /etc/apt/sources.list.d/docker.list

Inside the docker.list file enter the following

# Ubuntu Trusty/Mint 17.2
deb https://apt.dockerproject.org/repo ubuntu-trusty main

Save and close the file. Now we want to get the latest updates from the new repository

sudo apt-get update

Once this finishes, you should now be able to install the latest Docker version

sudo apt-get install docker-engine

Once this has run, you can test the hello world docker image, which is tiny and quick to download

sudo docker run hello-world

 

Filed Under: Guides, Technology Tagged With: docker, linux mint 17.2

  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next Page »

Recent Posts

  • System Hang on Ubuntu 24.04 “e1000_print_hw_hang”
  • Disable iLO on HP Microserver Gen8
  • Ubuntu Desktop 24.04 Change Wallpaper Settings
  • Customising Ubuntu Desktop 24.04
  • Remove domains from Let’s Encrypt using Certbot

Tags

API auditing crochet data recovery debian debudding development Dingo API docker email Getting started with Laravel 5 & Dingo API hard drive health HP Microserver KVM Laravel larvel 5 lenovo Linux Minion mint netgear nas networking network shares php PHP development Postfix raspberry pi review samba security SMART smartctl smartmontools smb testing traefik ubuntu ubuntu 18.04 ubuntu 20.04 ubuntu 22.04 ubuntu server vagrant Virtual machines xdebug xubuntu

© Copyright 2015 apt get life

 

Loading Comments...