This article explains how to run BGP daemon in your server at Heficed in order to establish BGP session with Heficed routers and announce your IPv4 and/or IPv6 IP ranges from your AS.

Few requirements before proceeding:

  1. Create RPKI and route objects for your IPv4 and/or IPv6 IP ranges with your AS number as origin.

  2. Make sure you are running CentOS 7 in your server since this article is based on CentOS 7 OS. However, the configuration is quite similar for other Linux versions.

Also, before proceeding, submit a ticket from your Terminal with request to create BGP session with your server by providing the following:

  1. Your server main IP address.

  2. Your public AS number.

  3. Your IPv4 and/or IPv6 IP ranges.

  4. BGP session password.

  5. What you wish to receive via BGP session:

    1. full table,

    2. full table and default gateway,

    3. only default gateway,

    4. nothing.

After receiving confirmation that BGP session has been created you may proceed with the next steps.

This part assumes you are using Cloud server to announce both IPv4 and IPv6 IP ranges.

Connect to your server and change network configuration from DHCP to static. Open file /etc/sysconfig/network-scripts/ifcfg-eth0 for editing:

[root@hhvya97bbk ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

The file should look as follows:

# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=dhcp
DEVICE=eth0
HWADDR=06:f3:42:00:01:4c
ONBOOT=yes
TYPE=Ethernet
USERCTL=no

Change the settings for static configuration by replacing the values with your actual IPv4 and IPv6 addresses.

# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=static
HWADDR=06:f3:42:00:01:4c
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPADDR=2.58.28.45
GATEWAY=2.58.28.1
NETMASK=255.255.255.0
IPV6INIT=yes
IPV6ADDR=2a03:fbc6:1:829a::/48
IPV6_DEFAULTGW=2a03:fbc6:1:8000:8000::1

Edit file /etc/cloud/cloud.cfg and add the following lines at the end of the file:

network:
config: disabled

Restart the server to apply the changes:

[root@hhvya97bbk ~]# reboot

Login back to the server and confirm if IPv4 and IPv6 connectivity is working:

[root@hhvya97bbk ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=1.24 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=117 time=1.18 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.188/1.218/1.249/0.046 ms

[root@hhvya97bbk ~]# ping6 2001:4860:4860::8888
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=117 time=2.31 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=118 time=0.522 ms
^C
--- 2001:4860:4860::8888 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.522/1.420/2.318/0.898 ms

Add your IPv4 and/or IPv6 IP ranges on the network interface:

[root@hhvya97bbk ~]# ip addr add 191.96.202.0/24 dev eth0
[root@hhvya97bbk ~]# ip -6 addr add 2a0e:1c04:1::/48 dev eth0

Update repository and install bird daemon by running the following commands one by one:

yum -y update
yum -y install bird

Open file /etc/bird.conf and append the file with following lines. Make sure to replace the example IP addresses and IP ranges with your actual IP as well as your AS number and BGP password.

log syslog all;

#Router ID = server main IP address
router id 2.58.28.45;

protocol device {
scan time 10; # Scan interfaces every 10 seconds
}

#Disable automatically generating direct routes to all network interfaces.
protocol direct {
disabled; # Disable by default
}

#Forbid synchronizing BIRD routing tables with the OS kernel.
protocol kernel {
import all; # Import to table, default is import all
export all; # Export to protocol. default is export none
}

#Route your subnet via your server main IP address
protocol static {
route 191.96.202.0/24 via 2.58.28.45;
}

#local = your server main IP address and your AS number
#neighbor = gateway of your server main IP address and Heficed AS number which is 61317 by default
#password = BGP session password
protocol bgp Heficed {
description "BGP session to Heficed";
local 2.58.28.45 as 397727;
neighbor 2.58.28.1 as 61317;
password "YOUR-BGP-PASSWORD";
import filter { print "importing"; accept; };
export filter { print "exporting"; accept; };
}

Save the file and close it. Apply the changes with the following command:

systemctl restart bird

Check if bird daemon is running:

systemctl status bird
● bird.service - BIRD Internet Routing Daemon
Loaded: loaded (/usr/lib/systemd/system/bird.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2021-06-26 08:58:02 UTC; 1s ago
Main PID: 22910 (bird)
CGroup: /system.slice/bird.service
└─22910 /usr/sbin/bird -f -u bird -g bird

Jun 26 08:58:02 hhvya97bbk systemd[1]: Started BIRD Internet Routing Daemon.
Jun 26 08:58:02 hhvya97bbk bird[22910]: Started

9. Enter bird console with command "birdc":

# birdc
BIRD 1.6.8 ready.
bird>

Check if BGP session is established with command "show protocol all Heficed":

bird> show protocol all Heficed
name proto table state since info
Heficed BGP master up 08:58:07 Established
Description: BGP session to Heficed
Preference: 100
Input filter: (unnamed)
Output filter: (unnamed)
Routes: 1 imported, 1 exported, 1 preferred
Route change stats: received rejected filtered ignored accepted
Import updates: 1 0 0 0 1
Import withdraws: 0 0 --- 0 0
Export updates: 2 1 0 --- 1
Export withdraws: 0 --- --- --- 0
BGP state: Established
Neighbor address: 2.58.28.1
Neighbor AS: 61317
Neighbor ID: 141.98.88.124
Neighbor caps: refresh restart-aware llgr-aware AS4
Session: external AS4
Source address: 2.58.28.45
Hold timer: 56/90
Keepalive timer: 30/30

bird>

That's it, your BGP IPv4 session is established and your IPv4 IP range should be visible in the global routing table.

To establish IPv6 BGP session install bird6 package with command below:

yum -y install bird6

Edit configuration file /etc/bird6.conf and append the file with the following contents. Make sure to replace the example IP addresses and IP ranges with your actual IP as well as your AS number and BGP password.

log syslog all;

#Router ID = server main IPv4 address
router id 2.58.28.45;

protocol device {
scan time 10; # Scan interfaces every 10 seconds
}

#Disable automatically generating direct routes to all network interfaces.
protocol direct {
disabled; # Disable by default
}

#Forbid synchronizing BIRD routing tables with the OS kernel.
protocol kernel {
import all; # Import to table, default is import all
export all; # Export to protocol. default is export none
}

#Route your subnet via your server main IP address
protocol static {
route 2a0e:1c04:1::/48 via 2a03:fbc6:1:829a::;
}

#local = your server main IP address and your AS number
#neighbor = gateway of your server main IP address and Heficed AS number which is 61317 by default
#password = BGP session password
protocol bgp Heficed {
description "BGP session to Heficed";
local 2a03:fbc6:1:829a:: as 397727;
neighbor 2a03:fbc6:1:8000:8000::1 as 61317;
password "YOUR-BGP-PASSWORD";
import filter { print "importing"; accept; };
export filter { print "exporting"; accept; };
}

Apply the changes with the following command:

systemctl restart bird6

Confirm if bird6 daemon is running:

# systemctl status bird6
● bird6.service - BIRD Internet Routing Daemon
Loaded: loaded (/usr/lib/systemd/system/bird6.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2021-06-26 09:20:11 UTC; 3s ago
Main PID: 23161 (bird6)
CGroup: /system.slice/bird6.service
└─23161 /usr/sbin/bird6 -f -u bird6 -g bird6

Jun 26 09:20:11 hhvya97bbk systemd[1]: Started BIRD Internet Routing Daemon.
Jun 26 09:20:11 hhvya97bbk bird6[23161]: Started

Enter bird6 console with command and check if the session is established:

# birdc6
BIRD 1.6.8 ready.
bird> show protocol all Heficed
name proto table state since info
Heficed BGP master up 09:20:15 Established
Description: BGP session to Heficed
Preference: 100
Input filter: (unnamed)
Output filter: (unnamed)
Routes: 1 imported, 1 exported, 1 preferred
Route change stats: received rejected filtered ignored accepted
Import updates: 1 0 0 0 1
Import withdraws: 0 0 --- 0 0
Export updates: 4 2 0 --- 2
Export withdraws: 0 --- --- --- 1
BGP state: Established
Neighbor address: 2a03:fbc6:1:8000:8000::1
Neighbor AS: 61317
Neighbor ID: 141.98.88.124
Neighbor caps: refresh restart-aware llgr-aware AS4
Session: external AS4
Source address: 2a03:fbc6:1:829a::
Hold timer: 80/90
Keepalive timer: 9/30

bird>

That's it, your IPv6 BGP session is established and your IPv6 IP range should be visible in the global routing table.

Did this answer your question?