How To Configure a Discovery Ubuntu Instance
When you install Ubuntu on the F2H Discovery network you must provide a route to the gateway or your instance will not have any access to the outside world. We already configure the correct IPv4 and IPv6 information but customers must tell the instance where to look for the internet. Doing so is simple and is done by using the NoVNC console in your client area.
Create A Service
We want this change to persist across reboots so we are going to configure a new service that will run each time your instance boot’s up. This service will run a simple bash script to provide a route to the gateway. Let’s start coding! Create the file /etc/systemd/system/f2h.service and add the below code.
nano /etc/systemd/system/f2h.service
[Unit]
After=cloud-init.service
[Service]
ExecStart=/F2H/routes.sh
[Install]
WantedBy=default.target
Save and close the file. Chmod the file to 644
chmod 664 /etc/systemd/system/f2h.service
Create Startup Script
Now we are going to create a folder to house our script that will run at startup. Inside the folder create the file routes.sh
mkdir /F2H
nano /F2H/routes.sh
Inside the routes.sh file we enter our gateway information. We are going to add routes to the IPv4 and IPv6 gateway. This will allow both your IPv4 address and your IPv6 address to resolve from your NVMe VPS Server.
#!/bin/bash
# IPv4 Gateway
ip route add 10.10.10.1 dev eth0
ip route add default via 10.10.10.1
# IPv6 Gateway
route add -A inet6 default gw 2001:41d0:xXx:xxff:ff:ff:ff:ff
Ensure you use the correct gateway information which is listed in your Instance control panel under IP Information. Save and close the file then, chmod to 744.
chmod 744 /F2H/routes.sh
Finally, you can reload the service and reboot the server. On reboot IPv4 and IPv6 will be working.
systemctl daemon-reload
systemctl enable f2h.service
How was this article? – How To Configure a Discovery Ubuntu Instance
You might also like
More from Instance Management
How To Enable IPv6 Netplan Ubuntu Instances
On the Discovery network, we automatically configure IPv4 but sometimes to enable IPv6, Netplan needs some tweaks. In Ubuntu NVMe …
How To Configure An Internal MySQL Database Server
How To Configure An Internal MySQL Database Server High-value assets like database servers are always a target for hackers. Typically, these …