LIFE_OF_NETWORK_ENGINEER Telegram 165
bird_without_vrf.rtf
1.9 KB
Не получилось закончить историю с VRF в Linux.

В другом сценарии возникла необходимость поднять BGP с помощью Bird внутри VRF. Почему именно Bird, а не что-то другое? Все просто: он уже использовался на хосте. Скажем, что так исторически сложилось.

Для начала необходимо включить параметр l3mdev, чтобы Bird мог работать с интерфейсом внутри VRF:
sysctl -w net.ipv4.tcp_l3mdev_accept=1
sysctl -w net.ipv4.udp_l3mdev_accept=1


Далее нужно адаптировать конфигурацию Bird для работы с VRF. В BGP анонсировались IP-адреса, назначенные на loopback, и эту схему необходимо было сохранить.

Вот изменения, которые были добавлены в конфигурацию Bird при запуске внутри VRF:


router id 169.254.69.11;

protocol device {
vrf "vrf-prod"; # <- добавить VRF
scan time 20;
}

protocol bfd {
vrf "vrf-prod"; # <- добавить VRF
interface "*" {
interval 500 ms;
multiplier 3;
};
}

protocol kernel {
vrf "vrf-prod"; # <- добавить VRF
kernel table 101; # <- добавить таблицу
learn;
metric 64;
scan time 20;
import all;
graceful restart;
export filter {
krt_prefsrc = 169.254.69.11;
accept;
};
merge paths yes;
}
protocol direct {
interface "vrf-prod"; # <- добавить VRF вместо лупбека
}
####
filter export_to_peer {
if source = RTS_DEVICE then {
accept;
}
reject;
}
filter import_from_peer {
if source = RTS_BGP then {
accept;
}
reject;
}
####
protocol bgp PEER_1 {
vrf "vrf-prod"; #<- добавить VRF
local as 4240300609;
neighbor 169.254.69.12 as 4240300161;
direct;
bfd;
export filter export_to_peer;
import filter import_from_peer;
}
protocol bgp PEER_2 {
vrf "vrf-prod"; #<- добавить VRF
local as 4240300609;
neighbor 169.254.69.13 as 4240300161;
direct;
bfd;
export filter export_to_peer;
import filter import_from_peer;
}


У меня никак не получилось заставить Bird увидеть префиксы, назначенные на loopback внутри VRF (я старался). Поэтому я просто перенес их на интерфейс vrf-prod. В этом случае Bird сразу же их увидит через protocol direct.

Прикладываю конфигурации: netplan, Bird без VRF и Bird с VRF.

🎤Будни сетевика 😊
Please open Telegram to view this post
VIEW IN TELEGRAM
👍12🔥2😁1



tgoop.com/life_of_network_engineer/165
Create:
Last Update:

Не получилось закончить историю с VRF в Linux.

В другом сценарии возникла необходимость поднять BGP с помощью Bird внутри VRF. Почему именно Bird, а не что-то другое? Все просто: он уже использовался на хосте. Скажем, что так исторически сложилось.

Для начала необходимо включить параметр l3mdev, чтобы Bird мог работать с интерфейсом внутри VRF:

sysctl -w net.ipv4.tcp_l3mdev_accept=1
sysctl -w net.ipv4.udp_l3mdev_accept=1


Далее нужно адаптировать конфигурацию Bird для работы с VRF. В BGP анонсировались IP-адреса, назначенные на loopback, и эту схему необходимо было сохранить.

Вот изменения, которые были добавлены в конфигурацию Bird при запуске внутри VRF:


router id 169.254.69.11;

protocol device {
vrf "vrf-prod"; # <- добавить VRF
scan time 20;
}

protocol bfd {
vrf "vrf-prod"; # <- добавить VRF
interface "*" {
interval 500 ms;
multiplier 3;
};
}

protocol kernel {
vrf "vrf-prod"; # <- добавить VRF
kernel table 101; # <- добавить таблицу
learn;
metric 64;
scan time 20;
import all;
graceful restart;
export filter {
krt_prefsrc = 169.254.69.11;
accept;
};
merge paths yes;
}
protocol direct {
interface "vrf-prod"; # <- добавить VRF вместо лупбека
}
####
filter export_to_peer {
if source = RTS_DEVICE then {
accept;
}
reject;
}
filter import_from_peer {
if source = RTS_BGP then {
accept;
}
reject;
}
####
protocol bgp PEER_1 {
vrf "vrf-prod"; #<- добавить VRF
local as 4240300609;
neighbor 169.254.69.12 as 4240300161;
direct;
bfd;
export filter export_to_peer;
import filter import_from_peer;
}
protocol bgp PEER_2 {
vrf "vrf-prod"; #<- добавить VRF
local as 4240300609;
neighbor 169.254.69.13 as 4240300161;
direct;
bfd;
export filter export_to_peer;
import filter import_from_peer;
}


У меня никак не получилось заставить Bird увидеть префиксы, назначенные на loopback внутри VRF (я старался). Поэтому я просто перенес их на интерфейс vrf-prod. В этом случае Bird сразу же их увидит через protocol direct.

Прикладываю конфигурации: netplan, Bird без VRF и Bird с VRF.

🎤Будни сетевика 😊

BY Будни сетевика


Share with your friend now:
tgoop.com/life_of_network_engineer/165

View MORE
Open in Telegram


Telegram News

Date: |

A Telegram channel is used for various purposes, from sharing helpful content to implementing a business strategy. In addition, you can use your channel to build and improve your company image, boost your sales, make profits, enhance customer loyalty, and more. Judge Hui described Ng as inciting others to “commit a massacre” with three posts teaching people to make “toxic chlorine gas bombs,” target police stations, police quarters and the city’s metro stations. This offence was “rather serious,” the court said. Click “Save” ; Don’t publish new content at nighttime. Since not all users disable notifications for the night, you risk inadvertently disturbing them. There have been several contributions to the group with members posting voice notes of screaming, yelling, groaning, and wailing in different rhythms and pitches. Calling out the “degenerate” community or the crypto obsessives that engage in high-risk trading, Co-founder of NFT renting protocol Rentable World emiliano.eth shared this group on his Twitter. He wrote: “hey degen, are you stressed? Just let it out all out. Voice only tg channel for screaming”.
from us


Telegram Будни сетевика
FROM American