Networking

From Bitpost wiki

Ubuntu basics

To see network details:

ip a

Bring an interface up/down:

sudo ifconfig enp4s0 down
sudo ifconfig enp4s0 up

DNSMasq

I disabled systemd and use dnsmasq for bitpost routing.

It provides static IPs to LAN via MAC addresses.

It performs DNS caching. Use /etc/resolv.conf to set up fallback DNS.

Update to new ISP

I did this for google fiber on 2022/09/30.

  • Set up new ISP while keeping old
  • Update any ethernet cables and NIC cards; I need cat6 from google fiber router GRAY port (2Gbps); I ordered a 10G network card on Amazon, not here yet.
  • Remove old ISP cable from RJ45, plug in new ISP cable
  • ssh 192.168.22.1 to get a terminal to bitpost box
  • check that a new IP was obtained via `ip a`
  • RESTART THE FIREWALL, it MUST BE STARTED after the IP is obtained! This was the kicker that had me scratching my head for an hour.
sudo su -
edit_firewall
# Ctrl-D to save and exit and restart it
  • Check that you can ping google.com; check that LAN is up and ready
  • Go update ALL domains.google.com DNS records with the new IP!
  • Pray for IP stability! reddit commentors gave me hope, we will see...

Update to use new network card (NIC)

After ensuring that google fiber worked, I upgraded bitpost to a 10g NIC card. systemd added new interface names for the two RJ45 jacks on the card.

There are THREE PLACES where those names must be changed:

ubuntu/bitpost/root/stronger_firewall_and_save
ubuntu/bitpost/etc/dnsmasq.d/mdm_lan_dnsmasq.conf
ubuntu/bitpost/etc/netplan/00-installer-config.yaml
  • Go ahead and cable bitpost directly to the HDMI display, and get a terminal going there.
  • Power down, install the NIC, power up.
  • Type `ip a` to see the new network interface names.
# MDM moving from 1Gbps internal mobo nics (enp4/5) to 10Gbps Intel nic card (enp10s0f0/1)
#1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
#2: enp5s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
#3: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
#4: enp10s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
#5: enp10s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
  • Restart the network with the new plan, via `sudo netplan apply`, and verify with `ip a`.
  • Restart the firewall to use the newly available network names, via:
sudo su -
edit_firewall
  • Restart dnsmasq to use the new network name, via `sudo service dnsmasq restart`.
  • The IP changed due to a new NIC MAC, so once things settle down, go update all DNS records, and (again) restart dnsmasq to clear its cache.

WOW, I now have >1Gbps networking to bitpost.com, abettertrader.com, etc!

Force apt to use a proxy

Edit /etc/apt/apt.conf:

Acquire::http::Proxy "http://myproxy.com:####";