I have spent many months configuring SmoothWAN with Engarde on my Raspberry Pi 4. I love using SmoothWAN. However, I cannot get it to work on Oracle Cloud VPS or Amazon AWS due to my limited knowledge - I believe they require some changes to the syntax in cloud init script, in order to work on Oracle/AWS?
The guidelines specify how to set it up on Vultr using Cloud init script. However, Vultr seems to trigger huge latency spikes in some games. The same script does not work on Oracle/AWS.
Can someone please help set up SmoothWAN with Engarde on Oracle Cloud? A script for AWS EC2 would be a bonus!
Yes, Oracle and AWS are tricky to setup, and you need to open ports in the VPC page.
Will create a manual installation script next release for setup without cloud-init.
Hey, I tried to do on my own according your cloud-init, but not working maybe I do need more ports to be exposed in VCN on oracle? I did 1024-65000
Please correct me where can be a problem (my second time writing shell script )
#!/bin/bash
# ANSI color codes // light colors
ORANGE='\033[33m'
RED='\033[91m'
CYAN='\033[96m'
RESET='\033[0m'
# Check if you are running as sudo
if [ "$EUID" -ne 0 ]; then
echo && echo
echo -e "${RED}This script requires superuser privileges. Please run it with sudo.${RESET}"
exit 1
fi
# Start
clear
echo && echo
echo -e "${CYAN}Running the installation script for Engarde...${RESET}"
echo
sleep 3
# Install WireGuard
apt-get update
apt-get install -y wireguard
# Set the Password
Password="7xzfz1MUwKvPRQ9tuXKF"
# Disable firewalld and ufw
systemctl disable firewalld
systemctl stop firewalld
ufw disable
# Configure WireGuard
SERVER_PUB_NIC=$(ip route | awk 'NR==1{print$5}')
printf $Password | openssl dgst -binary -sha256 | openssl base64 -A > /root/private-key
ckey=$(cat /root/private-key | openssl dgst -binary -sha256 | openssl base64 -A)
cpubkey=$(echo $ckey | wg pubkey)
printf $ckey | openssl dgst -binary -sha256 | openssl base64 -A > /root/preshared-key
ip link add dev wg0 type wireguard
ip address add dev wg0 10.202.0.5 peer 10.202.0.10
wg set wg0 listen-port 65532 private-key /root/private-key peer $cpubkey preshared-key /root/preshared-key allowed-ips 10.202.0.10 persistent-keepalive 25
ip link set up dev wg0
# Download and install engarde-server
wget https://github.com/SmoothWAN/engarde/releases/download/master/engarde-server.linux.arm64 -O /usr/bin/engarde-server
chmod +x /usr/bin/engarde-server
mkdir -p /etc/engarde
wget https://raw.githubusercontent.com/SmoothWAN/SmoothWAN-misc/main/engarde/engarde-server.yml -O /etc/engarde/engarde.yml
/usr/bin/engarde-server /etc/engarde/engarde.yml &
# Configure network settings
ip link set wg0 mtu 1280
ulimit -n 65535
sysctl -w net.core.rmem_max=26214400
sysctl -w net.core.rmem_default=26214400
sysctl -w net.core.wmem_max=26214400
sysctl -w net.core.wmem_default=26214400
sysctl -w net.core.netdev_max_backlog=2048
echo 1 > /proc/sys/net/ipv4/ip_forward
# Configure iptables rules
iptables -A FORWARD -i $SERVER_PUB_NIC -o wg0 -j ACCEPT
iptables -A FORWARD -i wg0 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.202.0.0/24 -j MASQUERADE
# Change port range for port forwarding
iptables -t nat -A PREROUTING -i $SERVER_PUB_NIC -p udp --dport 1024:65000 -j DNAT --to-destination 10.202.0.10:1024-65000
iptables -t nat -A PREROUTING -i $SERVER_PUB_NIC -p tcp --dport 1024:65000 -j DNAT --to-destination 10.202.0.10:1024-65000
# End
echo && echo
echo -e "${CYAN}Script has been completed${RESET}"
echo
echo -e "${ORANGE}for further information visit SmoothWAN documentation -->${RESET}"
echo -e "${ORANGE}--> https://smoothwan.com/engarde/${RESET}"
echo && echo
Hi Talal, can you kindly provide a cloud-init script for Oracle? I should be able to test it. I am not an advanced user, but I do use engarde on Vultr on a daily basis.
Otherwise, it would greatly help if you could test on Amazon AWS? Aside from Oracle and Amazon, I find that I have significantly higher gaming ping on other cloud providers.
I can’t make the script without testing firsthand unfortunately.
Would AWS be ok?
Edit: Just saw the previous reply mentioning it, will let you know soon.
I’m happy to report it’s working thank you! Not sure if the issues were caused by t2.micro (1 CPU) previously. If you need me for testing Oracle or any future releases, let me know. I’ll join the discord.
Have you tried doing similar steps in VPC (security list) with Oracle?
Note that the Ubuntu image in Oracle is modified and strict, you need to login to the VPS and run: