<div dir="ltr"><div>Hi Hans,</div><div><br></div><div>What about just adding it to your LOCAL_NET list? If it works for the first IP, why it shouldn't work for the other?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 20, 2024 at 8:36 AM Hans Heng via Bird-users <<a href="mailto:bird-users@network.cz">bird-users@network.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><pre><code>Hi all!
I have a dual-home server, whose connection topology and configuration is described as below.
**** Connection Topology and Configuration ****
The server has two physical NICs enp4s0f0 and enp4s0f1, which are connected to two separate ports TOR_A and TOR_B on a Top of Rack (TOR) router, each representing a separate BGP session through bgp_A and bgp_B protocol.
The server also has a dummy interface named em5, which has a private ip <a href="http://38.145.72.193/32" target="_blank">38.145.72.193/32</a>.
Bird kernel protocol exports an ECMP routing rule to kernel as a kernel default routing, and bgp_A/bgp_B protocol export the private ip to my internet, then <a href="http://38.145.72.193/32" target="_blank">38.145.72.193/32</a> on em5 acts as a public ip.
**** My goal ****
I want to add another virtual ip on em5, say <a href="http://38.145.72.198/32" target="_blank">38.145.72.198/32</a>, and let this new virtual ip act as a public ip too.
Can this requirement be met? If yes, how should I modify the configuration to make BGP advertise this ip over my internet?
**** Additional Information on Server ****
## bird setup an ECMP route on 2 phy nics as default route,
## which set source ip to the public ip
$ ip route
default proto bird src 38.145.72.193 metric 32
nexthop via 10.105.1.10 dev enp4s0f0 weight 1
nexthop via 10.105.1.12 dev enp4s0f1 weight 1
<a href="http://10.105.1.10/31" target="_blank">10.105.1.10/31</a> dev enp4s0f0 proto kernel scope link src 10.105.1.11
<a href="http://10.105.1.12/31" target="_blank">10.105.1.12/31</a> dev enp4s0f1 proto kernel scope link src 10.105.1.13
</code></pre><pre><code>bird> show route all
Table master4:
<a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a> unicast [bgp_A 2024-11-17] * (100) [AS4212010101i]
via 10.105.1.10 on enp5s0f0
Type: BGP univ
BGP.origin: IGP
BGP.as_path: 4259105001 4212010101
BGP.next_hop: 10.105.1.10
BGP.local_pref: 0
unicast [bgp_B 2024-11-18] (100) [AS4212010101i]
via 10.105.1.12 on enp5s0f1
Type: BGP univ
BGP.origin: IGP
BGP.as_path: 4259205001 4212010101
BGP.next_hop: 10.105.1.12
BGP.local_pref: 0
<a href="http://38.145.72.193/32" target="_blank">38.145.72.193/32</a> unicast [direct1 2024-11-06] * (240)
dev em5
Type: device univ</code></pre><pre><code>
# bird.conf
router id 172.18.xxx.yyy;
ipv4 table master4;
define LOCAL_NET = [ <a href="http://38.145.72.193/32" target="_blank">38.145.72.193/32</a> ];
protocol direct {
ipv4;
interface "em5",-"*";
}
protocol kernel {
scan time 1;
merge paths yes limit 4;
ipv4 {
import none;
export filter {
if proto = "direct1" then reject;
krt_prefsrc = 38.145.72.193;
accept;
};
};
}
protocol device {
scan time 1;
}
protocol bgp bgp_A {
description "TOR A";
local 10.105.1.11 as 4290105101 ; # enp4s0f0
neighbor 10.105.1.10 as 4259105001; # TOR_A
path metric 1;
ipv4 {
import all;
export filter {
if net ~ LOCAL_NET then accept;
else reject;
};
next hop self;
};
}
protocol bgp bgp_B {
bfd;
description "TOR B";
local 10.105.1.13 as 4290105101 ; # enp4s0f1
neighbor 10.105.1.12 as 4259205001; # TOR_B
default bgp_med 0;
default bgp_local_pref 0;
path metric 1;
ipv4 {
import all;
export filter {
if net ~ LOCAL_NET then accept;
else reject;
};
next hop self;
};
}</code></pre></div></div>
</blockquote></div>