sudo apt-get update
sudo apt-get install bird -y
# /etc/bird/bird.conf
# define your router ID
router id X.X.X.X;
# define your bgp sessions
protocol bgp {
local as AS_NUMBER; # replace with your AS number
neighbor PEER_IP as AS_NUMBER; # replace with your provider's IP and AS number
import all;
export all;
}
# define your network
protocol kernel {
ipv6 {};
export all;
}
# define the IPv6 subnet you want to announce
protocol static {
route 2aXX:XXXX:XXXX::/48 via GATEWAY_IP; # replace with your IPv6 subnet and VPS1's gateway IP
}
# /etc/bird/bird.conf
# define your router ID
router id X.X.X.X; # replace with VPS2's IP
# define the gretap interface
protocol kernel {
learn;
scan time 20;
import all;
}
protocol gretap {
description "gretap tunnel to VPS1";
local GRETAP_IP { remote VPS1_IP; }; # replace with your VPS2's gretap IP and VPS1's IP
mtu 1450;
ttl 64;
}
# define your bgp sessions
protocol bgp {
local as AS_NUMBER; # replace with your AS number
neighbor GRETAP_IP as AS_NUMBER; # replace with your VPS2's gretap IP
import all;
export all;
}
sudo ip link add name gretap1 type gretap local VPS1_IP remote VPS2_IP key 1
sudo ip link set gretap1 up
sudo ip addr add GRETAP_IP/24 dev gretap1
sudo ip link add name gretap1 type gretap local VPS2_IP remote VPS1_IP key 1
sudo ip link set gretap1 up
sudo ip addr add GRETAP_IP/24 dev gretap1
sudo systemctl restart bird