I have a dedicated server running Ubuntu 18.04, which is using systemd.network to manage its networking.
The server has only one physical NIC.
The hosing provider has allocated two IP addresses and two MAC addresses to me, as part of the service.
This is the configuration is /etc/systemd/network
[Match] Name=enp4s0 [Network] Address=<IPv6 Address>/64 Gateway=x.x.x.y Gateway=xxx::y [Address] Address=x.x.x.x Peer=x.x.x.y/32
The above configuration contains only one of my two allocated IPv4 addresses.
I need to add a virtual interface with the MAC address and IPv4 address of my second allocation. I am, however, unsure as how to achieve this.
Both interfaces need to use the same physical NIC.
I know how to achieve this with NetworkManager, but not systemd. I am not certain as to what is possible with systemd.network either... Do I need to create two virtual interfaces, both with their own IPv4 and MAC addresses, and have them both share the physical NIC for connectivity? Or should the existing configuration be left as is (as above) on the physical NIC and an additional virtual interface be created with the second set of details?
For simplicity sake, assume the following;
Address One (currently configured on physical NIC): IP Address: x.x.x.x MAC Address: XX:XX:XX:XX:XX:XX Gateway: x.x.x.y Address Two (currently unconfigured): IP Address: a.a.a.a MAC Address: AA:AA:AA:AA:AA:AA Gateway: x.x.x.y
Once the virtual interface is up (a.a.a.a), I will pass it directly though to a PFSense VM. Which will then act as an edge NAT router for all other VMs.