How to setup cPanel with GRE tunnel ?

crossing

Active Member
Oct 23, 2012
32
0
56
cPanel Access Level
Reseller Owner
Hello,

I need to protect my WHM Cpanel VPS against DDoS using nearby DDoS protected VPS. Anyone can guide me step by step how to achive that ?

I have tried this but failed:

On protected VPS:

echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf
sysctl -p
iptunnel add gre1 mode gre local YOUR_FILTERED_IP remote DESTINATION_SERVER_IP ttl 255
ip addr add 192.168.168.1/30 dev gre1
ip link set gre1 up


On the remote server I wish to protect:

iptunnel add gre1 mode gre local DESTINATION_SERVER_IP remote YOUR_FILTERED_IP ttl 255
ip addr add 192.168.168.2/30 dev gre1
ip link set gre1 up



Thank you..
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
Hello :)

This is a custom network configuration, and there's no native options in cPanel that will automatically configure/enable this setup. However, searching for a term such as "cPanel GRE Tunnel" on Google yields several results. Feel free to let us know if you encounter any issues with cPanel after configuring this.

Thank you.
 

crossing

Active Member
Oct 23, 2012
32
0
56
cPanel Access Level
Reseller Owner
Hello,

Its done but after server reboot all settings are lost. Where should I add this commands to be run it on reboot ?

iptunnel add gre1 mode gre local DESTINATION_SERVER_IP remote YOUR_FILTERED_IP ttl 255
ip addr add 192.168.168.2/30 dev gre1
ip link set gre1 up

ip rule add from 192.168.168.0/30 table DDoS
ip route add default via 192.168.168.1 table DDoS