Ubuntu Server 18.04.1 Netplan and UFW

Ok, so I want to make a router using Ubuntu Server 18.04 ( already have the hardware and it all works, I have IPfire currently on it). I’ve looked at all the router distros and they seem rather limited in scope.

#Sources
The article:
https://arstechnica.com/gadgets/2016/04/the-ars-guide-to-building-a-linux-router-from-scratch/

The firewall guide:

Ubuntu Server now uses netplan. I’ve looked at the documentation and it’s fairly clear I am not exactly skilled at this usage of the OS. I was hoping maybe someone could help me “translate” the way this article does it (the way I am more familiar) into the more modern implementation.

How would I make a netplan version of this?

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The WAN interface, marked Lan1 on the case
auto p4p1
iface p4p1 inet dhcp

# The LAN interface, marked Lan2 on the case
auto p1p1
iface p1p1 inet static
	address 192.168.99.1
	netmask 255.255.255.0

Also, I would prefer to use UFW over directly using iptables, as most of the rules in UFW are also what most of the article states.
One key difference from the article is he has this for the NAT section.

From Article:

*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]

# p4p1 is WAN interface, #p1p1 is LAN interface
-A POSTROUTING -o p4p1 -j MASQUERADE

COMMIT

From Firewall Guide:

# nat Table rules
*nat
:POSTROUTING ACCEPT [0:0]

# Forward traffic from eth1 through eth0.
-A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

# don’t delete the ‘COMMIT’ line or these nat table rules won’t be processed
COMMIT

But, after I figure out those two sections. I should be able to handle the rest. Any help would be great!

This site is for the co-ordination of the Ubuntu project, and not support.

For Ubuntu Support options, you’ll find many listed at https://community.ubuntu.com/t/finding-help/712