Hello, I am trying to distribute 2 static routes between 2 hosts, not directly connected, and I am having hard time to make it works … host1 10.10.1.1 (eth0) own subnet 192.168.1.0/24 ( 192.168.1.1 on eth1) host2 10.10.2.1 (eth0) own subnet 192.168.2.0/24 ( 192.168.2.1 on eth1) I get the following error : host1 bird: bgp1 < rejected by protocol 192.168.2.0/24 unreachable host1 bird: bgp1 > updated [best] 192.168.2.0/24 unreachable Bellow the bird.conf of both hosts : log syslog all; router id 10.10.1.1; debug protocols all; protocol direct { interface "*"; # Restrict network interfaces it works with } protocol kernel { learn; # Learn all alien routes from the kernel #persist; # Don't remove routes on bird shutdown scan time 20; # Scan kernel routing table every 20 seconds import all; # Default is import all export all; # Default is export none } protocol device { scan time 10; # Scan interfaces every 10 seconds } protocol static { debug all; route 192.168.1.0/24 via 10.10.2.254; export all; } protocol bgp { multihop; #gateway recursive; import all; export all; #export where proto = "static1"; local as 3000; neighbor 10.10.2.1 as 3000; #next hop self; } — log syslog all; router id 10.10.2.1; protocol direct { interface "*"; # Restrict network interfaces it works with } protocol kernel { learn; # Learn all alien routes from the kernel #persist; # Don't remove routes on bird shutdown scan time 20; # Scan kernel routing table every 20 seconds import all; # Default is import all export all; # Default is export none } protocol device { scan time 10; # Scan interfaces every 10 seconds } protocol static { route 192.168.2.0/24 via 10.10.1.254; export all; } protocol bgp { multihop; #gateway recursive; import all; #export where proto = "static1"; export all; local as 3000; neighbor 10.10.1.1 as 3000; #next hop self; } — Cédric Lemarchand
FYI, Bird version is 1.4.5. — Cédric Lemarchand
On 23 Feb 2017, at 14:45, Cedric Lemarchand <yipikai7@gmail.com> wrote:
Hello,
I am trying to distribute 2 static routes between 2 hosts, not directly connected, and I am having hard time to make it works …
host1 10.10.1.1 (eth0) own subnet 192.168.1.0/24 ( 192.168.1.1 on eth1) host2 10.10.2.1 (eth0) own subnet 192.168.2.0/24 ( 192.168.2.1 on eth1)
I get the following error :
host1 bird: bgp1 < rejected by protocol 192.168.2.0/24 unreachable host1 bird: bgp1 > updated [best] 192.168.2.0/24 unreachable
Bellow the bird.conf of both hosts :
log syslog all; router id 10.10.1.1; debug protocols all; protocol direct { interface "*"; # Restrict network interfaces it works with } protocol kernel { learn; # Learn all alien routes from the kernel #persist; # Don't remove routes on bird shutdown scan time 20; # Scan kernel routing table every 20 seconds import all; # Default is import all export all; # Default is export none } protocol device { scan time 10; # Scan interfaces every 10 seconds } protocol static { debug all; route 192.168.1.0/24 via 10.10.2.254; export all; } protocol bgp { multihop; #gateway recursive; import all; export all; #export where proto = "static1"; local as 3000; neighbor 10.10.2.1 as 3000; #next hop self; }
—
log syslog all; router id 10.10.2.1; protocol direct { interface "*"; # Restrict network interfaces it works with } protocol kernel { learn; # Learn all alien routes from the kernel #persist; # Don't remove routes on bird shutdown scan time 20; # Scan kernel routing table every 20 seconds import all; # Default is import all export all; # Default is export none } protocol device { scan time 10; # Scan interfaces every 10 seconds } protocol static { route 192.168.2.0/24 via 10.10.1.254; export all; } protocol bgp { multihop; #gateway recursive; import all; #export where proto = "static1"; export all; local as 3000; neighbor 10.10.1.1 as 3000; #next hop self; }
— Cédric Lemarchand
On Thu, Feb 23, 2017 at 02:45:34PM +0100, Cedric Lemarchand wrote:
Hello,
I am trying to distribute 2 static routes between 2 hosts, not directly connected, and I am having hard time to make it works …
host1 10.10.1.1 (eth0) own subnet 192.168.1.0/24 ( 192.168.1.1 on eth1) host2 10.10.2.1 (eth0) own subnet 192.168.2.0/24 ( 192.168.2.1 on eth1)
I get the following error :
host1 bird: bgp1 < rejected by protocol 192.168.2.0/24 unreachable host1 bird: bgp1 > updated [best] 192.168.2.0/24 unreachable
Hello These are not errors, these are log messages enabled by 'debug all'. The only unexpected thing is that received routes are marked as unreachable. That is most likely because an IP address from route attribute bgp_next_hop cannot be resolved in your routing table But there should be routes learned by kernel protocols. What is your output of 'show route all' command? -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
On 23 Feb 2017, at 16:09, Ondrej Zajicek <santiago@crfreenet.org> wrote:
On Thu, Feb 23, 2017 at 02:45:34PM +0100, Cedric Lemarchand wrote:
Hello,
I am trying to distribute 2 static routes between 2 hosts, not directly connected, and I am having hard time to make it works …
host1 10.10.1.1 (eth0) own subnet 192.168.1.0/24 ( 192.168.1.1 on eth1) host2 10.10.2.1 (eth0) own subnet 192.168.2.0/24 ( 192.168.2.1 on eth1)
I get the following error :
host1 bird: bgp1 < rejected by protocol 192.168.2.0/24 unreachable host1 bird: bgp1 > updated [best] 192.168.2.0/24 unreachable
Hello
These are not errors, these are log messages enabled by 'debug all’.
Good to know, thanks.
The only unexpected thing is that received routes are marked as unreachable. That is most likely because an IP address from route attribute bgp_next_hop cannot be resolved in your routing table But there should be routes learned by kernel protocols. What is your output of 'show route all' command?
Yes, I am not sure to understand how plays theses options (and if I need it) in the bgp protocol and it they are related to my problem : gateway recursive : means that if host2 advertise "route 192.168.2.0/24 via 10.10.2.1;” to host1, host1 does a lookup in the kernel routing table and set the nexthop for 192.168.2.0/24 via the same IP as for host2 ? which makes sens, at least for me, because host2 (10.10.2.1) is not directly reachable by host1 (10.10.1.1) and cannot be used as the next_hop in the kernel routing table, but the gateway 10.10.1.254 is, this is what I would expect. next hop self : means that every route advertised by host2 will be routed to it self while keeping the “gateway recursive” logic ? The output of show route all : host1 : — 10.10.2.0/24 unreachable [bgp1 15:32:13 from 10.10.2.1] ! (100/-) [i] Type: BGP unicast univ BGP.origin: IGP BGP.as_path: BGP.next_hop: 10.10.2.1 BGP.local_pref: 100 via 10.10.1.254 on eth0 [kernel1 15:30:42] (10) Type: inherit unicast univ Kernel.source: 3 Kernel.metric: 0 10.10.1.0/24 dev eth0 [direct1 15:30:42] * (240) Type: device unicast univ 192.168.1.0/24 dev eth1 [direct1 15:30:42] * (240) Type: device unicast univ unreachable [static1 15:30:42] (200) Type: static unicast univ 192.168.2.0/24 unreachable [bgp1 15:32:13 from 10.10.2.1] * (100/-) [i] Type: BGP unicast univ BGP.origin: IGP BGP.as_path: BGP.next_hop: 10.10.2.1 BGP.local_pref: 100 — host2 : — 10.10.2.0/24 dev eth0 [direct1 16:26:58] * (240) Type: device unicast univ 10.10.1.0/24 unreachable [bgp1 16:27:00 from 10.10.1.1] ! (100/-) [i] Type: BGP unicast univ BGP.origin: IGP BGP.as_path: BGP.next_hop: 10.10.1.1 BGP.local_pref: 100 via 10.10.2.254 on eth0 [kernel1 16:26:58] (10) Type: inherit unicast univ Kernel.source: 3 Kernel.metric: 0 192.168.1.0/24 unreachable [bgp1 16:27:00 from 10.10.1.1] * (100/-) [i] Type: BGP unicast univ BGP.origin: IGP BGP.as_path: BGP.next_hop: 10.10.1.1 BGP.local_pref: 100 192.168.2.0/24 dev eth1 [direct1 16:26:58] * (240) Type: device unicast univ via 10.10.2.1 on eth0 [static1 16:26:58] (200) Type: static unicast univ —
-- Elen sila lumenn' omentielvo
Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
On Thu, Feb 23, 2017 at 04:42:50PM +0100, Cedric Lemarchand wrote:
Yes, I am not sure to understand how plays theses options (and if I need it) in the bgp protocol and it they are related to my problem :
gateway recursive : means that if host2 advertise "route 192.168.2.0/24 via 10.10.2.1;” to host1, host1 does a lookup in the kernel routing table and set the nexthop for 192.168.2.0/24 via the same IP as for host2 ?
Mainly yes, but: 1) Not lookup in the kernel routing table, but in the BIRD table. By default the same table as used by BGP protocol, but could be configured to different one by 'igp table' option. 2) It is not lookup for host2, but lookup for bgp_next_hop attribute, as specified by host2, which is usually value of 'via'.
next hop self : means that every route advertised by host2 will be routed to it self while keeping the “gateway recursive” logic ?
That means host2 always announces own IP address as bgp_next_hop instead of one from 'via'.
The output of show route all :
There are two issues: 1) both hosts announce all routes (not only 192.168.xx but also 10.10.xx). 2) routes from kernel1 protocol has lower preference (10), so routes from BGP are preferred and you get circular lookups for 10.0.1.1, 10.10.2.1 You could change preference of kernel protocol to say 200 and you could filter out unwanted routes in BGP export filter. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
Hello Ondrej, Thanks for your precious explanations. Unfortunately I am still stuck, static routes does not apply between 2 hosts. To solve 1) and 2), and in the way I only need to publish static routes to other BGP hosts, I changed "export all” by "export where proto = “static1” “, but still no luck. I notice that static routes are not received any more on hosts. Here is my understanding of “show protocol all” on host1 : direct1 Direct master up 17:35:58 Preference: 240 Input filter: ACCEPT Output filter: REJECT Routes: 2 imported, 0 exported, 2 preferred Route change stats: received rejected filtered ignored accepted Import updates: 2 0 0 0 2 Import withdraws: 0 0 --- 0 0 Export updates: 0 0 0 --- 0 Export withdraws: 0 --- --- --- 0 Bird finds 2 direct routes related to eth0 and eth1, so they are received, accepted, but not exported, which is fine. kernel1 Kernel master up 17:41:12 Preference: 10 Input filter: ACCEPT Output filter: REJECT Routes: 1 imported, 0 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: 6 5 1 --- 0 Export withdraws: 0 --- --- --- 0 Bird find 1 static route and try to export 6 routes but they all get rejected or filtered, which is fine too, but I dont know why “6” routes of the routing table bellow : root@host1:~# ip r 10.10.1.0/24 dev eth0 proto kernel scope link src 10.10.1.1 10.10.2.0/24 via 10.10.1.254 dev eth0 192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1 device1 Device master up 17:41:12 Preference: 240 Input filter: ACCEPT Output filter: REJECT Routes: 0 imported, 0 exported, 0 preferred Route change stats: received rejected filtered ignored accepted Import updates: 0 0 0 0 0 Import withdraws: 0 0 --- 0 0 Export updates: 0 0 0 --- 0 Export withdraws: 0 --- --- — 0 Nothing to say about this one, from what I have read it’s role is to feed the kernel protocol. static1 Static master up 17:41:12 Preference: 200 Input filter: ACCEPT Output filter: ACCEPT Routes: 1 imported, 0 exported, 0 preferred Route change stats: received rejected filtered ignored accepted Import updates: 1 0 0 0 1 Import withdraws: 0 0 --- 0 0 Export updates: 0 0 0 --- 0 Export withdraws: 0 --- --- --- 0 This one is annoying me and I think the issue is there, 1 imported but ignored, why ? bgp1 BGP master up 17:41:13 Established Preference: 100 Input filter: ACCEPT Output filter: (unnamed) Routes: 0 imported, 0 exported, 0 preferred Route change stats: received rejected filtered ignored accepted Import updates: 0 0 0 0 0 Import withdraws: 0 0 --- 0 0 Export updates: 3 0 3 --- 0 Export withdraws: 0 --- --- --- 0 BGP state: Established Neighbor address: 10.10.2.1 Neighbor AS: 3000 Neighbor ID: 10.10.2.1 Neighbor caps: refresh restart-aware AS4 Session: internal multihop AS4 Source address: 10.10.1.1 Hold timer: 162/240 Keepalive timer: 53/80 I don’t understand why 3 routes are received because protocols direct1 and kernel1 should not export anything, and only one static route should be received via BGP from host2 ! Also the ouput filter is unamed, which I thinks is not good. Below the host1 bird.conf. As you can see I think I misunderstand some things, and I am a bit disappointed. Cheers router id 10.10.1.1; protocol direct { interface "*"; # Restrict network interfaces it works with } protocol kernel { learn; # Learn all alien routes from the kernel #persist; # Don't remove routes on bird shutdown scan time 20; # Scan kernel routing table every 20 seconds import all; # Default is import all export none; # Default is export none } protocol device { scan time 10; # Scan interfaces every 10 seconds } protocol static static1 { route 192.168.1.0/24 via 10.10.1.1; export all; } protocol bgp { multihop; #gateway recursive; import all; export where proto = "static1"; local as 3000; neighbor 10.10.2.1 as 3000; #next hop self; #rr client; } — Cédric Lemarchand
On 23 Feb 2017, at 17:10, Ondrej Zajicek <santiago@crfreenet.org> wrote:
On Thu, Feb 23, 2017 at 04:42:50PM +0100, Cedric Lemarchand wrote:
Yes, I am not sure to understand how plays theses options (and if I need it) in the bgp protocol and it they are related to my problem :
gateway recursive : means that if host2 advertise "route 192.168.2.0/24 via 10.10.2.1;” to host1, host1 does a lookup in the kernel routing table and set the nexthop for 192.168.2.0/24 via the same IP as for host2 ?
Mainly yes, but:
1) Not lookup in the kernel routing table, but in the BIRD table. By default the same table as used by BGP protocol, but could be configured to different one by 'igp table' option.
2) It is not lookup for host2, but lookup for bgp_next_hop attribute, as specified by host2, which is usually value of 'via'.
next hop self : means that every route advertised by host2 will be routed to it self while keeping the “gateway recursive” logic ?
That means host2 always announces own IP address as bgp_next_hop instead of one from 'via'.
The output of show route all :
There are two issues:
1) both hosts announce all routes (not only 192.168.xx but also 10.10.xx).
2) routes from kernel1 protocol has lower preference (10), so routes from BGP are preferred and you get circular lookups for 10.0.1.1, 10.10.2.1
You could change preference of kernel protocol to say 200 and you could filter out unwanted routes in BGP export filter.
-- Elen sila lumenn' omentielvo
Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
Bump -- Cédric Lemarchand
Le 25 févr. 2017 à 18:03, Cedric Lemarchand <yipikai7@gmail.com> a écrit :
Hello Ondrej,
Thanks for your precious explanations. Unfortunately I am still stuck, static routes does not apply between 2 hosts.
To solve 1) and 2), and in the way I only need to publish static routes to other BGP hosts, I changed "export all” by "export where proto = “static1” “, but still no luck. I notice that static routes are not received any more on hosts.
Here is my understanding of “show protocol all” on host1 :
direct1 Direct master up 17:35:58 Preference: 240 Input filter: ACCEPT Output filter: REJECT Routes: 2 imported, 0 exported, 2 preferred Route change stats: received rejected filtered ignored accepted Import updates: 2 0 0 0 2 Import withdraws: 0 0 --- 0 0 Export updates: 0 0 0 --- 0 Export withdraws: 0 --- --- --- 0
Bird finds 2 direct routes related to eth0 and eth1, so they are received, accepted, but not exported, which is fine.
kernel1 Kernel master up 17:41:12 Preference: 10 Input filter: ACCEPT Output filter: REJECT Routes: 1 imported, 0 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: 6 5 1 --- 0 Export withdraws: 0 --- --- --- 0
Bird find 1 static route and try to export 6 routes but they all get rejected or filtered, which is fine too, but I dont know why “6” routes of the routing table bellow :
root@host1:~# ip r 10.10.1.0/24 dev eth0 proto kernel scope link src 10.10.1.1 10.10.2.0/24 via 10.10.1.254 dev eth0 192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
device1 Device master up 17:41:12 Preference: 240 Input filter: ACCEPT Output filter: REJECT Routes: 0 imported, 0 exported, 0 preferred Route change stats: received rejected filtered ignored accepted Import updates: 0 0 0 0 0 Import withdraws: 0 0 --- 0 0 Export updates: 0 0 0 --- 0 Export withdraws: 0 --- --- — 0
Nothing to say about this one, from what I have read it’s role is to feed the kernel protocol.
static1 Static master up 17:41:12 Preference: 200 Input filter: ACCEPT Output filter: ACCEPT Routes: 1 imported, 0 exported, 0 preferred Route change stats: received rejected filtered ignored accepted Import updates: 1 0 0 0 1 Import withdraws: 0 0 --- 0 0 Export updates: 0 0 0 --- 0 Export withdraws: 0 --- --- --- 0
This one is annoying me and I think the issue is there, 1 imported but ignored, why ?
bgp1 BGP master up 17:41:13 Established Preference: 100 Input filter: ACCEPT Output filter: (unnamed) Routes: 0 imported, 0 exported, 0 preferred Route change stats: received rejected filtered ignored accepted Import updates: 0 0 0 0 0 Import withdraws: 0 0 --- 0 0 Export updates: 3 0 3 --- 0 Export withdraws: 0 --- --- --- 0 BGP state: Established Neighbor address: 10.10.2.1 Neighbor AS: 3000 Neighbor ID: 10.10.2.1 Neighbor caps: refresh restart-aware AS4 Session: internal multihop AS4 Source address: 10.10.1.1 Hold timer: 162/240 Keepalive timer: 53/80
I don’t understand why 3 routes are received because protocols direct1 and kernel1 should not export anything, and only one static route should be received via BGP from host2 ! Also the ouput filter is unamed, which I thinks is not good.
Below the host1 bird.conf.
As you can see I think I misunderstand some things, and I am a bit disappointed.
Cheers
router id 10.10.1.1; protocol direct { interface "*"; # Restrict network interfaces it works with } protocol kernel { learn; # Learn all alien routes from the kernel #persist; # Don't remove routes on bird shutdown scan time 20; # Scan kernel routing table every 20 seconds import all; # Default is import all export none; # Default is export none } protocol device { scan time 10; # Scan interfaces every 10 seconds } protocol static static1 { route 192.168.1.0/24 via 10.10.1.1; export all; } protocol bgp { multihop; #gateway recursive; import all; export where proto = "static1"; local as 3000; neighbor 10.10.2.1 as 3000; #next hop self; #rr client; }
— Cédric Lemarchand
On 23 Feb 2017, at 17:10, Ondrej Zajicek <santiago@crfreenet.org> wrote:
On Thu, Feb 23, 2017 at 04:42:50PM +0100, Cedric Lemarchand wrote: Yes, I am not sure to understand how plays theses options (and if I need it) in the bgp protocol and it they are related to my problem :
gateway recursive : means that if host2 advertise "route 192.168.2.0/24 via 10.10.2.1;” to host1, host1 does a lookup in the kernel routing table and set the nexthop for 192.168.2.0/24 via the same IP as for host2 ?
Mainly yes, but:
1) Not lookup in the kernel routing table, but in the BIRD table. By default the same table as used by BGP protocol, but could be configured to different one by 'igp table' option.
2) It is not lookup for host2, but lookup for bgp_next_hop attribute, as specified by host2, which is usually value of 'via'.
next hop self : means that every route advertised by host2 will be routed to it self while keeping the “gateway recursive” logic ?
That means host2 always announces own IP address as bgp_next_hop instead of one from 'via'.
The output of show route all :
There are two issues:
1) both hosts announce all routes (not only 192.168.xx but also 10.10.xx).
2) routes from kernel1 protocol has lower preference (10), so routes from BGP are preferred and you get circular lookups for 10.0.1.1, 10.10.2.1
You could change preference of kernel protocol to say 200 and you could filter out unwanted routes in BGP export filter.
-- Elen sila lumenn' omentielvo
Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
Hello, Any hints will be greatly appreciated ! Cheers — Cédric Lemarchand
On 25 Feb 2017, at 18:03, Cedric Lemarchand <yipikai7@gmail.com> wrote:
Hello Ondrej,
Thanks for your precious explanations. Unfortunately I am still stuck, static routes does not apply between 2 hosts.
To solve 1) and 2), and in the way I only need to publish static routes to other BGP hosts, I changed "export all” by "export where proto = “static1” “, but still no luck. I notice that static routes are not received any more on hosts.
Here is my understanding of “show protocol all” on host1 :
direct1 Direct master up 17:35:58 Preference: 240 Input filter: ACCEPT Output filter: REJECT Routes: 2 imported, 0 exported, 2 preferred Route change stats: received rejected filtered ignored accepted Import updates: 2 0 0 0 2 Import withdraws: 0 0 --- 0 0 Export updates: 0 0 0 --- 0 Export withdraws: 0 --- --- --- 0
Bird finds 2 direct routes related to eth0 and eth1, so they are received, accepted, but not exported, which is fine.
kernel1 Kernel master up 17:41:12 Preference: 10 Input filter: ACCEPT Output filter: REJECT Routes: 1 imported, 0 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: 6 5 1 --- 0 Export withdraws: 0 --- --- --- 0
Bird find 1 static route and try to export 6 routes but they all get rejected or filtered, which is fine too, but I dont know why “6” routes of the routing table bellow :
root@host1:~# ip r 10.10.1.0/24 dev eth0 proto kernel scope link src 10.10.1.1 10.10.2.0/24 via 10.10.1.254 dev eth0 192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
device1 Device master up 17:41:12 Preference: 240 Input filter: ACCEPT Output filter: REJECT Routes: 0 imported, 0 exported, 0 preferred Route change stats: received rejected filtered ignored accepted Import updates: 0 0 0 0 0 Import withdraws: 0 0 --- 0 0 Export updates: 0 0 0 --- 0 Export withdraws: 0 --- --- — 0
Nothing to say about this one, from what I have read it’s role is to feed the kernel protocol.
static1 Static master up 17:41:12 Preference: 200 Input filter: ACCEPT Output filter: ACCEPT Routes: 1 imported, 0 exported, 0 preferred Route change stats: received rejected filtered ignored accepted Import updates: 1 0 0 0 1 Import withdraws: 0 0 --- 0 0 Export updates: 0 0 0 --- 0 Export withdraws: 0 --- --- --- 0
This one is annoying me and I think the issue is there, 1 imported but ignored, why ?
bgp1 BGP master up 17:41:13 Established Preference: 100 Input filter: ACCEPT Output filter: (unnamed) Routes: 0 imported, 0 exported, 0 preferred Route change stats: received rejected filtered ignored accepted Import updates: 0 0 0 0 0 Import withdraws: 0 0 --- 0 0 Export updates: 3 0 3 --- 0 Export withdraws: 0 --- --- --- 0 BGP state: Established Neighbor address: 10.10.2.1 Neighbor AS: 3000 Neighbor ID: 10.10.2.1 Neighbor caps: refresh restart-aware AS4 Session: internal multihop AS4 Source address: 10.10.1.1 Hold timer: 162/240 Keepalive timer: 53/80
I don’t understand why 3 routes are received because protocols direct1 and kernel1 should not export anything, and only one static route should be received via BGP from host2 ! Also the ouput filter is unamed, which I thinks is not good.
Below the host1 bird.conf.
As you can see I think I misunderstand some things, and I am a bit disappointed.
Cheers
router id 10.10.1.1; protocol direct { interface "*"; # Restrict network interfaces it works with } protocol kernel { learn; # Learn all alien routes from the kernel #persist; # Don't remove routes on bird shutdown scan time 20; # Scan kernel routing table every 20 seconds import all; # Default is import all export none; # Default is export none } protocol device { scan time 10; # Scan interfaces every 10 seconds } protocol static static1 { route 192.168.1.0/24 via 10.10.1.1; export all; } protocol bgp { multihop; #gateway recursive; import all; export where proto = "static1"; local as 3000; neighbor 10.10.2.1 as 3000; #next hop self; #rr client; }
— Cédric Lemarchand
On 23 Feb 2017, at 17:10, Ondrej Zajicek <santiago@crfreenet.org <mailto:santiago@crfreenet.org>> wrote:
On Thu, Feb 23, 2017 at 04:42:50PM +0100, Cedric Lemarchand wrote:
Yes, I am not sure to understand how plays theses options (and if I need it) in the bgp protocol and it they are related to my problem :
gateway recursive : means that if host2 advertise "route 192.168.2.0/24 via 10.10.2.1;” to host1, host1 does a lookup in the kernel routing table and set the nexthop for 192.168.2.0/24 via the same IP as for host2 ?
Mainly yes, but:
1) Not lookup in the kernel routing table, but in the BIRD table. By default the same table as used by BGP protocol, but could be configured to different one by 'igp table' option.
2) It is not lookup for host2, but lookup for bgp_next_hop attribute, as specified by host2, which is usually value of 'via'.
next hop self : means that every route advertised by host2 will be routed to it self while keeping the “gateway recursive” logic ?
That means host2 always announces own IP address as bgp_next_hop instead of one from 'via'.
The output of show route all :
There are two issues:
1) both hosts announce all routes (not only 192.168.xx but also 10.10.xx).
2) routes from kernel1 protocol has lower preference (10), so routes from BGP are preferred and you get circular lookups for 10.0.1.1, 10.10.2.1
You could change preference of kernel protocol to say 200 and you could filter out unwanted routes in BGP export filter.
-- Elen sila lumenn' omentielvo
Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org <mailto:santiago@crfreenet.org>) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net <http://wwwkeys.pgp.net/>) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Cedric Lemarchand -
Ondrej Zajicek