documentation:examples:lab_with_carp_xorp_and_quagga
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | documentation:examples:lab_with_carp_xorp_and_quagga [2011/04/07 11:19] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Lab with UCarp, Xorp and Quagga ====== | ||
+ | |||
+ | In this example the routers R1 and R3 will be configured is Xorp and ucarp, R2 is configure with quagga and ucarp. | ||
+ | The routing protocol is OPSF ans it is set in one backbone area. | ||
+ | Two workstations are set and configured in each lan. They use ping for a prelimenary test, and then a ssh connexion to see if we keep it up to live. | ||
+ | |||
+ | ====== Lab Diagram: ====== | ||
+ | |||
+ | |||
+ | ===== Abstract Diagram ===== | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ===== Ip Diagram ===== | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ====== Lab Setup ====== | ||
+ | |||
+ | |||
+ | ===== Network setup ===== | ||
+ | |||
+ | ^Net name^ Network Address range^ | ||
+ | |LAN13 | 192.168.13.0/ | ||
+ | |LAN23 | 192.168.23.0/ | ||
+ | |WAN12 | 10.0.12.0/ | ||
+ | |WAN13 | 10.0.13.0/ | ||
+ | |WAN23 | 10.0.23.0/ | ||
+ | |||
+ | ===== Routeur setup ===== | ||
+ | |||
+ | |||
+ | ^R1: ^If name ^Ip address^ | ||
+ | |LAN13 |re0 |192.168.13.1/ | ||
+ | |LAN13 |uCarp0 |192.168.13.254/ | ||
+ | |WAN13 |re1 |10.0.13.1/ | ||
+ | |WAN12 |re2 |10.0.12.1/ | ||
+ | |||
+ | ^R2: ^If name ^Ip address^ | ||
+ | |WAN12 |re0 |10.0.12.2/ | ||
+ | |WAN13 |re1 |10.0.23.2/ | ||
+ | |LAN23 |re2 |192.168.23.2/ | ||
+ | |LAN23 |uCarp0 |192.168.23.254/ | ||
+ | |||
+ | ^R3: ^If name ^Ip address^ | ||
+ | |LAN13 |re0 |192.168.13.3/ | ||
+ | |LAN13 |uCarp0 |192.168.13.254/ | ||
+ | |LAN23 |re1 |192.168.23.3/ | ||
+ | |LAN23 |uCarp1 |192.168.23.254/ | ||
+ | |WAN23 |re2 |10.0.23.3/ | ||
+ | |WAN13 |re3 |10.0.13.3/ | ||
+ | |||
+ | |||
+ | I used the " | ||
+ | |||
+ | Here is the characteristic of the routeurs: | ||
+ | |||
+ | ^Hardware spec ^Virtual Box command option^ | ||
+ | |128 MB of Ram |–memory 128| | ||
+ | |||
+ | Qemu Command for the routers: | ||
+ | < | ||
+ | qemu -m 128 -hda R1.qcow \ | ||
+ | -net nic, | ||
+ | -net nic, | ||
+ | -net nic, | ||
+ | |||
+ | qemu -m 128 -hda R2.qcow \ | ||
+ | -net nic, | ||
+ | -net nic, | ||
+ | -net nic, | ||
+ | |||
+ | qemu -m 128 -hda R3.qcow \ | ||
+ | -net nic, | ||
+ | -net nic, | ||
+ | -net nic, | ||
+ | -net nic, | ||
+ | </ | ||
+ | |||
+ | Then setup to workstation on each LAN with this IP configuration: | ||
+ | |||
+ | ^Workstation ^Ip address ^Gateway^ | ||
+ | |On LAN13 |192.168.13.100/ | ||
+ | |On LAN23 |192.168.23.100/ | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | ===== R1 Configuration ===== | ||
+ | |||
+ | They is two main file that set up the router. The / | ||
+ | To modify the / | ||
+ | |||
+ | ==== R1 rc.conf ==== | ||
+ | |||
+ | |||
+ | Modification to the rc.conf | ||
+ | < | ||
+ | # Hostname | ||
+ | hostname=" | ||
+ | |||
+ | # Configuration of uCARP | ||
+ | ucarp_enable=" | ||
+ | ucarp_if=" | ||
+ | ucarp_src=" | ||
+ | ucarp_vhid=" | ||
+ | ucarp_pass=" | ||
+ | ucarp_preempt=" | ||
+ | ucarp_addr=" | ||
+ | ucarp_shutdown=" | ||
+ | ucarp_facility=" | ||
+ | |||
+ | |||
+ | # Do not start Quagga | ||
+ | quagga_enable=" | ||
+ | |||
+ | # starting XORP | ||
+ | xorp_enable=" | ||
+ | </ | ||
+ | |||
+ | ==== R1 xorp.conf ==== | ||
+ | |||
+ | |||
+ | There is two solutions to input the configuration of Xorp. The first that can be used for many other configuration file is to use a text editor and paste the configuration into it. | ||
+ | The second is to use a specific shell that are launched by " | ||
+ | Since Xorp and quagga have a shell to introduce new configuration and parse the command, I recommand to use the shell. | ||
+ | |||
+ | To give a brief intro to Xorp that is a JunOS like interface; all configuration are done in configuration mode summoned by the " | ||
+ | It is a highly strucuture configuration, | ||
+ | |||
+ | |||
+ | To launch the shell and enter into configuration mode | ||
+ | < | ||
+ | [root@R1XORP]~# | ||
+ | Welcome to XORP on R1XORP.lab | ||
+ | root@R1XORP.lab> | ||
+ | Entering configuration mode. | ||
+ | There are no other users in configuration mode. | ||
+ | [edit] | ||
+ | root@R1XORP.lab# | ||
+ | </ | ||
+ | |||
+ | To setup an IP address to an interface | ||
+ | |||
+ | < | ||
+ | root@R1XORP.lab# | ||
+ | </ | ||
+ | |||
+ | Its look a little bit long at first, but we can split it into a more comprehensive set of command | ||
+ | < | ||
+ | root@R1XORP.lab# | ||
+ | [edit interfaces interface re0] | ||
+ | root@R1XORP.lab# | ||
+ | </ | ||
+ | |||
+ | At this point we are under the structure " | ||
+ | We first create an virtual interface called vif that will contains the protocol to handle IP in this case and its IP. | ||
+ | |||
+ | < | ||
+ | root@R1XORP.lab# | ||
+ | [edit interfaces interface re0] | ||
+ | root@R1XORP.lab# | ||
+ | </ | ||
+ | |||
+ | Then we can even go deeper in the structure to set the mask | ||
+ | |||
+ | < | ||
+ | root@R1XORP.lab# | ||
+ | [edit interfaces interface re0 vif re0 address 192.168.13.1] | ||
+ | root@R1XORP.lab# | ||
+ | </ | ||
+ | |||
+ | Or just do one line : set interfaces interface re0 vif re0 address 192.168.13.1 prefix-length 24 | ||
+ | |||
+ | Same rules apply to the rest of the configuration. Two veryuseful tool to create the configuration: | ||
+ | |||
+ | Here the targetted configuration: | ||
+ | |||
+ | < | ||
+ | protocols { | ||
+ | ospf4 { | ||
+ | router-id: 1.1.1.1 | ||
+ | area 0.0.0.0 { | ||
+ | interface re1 { | ||
+ | vif re1 { | ||
+ | address 10.0.13.1 { | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | interface re2 { | ||
+ | vif re2 { | ||
+ | address 10.0.12.1 { | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | export: " | ||
+ | } | ||
+ | } | ||
+ | policy { | ||
+ | policy-statement " | ||
+ | term connect { | ||
+ | from { | ||
+ | protocol: " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | fea { | ||
+ | unicast-forwarding4 { | ||
+ | } | ||
+ | } | ||
+ | interfaces { | ||
+ | interface re1 { | ||
+ | description: | ||
+ | vif re1 { | ||
+ | address 10.0.13.1 { | ||
+ | prefix-length: | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | interface re2 { | ||
+ | description: | ||
+ | vif re2 { | ||
+ | address 10.0.12.1 { | ||
+ | prefix-length: | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | interface re0 { | ||
+ | description: | ||
+ | vif re0 { | ||
+ | address 192.168.13.1 { | ||
+ | prefix-length: | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | interface lo0 { | ||
+ | vif lo0 { | ||
+ | address 1.1.1.1 { | ||
+ | prefix-length: | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Once this configuration is entered. It must be commited. It is just prepared but not apply. So use the command commit to push this draft configuration into the operational configuration of the router. | ||
+ | |||
+ | < | ||
+ | root@R1XORP.lab# | ||
+ | OK | ||
+ | [edit] | ||
+ | root@R1XORP.lab# | ||
+ | </ | ||
+ | |||
+ | It must be saved to the default file, so on the next reboot the configuration will be loaded. | ||
+ | |||
+ | < | ||
+ | root@R1XORP.lab# | ||
+ | </ | ||
+ | |||
+ | Once R1 is all done save the configuration: | ||
+ | |||
+ | < | ||
+ | [root@R1XORP]~# | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== R2 configuration: | ||
+ | |||
+ | |||
+ | R2 is set with Quagga and carp. To configure uCarp we edit the / | ||
+ | |||
+ | ==== R2 rc.conf ==== | ||
+ | |||
+ | |||
+ | Edit the rc.conf with " | ||
+ | |||
+ | < | ||
+ | # Hostname | ||
+ | hostname=" | ||
+ | |||
+ | |||
+ | # Configuration of uCARP | ||
+ | ucarp_enable=" | ||
+ | ucarp_if=" | ||
+ | ucarp_src=" | ||
+ | ucarp_vhid=" | ||
+ | ucarp_pass=" | ||
+ | ucarp_preempt=" | ||
+ | ucarp_addr=" | ||
+ | ucarp_shutdown=" | ||
+ | ucarp_facility=" | ||
+ | |||
+ | |||
+ | # Start Quagga and all routings daemons | ||
+ | quagga_enable=" | ||
+ | quagga_flags=" | ||
+ | quagga_daemons=" | ||
+ | |||
+ | # Uncomment for starting XORP | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | ==== R2 Quagga ==== | ||
+ | |||
+ | |||
+ | To introduce the configuration to Quagga it is hilgy recommanded to do it with the shell proposed by " | ||
+ | |||
+ | To introduce the configuration, | ||
+ | Here an example to set an interface IP address: | ||
+ | |||
+ | < | ||
+ | [root@R2Quagga]~# | ||
+ | |||
+ | Hello, this is Quagga (version 0.99.14). | ||
+ | Copyright 1996-2005 Kunihiro Ishiguro, et al. | ||
+ | |||
+ | R2Quagga.lab# | ||
+ | R2Quagga.lab(config)# | ||
+ | R2Quagga.lab(config-if)# | ||
+ | R2Quagga.lab(config-if)# | ||
+ | </ | ||
+ | |||
+ | Same rules apply to the rest of the configuration. Two veryuseful tool to create the configuration: | ||
+ | |||
+ | Here the targetted configuration: | ||
+ | |||
+ | < | ||
+ | ! | ||
+ | debug ospf6 lsa unknown | ||
+ | ! | ||
+ | interface carp1 | ||
+ | ! | ||
+ | interface re0 | ||
+ | ip address 10.0.12.2/ | ||
+ | ipv6 nd suppress-ra | ||
+ | ! | ||
+ | interface re1 | ||
+ | ip address 10.0.23.2/ | ||
+ | ipv6 nd suppress-ra | ||
+ | ! | ||
+ | interface re2 | ||
+ | ip address 192.168.23.2/ | ||
+ | ipv6 nd suppress-ra | ||
+ | ! | ||
+ | interface lo0 | ||
+ | ! | ||
+ | interface pflog0 | ||
+ | ipv6 nd suppress-ra | ||
+ | ! | ||
+ | interface pfsync0 | ||
+ | ipv6 nd suppress-ra | ||
+ | ! | ||
+ | router ospf | ||
+ | ospf router-id 2.2.2.2 | ||
+ | | ||
+ | | ||
+ | | ||
+ | ! | ||
+ | ip forwarding | ||
+ | ipv6 forwarding | ||
+ | ! | ||
+ | line vty | ||
+ | ! | ||
+ | end | ||
+ | </ | ||
+ | |||
+ | Once the configuration is enterred it is active, they is no commit to apply like with Xorp, but it must be saved. | ||
+ | |||
+ | < | ||
+ | R2Quagga.lab# | ||
+ | Building Configuration... | ||
+ | Configuration saved to / | ||
+ | Configuration saved to / | ||
+ | Configuration saved to / | ||
+ | Configuration saved to / | ||
+ | Configuration saved to / | ||
+ | Configuration saved to / | ||
+ | Configuration saved to / | ||
+ | [OK] | ||
+ | R2Quagga.lab# | ||
+ | </ | ||
+ | |||
+ | And then save the all configuration of the router: | ||
+ | < | ||
+ | [root@R2Quagga]~# | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== R3 configuration: | ||
+ | |||
+ | |||
+ | R3 is set like like R1 with Xorp and Carp. It has two Carps interfaces as main difference. | ||
+ | We can also will like to set this as the preferred router for the communication between the two lans and set a better " | ||
+ | The preemption is optional. | ||
+ | ==== R3 rc.conf ==== | ||
+ | |||
+ | |||
+ | Here the rc.conf modification that should be present. | ||
+ | |||
+ | < | ||
+ | # Hostname | ||
+ | hostname=" | ||
+ | |||
+ | ifconfig_re0=" | ||
+ | ifconfig_re1=" | ||
+ | |||
+ | # Configuration of uCARP | ||
+ | ucarp_enable=" | ||
+ | ucarp_if=" | ||
+ | ucarp_src=" | ||
+ | ucarp_vhid=" | ||
+ | ucarp_pass=" | ||
+ | ucarp_preempt=" | ||
+ | ucarp_addr=" | ||
+ | ucarp_shutdown=" | ||
+ | ucarp_facility=" | ||
+ | |||
+ | / | ||
+ | |||
+ | # Do not start Quagga | ||
+ | quagga_enable=" | ||
+ | |||
+ | # starting XORP | ||
+ | xorp_enable=" | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== R3 xorp.conf ==== | ||
+ | |||
+ | |||
+ | Like R1 we configure the R3 router with the xorpsh. Then we save it to / | ||
+ | Here is the final configuration. | ||
+ | < | ||
+ | protocols { | ||
+ | ospf4 { | ||
+ | router-id: 3.3.3.3 | ||
+ | area 0.0.0.0 { | ||
+ | interface re2 { | ||
+ | vif re2 { | ||
+ | address 10.0.23.3 { | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | interface re3 { | ||
+ | vif re3 { | ||
+ | address 10.0.13.3 { | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | export: " | ||
+ | } | ||
+ | } | ||
+ | policy { | ||
+ | policy-statement " | ||
+ | term connect { | ||
+ | from { | ||
+ | protocol: " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | fea { | ||
+ | unicast-forwarding4 { | ||
+ | } | ||
+ | } | ||
+ | interfaces { | ||
+ | interface re0 { | ||
+ | vif re0 { | ||
+ | address 192.168.13.3 { | ||
+ | prefix-length: | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | interface re1 { | ||
+ | vif re1 { | ||
+ | address 192.168.23.3 { | ||
+ | prefix-length: | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | interface re2 { | ||
+ | vif re2 { | ||
+ | address 10.0.23.3 { | ||
+ | prefix-length: | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | interface re3 { | ||
+ | vif re3 { | ||
+ | address 10.0.13.3 { | ||
+ | prefix-length: | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ====== Validation: ====== | ||
+ | |||
+ | |||
+ | Check the interface status at the system level with ifconfig command: | ||
+ | Verify that the ip address is the correct one and have a look at the mac address to troobleshoot. | ||
+ | Make sure the status is active for physical interface and ucarp are either Master or Backup. | ||
+ | |||
+ | ===== Example at R3XORP: ===== | ||
+ | |||
+ | < | ||
+ | [root@R3XORP]~# | ||
+ | re0: flags=8943< | ||
+ | options=8< | ||
+ | ether 08: | ||
+ | inet6 fe80:: | ||
+ | inet 192.168.13.3 netmask 0xffffff00 broadcast 192.168.13.255 | ||
+ | media: Ethernet autoselect | ||
+ | status: active | ||
+ | [root@R3XORP]~# | ||
+ | re1: flags=8943< | ||
+ | options=8< | ||
+ | ether 08: | ||
+ | inet6 fe80:: | ||
+ | inet 192.168.23.3 netmask 0xffffff00 broadcast 192.168.23.255 | ||
+ | media: Ethernet autoselect | ||
+ | status: active | ||
+ | [root@R3XORP]~# | ||
+ | re2: flags=8843< | ||
+ | options=8< | ||
+ | ether 08: | ||
+ | inet 10.0.23.3 netmask 0xffffff00 broadcast 10.0.23.255 | ||
+ | inet6 fe80:: | ||
+ | media: Ethernet autoselect | ||
+ | status: active | ||
+ | [root@R3XORP]~# | ||
+ | re3: flags=8843< | ||
+ | options=8< | ||
+ | ether 08: | ||
+ | inet 10.0.13.3 netmask 0xffffff00 broadcast 10.0.13.255 | ||
+ | inet6 fe80:: | ||
+ | media: Ethernet autoselect | ||
+ | status: active | ||
+ | [root@R3XORP]~# | ||
+ | Mar 20 14:02:24 R3XORP ucarp[891]: [WARNING] Warning: no script called when going up | ||
+ | Mar 20 14:02:24 R3XORP ucarp[891]: [WARNING] Warning: no script called when going down | ||
+ | Mar 20 14:02:24 R3XORP ucarp[892]: [WARNING] Switching to state: BACKUP | ||
+ | Mar 20 14:02:25 R3XORP ucarp[1310]: | ||
+ | Mar 20 14:02:25 R3XORP ucarp[1311]: | ||
+ | Mar 20 14:02:25 R3XORP ucarp[1311]: | ||
+ | [root@R3XORP]~# | ||
+ | </ | ||
+ | |||
+ | In R3XORP, Xorp is running, so we check the ospf configuration and the routing table at the xorp level. | ||
+ | The command "show ospf4 neighbor" | ||
+ | We have R2 with the ID 2.2.2.2 connected to through the interface re2 named re2 (vif) at the address 10.0.23.2 and we have R1 with the ID 1.1.1.1 connected through the interface re3 named re3 (vif) at the address 10.0.13.1. | ||
+ | |||
+ | < | ||
+ | [root@R3XORP]~# | ||
+ | Welcome to XORP on R3XORP.lab | ||
+ | root@R3XORP.lab> | ||
+ | Address | ||
+ | 10.0.23.2 | ||
+ | 10.0.13.1 | ||
+ | </ | ||
+ | |||
+ | We then check the routing table: | ||
+ | |||
+ | < | ||
+ | root@R3XORP.lab> | ||
+ | 10.0.12.0/ | ||
+ | > to 10.0.13.1 via re3/re3 | ||
+ | 10.0.13.0/ | ||
+ | > via re3/re3 | ||
+ | 10.0.23.0/ | ||
+ | > via re2/re2 | ||
+ | 192.168.13.0/ | ||
+ | > via re0/re0 | ||
+ | 192.168.23.0/ | ||
+ | > via re1/re1 | ||
+ | </ | ||
+ | |||
+ | And then we check the route learned by ospf process | ||
+ | |||
+ | < | ||
+ | root@R3XORP.lab> | ||
+ | 10.0.12.0/ | ||
+ | > to 10.0.13.1 via re3/re3 | ||
+ | 192.168.13.0/ | ||
+ | > to 10.0.13.1 via re3/re3 | ||
+ | 192.168.23.0/ | ||
+ | > to 10.0.23.2 via re2/re2 | ||
+ | </ | ||
+ | |||
+ | We check also that these routes are correctly redistribute into the system. | ||
+ | |||
+ | < | ||
+ | [root@R3XORP]~# | ||
+ | Routing tables | ||
+ | |||
+ | Internet: | ||
+ | Destination | ||
+ | 10.0.12.0 | ||
+ | 10.0.13.0 | ||
+ | 10.0.23.0 | ||
+ | 10.0.23.2 | ||
+ | localhost | ||
+ | 192.168.13.0 | ||
+ | 192.168.13.100 | ||
+ | 192.168.23.0 | ||
+ | 192.168.23.254 | ||
+ | </ | ||
+ | |||
+ | Same routing check at R1XORP | ||
+ | |||
+ | < | ||
+ | [root@R1XORP]~# | ||
+ | Routing tables | ||
+ | |||
+ | Internet: | ||
+ | Destination | ||
+ | 10.0.12.0 | ||
+ | 10.0.12.2 | ||
+ | 10.0.13.0 | ||
+ | 10.0.23.0 | ||
+ | localhost | ||
+ | 192.168.13.0 | ||
+ | 192.168.13.100 | ||
+ | 192.168.13.254 | ||
+ | 192.168.23.0 | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@R1XORP]~# | ||
+ | Welcome to XORP on R1XORP.lab | ||
+ | root@R1XORP.lab> | ||
+ | Address | ||
+ | 10.0.13.3 | ||
+ | 10.0.12.2 | ||
+ | root@R1XORP.lab> | ||
+ | 10.0.12.0/ | ||
+ | > via re2/re2 | ||
+ | 10.0.13.0/ | ||
+ | > via re1/re1 | ||
+ | 10.0.23.0/ | ||
+ | > to 10.0.13.3 via re1/re1 | ||
+ | 192.168.13.0/ | ||
+ | > via re0/re0 | ||
+ | 192.168.23.0/ | ||
+ | > to 10.0.13.3 via re1/re1 | ||
+ | root@R1XORP.lab> | ||
+ | 10.0.23.0/ | ||
+ | > to 10.0.13.3 via re1/re1 | ||
+ | 192.168.13.0/ | ||
+ | > to 10.0.13.3 via re1/re1 | ||
+ | 192.168.23.0/ | ||
+ | > to 10.0.13.3 via re1/re1 | ||
+ | </ | ||
+ | |||
+ | We do the same check with the R2Quagga routeur, and use the quagga routing interface to extract the same information. | ||
+ | |||
+ | Checking the ospf neighbor | ||
+ | |||
+ | < | ||
+ | [root@R2Quagga]~# | ||
+ | |||
+ | Hello, this is Quagga (version 0.99.14). | ||
+ | Copyright 1996-2005 Kunihiro Ishiguro, et al. | ||
+ | |||
+ | R2Quagga.lab# | ||
+ | |||
+ | Neighbor ID Pri State Dead Time Address | ||
+ | 1.1.1.1 | ||
+ | 3.3.3.3 | ||
+ | R2Quagga.lab# | ||
+ | </ | ||
+ | |||
+ | Check the Ip route table | ||
+ | |||
+ | < | ||
+ | R2Quagga.lab# | ||
+ | Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, | ||
+ | I - ISIS, B - BGP, > - selected route, * - FIB route | ||
+ | |||
+ | O | ||
+ | C>* 10.0.12.0/ | ||
+ | O>* 10.0.13.0/ | ||
+ | via 10.0.23.3, re1, 00:28:41 | ||
+ | O | ||
+ | C>* 10.0.23.0/ | ||
+ | C>* 127.0.0.0/8 is directly connected, lo0 | ||
+ | O>* 192.168.13.0/ | ||
+ | via 10.0.23.3, re1, 00:28:41 | ||
+ | O | ||
+ | C * 192.168.23.0/ | ||
+ | C>* 192.168.23.0/ | ||
+ | </ | ||
+ | |||
+ | Check the ospf routes learned. | ||
+ | |||
+ | < | ||
+ | R2Quagga.lab# | ||
+ | Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, | ||
+ | I - ISIS, B - BGP, > - selected route, * - FIB route | ||
+ | |||
+ | O | ||
+ | O>* 10.0.13.0/ | ||
+ | via 10.0.23.3, re1, 01:28:26 | ||
+ | O | ||
+ | O>* 192.168.13.0/ | ||
+ | via 10.0.23.3, re1, 01:28:26 | ||
+ | O | ||
+ | </ | ||
+ | |||
+ | Check the system routing table | ||
+ | |||
+ | < | ||
+ | [root@R2Quagga]~# | ||
+ | Routing tables | ||
+ | |||
+ | Internet: | ||
+ | Destination | ||
+ | 10.0.12.0/ | ||
+ | 10.0.12.1 | ||
+ | 10.0.13.0/ | ||
+ | 10.0.23.0/ | ||
+ | 127.0.0.1 | ||
+ | 192.168.13.0/ | ||
+ | 192.168.23.0/ | ||
+ | </ | ||
+ | |||
+ | ===== DR and BDR: ===== | ||
+ | |||
+ | |||
+ | Checking the DR and BDR with the following command. | ||
+ | < | ||
+ | root@R3XORP.lab> | ||
+ | Address | ||
+ | 10.0.23.2 | ||
+ | Area 0.0.0.0, opt 0x2, DR 10.0.23.3, BDR 10.0.23.2 | ||
+ | Up 00:25:18, adjacent 00:25:11 | ||
+ | 10.0.13.1 | ||
+ | Area 0.0.0.0, opt 0x2, DR 10.0.13.1, BDR 10.0.13.3 | ||
+ | Up 00:52:52, adjacent 00:52:47 | ||
+ | </ | ||
+ | < | ||
+ | root@R1XORP.lab> | ||
+ | Address | ||
+ | 10.0.13.3 | ||
+ | Area 0.0.0.0, opt 0x2, DR 10.0.13.1, BDR 10.0.13.3 | ||
+ | Up 01:53:05, adjacent 00:54:17 | ||
+ | 10.0.12.2 | ||
+ | Area 0.0.0.0, opt 0x2, DR 10.0.12.1, BDR 10.0.12.2 | ||
+ | Up 01:53:03, adjacent 00:51:57 | ||
+ | </ | ||
+ | |||
+ | By default we could assume that the DR in between R2Quagga and R3XORP would have benn R2Quagga. But R3XORP is the DR. It look like the priority value are not the same in between the Quagga and XORP. | ||
+ | |||
+ | ==== Priority default value: ==== | ||
+ | |||
+ | |||
+ | At this point One difference can be seen in between the Xorp implementation and the Quagga at the Ospf level. | ||
+ | The command that show the neigboorhood display a different Priority setting, but we did not set it at all during the configuration phase. | ||
+ | |||
+ | < | ||
+ | root@R3XORP.lab> | ||
+ | Address | ||
+ | 10.0.23.2 | ||
+ | 10.0.13.1 | ||
+ | </ | ||
+ | |||
+ | By default the priority of Xorp is set at 1 in the ospf process, as we can see in the extract below of R1XORP | ||
+ | |||
+ | < | ||
+ | root@R1XORP.lab# | ||
+ | protocols { | ||
+ | ospf4 { | ||
+ | router-id: 1.1.1.1 | ||
+ | rfc1583-compatibility: | ||
+ | ip-router-alert: | ||
+ | area 0.0.0.0 { | ||
+ | area-type: " | ||
+ | interface re1 { | ||
+ | link-type: " | ||
+ | vif re1 { | ||
+ | address 10.0.13.1 { | ||
+ | priority: 128 | ||
+ | hello-interval: | ||
+ | router-dead-interval: | ||
+ | interface-cost: | ||
+ | retransmit-interval: | ||
+ | transit-delay: | ||
+ | disable: false | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | interface re2 { | ||
+ | link-type: " | ||
+ | vif re2 { | ||
+ | address 10.0.12.1 { | ||
+ | priority: 128 | ||
+ | hello-interval: | ||
+ | router-dead-interval: | ||
+ | interface-cost: | ||
+ | retransmit-interval: | ||
+ | transit-delay: | ||
+ | disable: false | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | export: " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | On the other hand the interface on the Quagga router has a priority of 1. So R2 will no be a DR in front of the XORP default value. (Higher priority is preferred) | ||
+ | |||
+ | |||
+ | < | ||
+ | R2Quagga.lab# | ||
+ | re0 is up | ||
+ | ifindex 1, MTU 1500 bytes, BW 0 Kbit < | ||
+ | Internet Address 10.0.12.2/ | ||
+ | MTU mismatch detection: | ||
+ | Router ID 2.2.2.2, Network Type BROADCAST, Cost: 10 | ||
+ | Transmit Delay is 1 sec, State Backup, Priority 1 | ||
+ | Designated Router (ID) 1.1.1.1, Interface Address 10.0.12.1 | ||
+ | Backup Designated Router (ID) 2.2.2.2, Interface Address 10.0.12.2 | ||
+ | Multicast group memberships: | ||
+ | Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5 | ||
+ | Hello due in 9.406s | ||
+ | Neighbor Count is 1, Adjacent neighbor count is 1 | ||
+ | </ | ||
+ | |||
+ | ====== Failover and behavior: ====== | ||
+ | |||
+ | |||
+ | By default the lab is set to use the best path. So we should be using R3 as the shortest path from LAN13 to LAN 23. To do so, R3 should be turn on first; or premption should be enable. | ||
+ | |||
+ | Check on the workstation (DOS) at the LAN13: | ||
+ | < | ||
+ | E: | ||
+ | |||
+ | Détermination de l' | ||
+ | |||
+ | 1 5 ms 35 ms <1 ms 192.168.13.3 | ||
+ | 2 24 ms 2 ms 1 ms 192.168.23.100 | ||
+ | |||
+ | Itinéraire déterminé. | ||
+ | |||
+ | E: | ||
+ | |||
+ | Envoi d'une requête ' | ||
+ | |||
+ | Réponse de 192.168.23.100 : octets=32 temps=40 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=4 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=15 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=5 ms TTL=63 | ||
+ | |||
+ | Statistiques Ping pour 192.168.23.100: | ||
+ | Paquets : envoyés = 4, reçus = 4, perdus = 0 (perte 0%), | ||
+ | Durée approximative des boucles en millisecondes : | ||
+ | Minimum = 4ms, Maximum = 40ms, Moyenne = 16ms | ||
+ | |||
+ | E: | ||
+ | </ | ||
+ | |||
+ | The same command should be done on the workstation at LAN23 to see we have the same path. | ||
+ | |||
+ | |||
+ | We can now try to turn on and off the interface with the following command | ||
+ | |||
+ | |||
+ | Disconnect interface 1 (re0) on R3XORP and connect it back command: | ||
+ | < | ||
+ | [root@R3XORP]~# | ||
+ | [root@R3XORP]~# | ||
+ | </ | ||
+ | |||
+ | Disconnect interface 2 (re1) on R3XORP and connect it back command: | ||
+ | < | ||
+ | [root@R3XORP]~# | ||
+ | [root@R3XORP]~# | ||
+ | </ | ||
+ | |||
+ | To test the failover we run a ping command (DOS) | ||
+ | |||
+ | < | ||
+ | E: | ||
+ | |||
+ | Envoi d'une requête ' | ||
+ | |||
+ | Réponse de 192.168.23.100 : octets=32 temps=46 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=2 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=12 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=4 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=4 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=15 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=4 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=4 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=4 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=4 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=15 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=2 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=13 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=5 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=4 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=15 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=5 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=4 ms TTL=63 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=2 ms TTL=63 | ||
+ | Délai d' | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=6 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=5 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=3 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=14 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=5 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=4 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=5 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=5 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=4 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=15 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=5 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=3 ms TTL=62 | ||
+ | Réponse de 192.168.23.100 : octets=32 temps=14 ms TTL=62 | ||
+ | </ | ||
+ | |||
+ | In this run I loose a paquet, it does happen in the simulated environment that extra latency is added. Some other runs does not have this lost. | ||
+ | |||
+ | If we set a ucarp preemption at R3XORP, when we connect back the interface. R3XORP will reclaim its master right, and we will comme back to the initial state. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
documentation/examples/lab_with_carp_xorp_and_quagga.txt · Last modified: 2011/04/07 11:19 by 127.0.0.1