Skip to content

Commit

Permalink
terraform: update ubuntu 24.04, update ethtool (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
clstokes committed Aug 26, 2024
1 parent 20c06bc commit 80d208c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion terraform/aws/internal-modules/aws-ec2-autoscaling/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data "aws_ami" "ubuntu" {

filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-*-server-*"]
values = ["ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-*-server-*"]
}

filter {
Expand Down
2 changes: 1 addition & 1 deletion terraform/aws/internal-modules/aws-ec2-instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data "aws_ami" "ubuntu" {

filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-*-server-*"]
values = ["ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-*-server-*"]
}

filter {
Expand Down
6 changes: 3 additions & 3 deletions terraform/azure/internal-modules/azure-linux-vm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource "azurerm_network_interface" "primary" {
private_ip_address_allocation = "Dynamic"
public_ip_address_id = var.public_ip_address_id
}
enable_ip_forwarding = module.tailscale_install_scripts.ip_forwarding_required
ip_forwarding_enabled = module.tailscale_install_scripts.ip_forwarding_required
}

resource "azurerm_network_interface_security_group_association" "tailscale" {
Expand Down Expand Up @@ -73,8 +73,8 @@ resource "azurerm_linux_virtual_machine" "tailscale_instance" {

source_image_reference {
publisher = "Canonical"
offer = "0001-com-ubuntu-server-jammy"
sku = "22_04-lts-gen2"
offer = "ubuntu-24_04-lts"
sku = "server"
version = "latest"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ resource "google_compute_firewall" "tailscale_ingress_ipv6" {

data "google_compute_image" "ubuntu" {
project = "ubuntu-os-cloud"
family = "ubuntu-2204-lts"
family = "ubuntu-2404-lts-amd64"
}

resource "google_compute_instance" "tailscale_instance" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@

echo -e '\n#\n# Beginning ethtool udp optimization configuration...\n#\n'

NETDEV=$(ip route show 0/0 | cut -f5 -d' ')
NETDEV=$(ip -o route get 8.8.8.8 | cut -f 5 -d " ")
sudo ethtool -K $NETDEV rx-udp-gro-forwarding on rx-gro-list off

for d in $NETDEV; do
ethtool -K $d rx-udp-gro-forwarding on rx-gro-list off
if [ "$?" -ne "0" ]; then
echo -e '\n#\n# ERROR: ethtool udp optimization failed.\n#\n'
exit 1
fi
done
printf '#!/bin/sh\n\nethtool -K %s rx-udp-gro-forwarding on rx-gro-list off \n' "$(ip -o route get 8.8.8.8 | cut -f 5 -d " ")" | sudo tee /etc/networkd-dispatcher/routable.d/50-tailscale
sudo chmod 755 /etc/networkd-dispatcher/routable.d/50-tailscale

for d in $NETDEV; do
printf '#!/bin/bash\n\nethtool -K %s rx-udp-gro-forwarding on rx-gro-list off \n' $d | sudo tee /etc/networkd-dispatcher/routable.d/50-tailscale-$d
chmod 755 /etc/networkd-dispatcher/routable.d/50-tailscale-$d
done
sudo /etc/networkd-dispatcher/routable.d/50-tailscale
test $? -eq 0 || echo 'An error occurred.'

echo -e '\n#\n# Complete.\n#\n'

0 comments on commit 80d208c

Please sign in to comment.