documentation:examples:simple_bgp-rip-ospf_lab_with_bird
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:examples:simple_bgp-rip-ospf_lab_with_bird [2020/12/15 01:45] – [Testing] olivier | documentation:examples:simple_bgp-rip-ospf_lab_with_bird [2022/02/21 17:06] (current) – [Testing] olivier | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== BGP/ | + | ====== BGP/ |
| This Labs is done from one BSDRP VM and it explains how to use BSDRP using bird 2. | This Labs is done from one BSDRP VM and it explains how to use BSDRP using bird 2. | ||
| Line 9: | Line 9: | ||
| Here is the logical and physical view: | Here is the logical and physical view: | ||
| - | {{: | + | {{: |
| ===== Router configuration ===== | ===== Router configuration ===== | ||
| Line 19: | Line 19: | ||
| ==== Host ==== | ==== Host ==== | ||
| + | |||
| + | Unhide bpf interface to jails to be able to use tcpdump inside them. | ||
| < | < | ||
| sysrc hostname=host \ | sysrc hostname=host \ | ||
| - | cloned_interfaces=" | + | cloned_interfaces=" |
| kld_list=" | kld_list=" | ||
| cat > / | cat > / | ||
| Line 39: | Line 41: | ||
| tenant -c -j jail3 -i epair1b, | tenant -c -j jail3 -i epair1b, | ||
| tenant -c -j jail4 -i epair2b, | tenant -c -j jail4 -i epair2b, | ||
| - | tenant -c -j jail5 -i epair3b | + | tenant -c -j jail5 -i epair3b,epair4a |
| + | tenant -c -j jail6 -i epair4b | ||
| </ | </ | ||
| Line 171: | Line 174: | ||
| import all; | import all; | ||
| export all; | export all; | ||
| + | next hop self; | ||
| }; | }; | ||
| } | } | ||
| Line 184: | Line 188: | ||
| import all; | import all; | ||
| export all; | export all; | ||
| + | next hop self; | ||
| }; | }; | ||
| } | } | ||
| Line 334: | Line 339: | ||
| } | } | ||
| - | protocol | + | protocol |
| - | ipv4; | + | |
| - | route 192.168.50.0/ | + | |
| + | ipv6 { import all; export all;}; | ||
| } | } | ||
| - | protocol static static6 { | ||
| - | ipv6; | ||
| - | route 2001: | ||
| - | } | ||
| EOF | EOF | ||
| </ | </ | ||
| Line 353: | Line 355: | ||
| gateway_enable=YES | gateway_enable=YES | ||
| ipv6_gateway_enable=YES | ipv6_gateway_enable=YES | ||
| - | cloned_interfaces=lo1 | ||
| ifconfig_epair3b=" | ifconfig_epair3b=" | ||
| ifconfig_epair3b_ipv6=" | ifconfig_epair3b_ipv6=" | ||
| - | ifconfig_lo1="inet 192.168.50.5/ | + | ifconfig_epair4a="inet 192.168.56.5/ |
| - | ifconfig_lo1_ipv6=" | + | ifconfig_epair4a_ipv6=" |
| bird_enable=yes | bird_enable=yes | ||
| EOF | EOF | ||
| Line 369: | Line 370: | ||
| # Override router ID | # Override router ID | ||
| router id 192.168.10.5; | router id 192.168.10.5; | ||
| + | |||
| + | # Sync bird routing table with kernel | ||
| + | protocol kernel kernel4 { | ||
| + | ipv4 { | ||
| + | export all; | ||
| + | }; | ||
| + | } | ||
| + | protocol kernel kernel6 { | ||
| + | ipv6 { | ||
| + | export all; | ||
| + | }; | ||
| + | } | ||
| + | |||
| + | protocol device { | ||
| + | scan time 10; | ||
| + | } | ||
| + | |||
| + | # Include directly connected networks | ||
| + | protocol direct { | ||
| + | ipv4; | ||
| + | ipv6; | ||
| + | } | ||
| + | |||
| + | protocol babel { | ||
| + | interface " | ||
| + | ipv4 { import all; export all;}; | ||
| + | ipv6 { import all; export all;}; | ||
| + | } | ||
| + | |||
| + | protocol static static4 { | ||
| + | ipv4; | ||
| + | route 192.168.60.0/ | ||
| + | } | ||
| + | |||
| + | protocol static static6 { | ||
| + | ipv6; | ||
| + | route 2001: | ||
| + | } | ||
| + | |||
| + | EOF | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Jail 6 ==== | ||
| + | |||
| + | < | ||
| + | cat > / | ||
| + | hostname=" | ||
| + | gateway_enable=YES | ||
| + | ipv6_gateway_enable=YES | ||
| + | cloned_interfaces=lo1 | ||
| + | ifconfig_epair4b=" | ||
| + | ifconfig_epair4b_ipv6=" | ||
| + | ifconfig_lo1=" | ||
| + | ifconfig_lo1_ipv6=" | ||
| + | bird_enable=yes | ||
| + | EOF | ||
| + | |||
| + | cat > / | ||
| + | # Configure logging | ||
| + | log syslog all; | ||
| + | log "/ | ||
| + | log stderr all; | ||
| + | |||
| + | # Override router ID | ||
| + | router id 192.168.10.6; | ||
| # Sync bird routing table with kernel | # Sync bird routing table with kernel | ||
| Line 393: | Line 460: | ||
| protocol static static4 { | protocol static static4 { | ||
| ipv4; | ipv4; | ||
| - | route 0.0.0.0/0 via 192.168.45.4; | + | route 0.0.0.0/0 via 192.168.56.5; |
| } | } | ||
| protocol static static6 { | protocol static static6 { | ||
| ipv6; | ipv6; | ||
| - | route ::/0 via 2001:db8:45::4; | + | route ::/0 via 2001:db8:56::5; |
| } | } | ||
| Line 407: | Line 474: | ||
| Jail 1 routing table: | Jail 1 routing table: | ||
| < | < | ||
| - | [root@host]~# jexec jail1 netstat -rn [5/9476] | + | root@host:~ # jexec jail1 netstat -rn |
| Routing tables | Routing tables | ||
| Internet: | Internet: | ||
| Destination | Destination | ||
| - | 127.0.0.1 | + | 127.0.0.1 |
| - | 192.168.10.0/ | + | 192.168.10.0/ |
| - | 192.168.10.1 | + | 192.168.10.1 |
| - | 192.168.12.0/ | + | 192.168.12.0/ |
| - | 192.168.12.1 | + | 192.168.12.1 |
| 192.168.23.0/ | 192.168.23.0/ | ||
| 192.168.34.0/ | 192.168.34.0/ | ||
| 192.168.45.0/ | 192.168.45.0/ | ||
| - | 192.168.50.0/24 192.168.12.2 | + | 192.168.56.0/ |
| + | 192.168.60.0/24 192.168.12.2 | ||
| Internet6: | Internet6: | ||
| Destination | Destination | ||
| ::/96 :: | ::/96 :: | ||
| - | ::1 link#2 UH | + | ::1 link#16 |
| :: | :: | ||
| - | 2001: | + | 2001: |
| - | 2001: | + | 2001: |
| - | 2001: | + | 2001: |
| - | 2001: | + | 2001: |
| 2001: | 2001: | ||
| 2001: | 2001: | ||
| 2001: | 2001: | ||
| - | 2001:db8:50::/64 2001: | + | 2001:db8:56::/ |
| + | 2001:db8:60::/64 2001: | ||
| fe80::/ | fe80::/ | ||
| - | fe80::%lo0/64 | + | fe80::%epair0a/64 |
| - | fe80::1%lo0 link#2 | + | fe80::99: |
| - | fe80::%epair0a/64 | + | fe80::%lo0/64 |
| - | fe80::a2: | + | fe80::1%lo0 link#16 UHS lo0 |
| - | fe80:: | + | fe80:: |
| - | fe80:: | + | fe80:: |
| ff02::/ | ff02::/ | ||
| </ | </ | ||
| - | And traceroute | + | And traceroute |
| < | < | ||
| - | [root@host]~# jexec jail1 traceroute 192.168.50.5 | + | root@host:~ # jexec jail1 traceroute 192.168.60.6 |
| - | traceroute to 192.168.50.5 (192.168.50.5), 64 hops max, 40 byte packets | + | traceroute to 192.168.60.6 (192.168.60.6), 64 hops max, 40 byte packets |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| + | | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | root@host:~ # jexec jail1 ping -c 2 2001: | ||
| + | PING6(56=40+8+8 bytes) 2001: | ||
| + | 16 bytes from 2001: | ||
| + | 16 bytes from 2001: | ||
| + | |||
| + | --- 2001: | ||
| + | 2 packets transmitted, | ||
| + | round-trip min/ | ||
| </ | </ | ||
documentation/examples/simple_bgp-rip-ospf_lab_with_bird.1607993137.txt.gz · Last modified: 2020/12/15 01:45 by olivier
