documentation:examples:simple_ucarp_lab
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | documentation:examples:simple_ucarp_lab [2017/07/07 00:24] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Simple uCarp lab ====== | ||
+ | This lab use the fixed ucarp rc script (introduced in BSDRP 0.34). | ||
+ | |||
+ | ===== Network Diagram ===== | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ===== Creating the lab with VirtualBox ===== | ||
+ | |||
+ | Start a lab using the [[documentation: | ||
+ | < | ||
+ | [root@d630]./ | ||
+ | Bzipped image detected, unzip it... | ||
+ | filename guests a i386 image | ||
+ | filename guests a serial image | ||
+ | Image file given… rebuilding BSDRP router template | ||
+ | Creating lab with 4 router(s): | ||
+ | - 2 LAN between all routers | ||
+ | - Full mesh ethernet point-to-point link between each routers | ||
+ | |||
+ | Router1 have the following NIC: | ||
+ | em0 connected to Router2. | ||
+ | em1 connected to Router3. | ||
+ | em2 connected to Router4. | ||
+ | em3 connected to LAN number 1. | ||
+ | em4 connected to LAN number 2. | ||
+ | Router2 have the following NIC: | ||
+ | em0 connected to Router1. | ||
+ | em1 connected to Router3. | ||
+ | em2 connected to Router4. | ||
+ | em3 connected to LAN number 1. | ||
+ | em4 connected to LAN number 2. | ||
+ | Router3 have the following NIC: | ||
+ | em0 connected to Router1. | ||
+ | em1 connected to Router2. | ||
+ | em2 connected to Router4. | ||
+ | em3 connected to LAN number 1. | ||
+ | em4 connected to LAN number 2. | ||
+ | Router4 have the following NIC: | ||
+ | em0 connected to Router1. | ||
+ | em1 connected to Router2. | ||
+ | em2 connected to Router3. | ||
+ | em3 connected to LAN number 1. | ||
+ | em4 connected to LAN number 2. | ||
+ | Connect to the router 1 by telneting to localhost on port 8001 | ||
+ | Connect to the router 2 by telneting to localhost on port 8002 | ||
+ | Connect to the router 3 by telneting to localhost on port 8003 | ||
+ | Connect to the router 4 by telneting to localhost on port 8004 | ||
+ | Connect to the router 4 by telneting to localhost on port 8005 | ||
+ | Here is how to use a serial terminal software for connecting to the routers: | ||
+ | 1. Create a bridge between the socat port and a local PTY link | ||
+ | socat TCP-CONNECT: | ||
+ | 2. Open your serial terminal software using the local PTY link just created | ||
+ | Using screen/ | ||
+ | | ||
+ | Or using tip (FreeBSD): | ||
+ | echo " | ||
+ | tip router1 | ||
+ | Warning: Closing your session will close socat on both end | ||
+ | </ | ||
+ | |||
+ | ===== Configuring Routers ===== | ||
+ | |||
+ | ==== Router 1 (R1) ==== | ||
+ | |||
+ | < | ||
+ | sysrc hostname=R1 | ||
+ | sysrc gateway_enable=NO | ||
+ | sysrc ipv6_gateway_enable=NO | ||
+ | sysrc defaultrouter=" | ||
+ | sysrc ifconfig_em3=" | ||
+ | service netif restart | ||
+ | service routing restart | ||
+ | </ | ||
+ | |||
+ | ==== Router 2 (R2) ==== | ||
+ | |||
+ | < | ||
+ | sysrc hostname=R2 | ||
+ | sysrc ifconfig_em3=" | ||
+ | sysrc ifconfig_em4=" | ||
+ | sysrc ucarp_enable=YES | ||
+ | sysrc ucarp_3_if=" | ||
+ | sysrc ucarp_3_src=" | ||
+ | sysrc ucarp_3_pass=" | ||
+ | sysrc ucarp_3_preempt=" | ||
+ | sysrc ucarp_3_addr=" | ||
+ | sysrc ucarp_4_if=" | ||
+ | sysrc ucarp_4_src=" | ||
+ | sysrc ucarp_4_pass=" | ||
+ | sysrc ucarp_4_preempt=" | ||
+ | sysrc ucarp_4_addr=" | ||
+ | service netif restart | ||
+ | service routing restart | ||
+ | service ucarp start | ||
+ | </ | ||
+ | |||
+ | ==== Router 3 (R3) ==== | ||
+ | |||
+ | < | ||
+ | sysrc hostname=R3 | ||
+ | sysrc ifconfig_em3=" | ||
+ | sysrc ifconfig_em4=" | ||
+ | sysrc ucarp_enable=" | ||
+ | sysrc ucarp_3_if=" | ||
+ | sysrc ucarp_3_src=" | ||
+ | sysrc ucarp_3_pass=" | ||
+ | sysrc ucarp_3_preempt=" | ||
+ | sysrc ucarp_3_addr=" | ||
+ | sysrc ucarp_3_advskew=" | ||
+ | sysrc ucarp_4_if=" | ||
+ | sysrc ucarp_4_src=" | ||
+ | sysrc ucarp_4_pass=" | ||
+ | sysrc ucarp_4_preempt=" | ||
+ | sysrc ucarp_4_addr=" | ||
+ | sysrc ucarp_4_advskew=" | ||
+ | service netif restart | ||
+ | service routing restart | ||
+ | service ucarp start | ||
+ | </ | ||
+ | ==== Router 4 (R4) ==== | ||
+ | |||
+ | < | ||
+ | sysrc hostname=R4 | ||
+ | sysrc gateway_enable=NO | ||
+ | sysrc defaultrouter=" | ||
+ | sysrc ifconfig_em4=" | ||
+ | service netif restart | ||
+ | service routing restart | ||
+ | config save | ||
+ | </ | ||
+ | |||
+ | ===== Checking configuration ===== | ||
+ | |||
+ | ==== uCarp state ==== | ||
+ | |||
+ | On R2: | ||
+ | |||
+ | < | ||
+ | [root@R2]~# | ||
+ | Jul 27 17:54:02 R2 ucarp[1815]: | ||
+ | Jul 27 17:54:02 R2 ucarp[1815]: | ||
+ | Jul 27 17:54:02 R2 ucarp[1819]: | ||
+ | Jul 27 17:54:02 R2 ucarp[1819]: | ||
+ | </ | ||
+ | |||
+ | //R2 is the uCarp master for vrid 3 and 4.// | ||
+ | |||
+ | On R3: | ||
+ | |||
+ | < | ||
+ | [root@R3]~# | ||
+ | Jul 29 01:03:11 R3 ucarp[1228]: | ||
+ | Jul 29 01:03:11 R3 ucarp[1228]: | ||
+ | k to BACKUP state | ||
+ | Jul 29 01:03:11 R3 ucarp[1225]: | ||
+ | Jul 29 01:03:11 R3 ucarp[1225]: | ||
+ | Jul 29 01:03:11 R3 ucarp[1225]: | ||
+ | </ | ||
+ | |||
+ | //R3 is the uCarp backup for vrid 3 and 4.// | ||
+ | |||
+ | ==== Forwarding and ARP state ==== | ||
+ | |||
+ | Pinging R4 from R1: | ||
+ | < | ||
+ | [root@R1]~# | ||
+ | PING 10.0.0.4 (10.0.0.4): 56 data bytes | ||
+ | 64 bytes from 10.0.0.4: icmp_seq=0 ttl=63 time=2.932 ms | ||
+ | 64 bytes from 10.0.0.4: icmp_seq=1 ttl=63 time=2.360 ms | ||
+ | |||
+ | </ | ||
+ | And checking ARP cache: | ||
+ | |||
+ | < | ||
+ | [root@R1]~# | ||
+ | ? (192.168.10.254) at cc: | ||
+ | |||
+ | </ | ||
+ | |||
+ | < | ||
+ | |||
+ | ==== Testing uCarp failover ==== | ||
+ | |||
+ | Disable one interface on R2 for changing the VRRP states: | ||
+ | < | ||
+ | [root@R2]~# | ||
+ | [root@R2]~# | ||
+ | Jul 27 17:53:59 R2 ucarp[1815]: | ||
+ | Jul 27 17:53:59 R2 ucarp[1815]: | ||
+ | Jul 29 01:03:11 R2 ucarp[1815]: | ||
+ | Jul 29 01:03:12 R2 ucarp[1819]: | ||
+ | Jul 29 01:03:12 R2 ucarp[1815]: | ||
+ | |||
+ | </ | ||
+ | |||
+ | And check that R3 became the master: | ||
+ | |||
+ | < | ||
+ | [root@R3]~# | ||
+ | Jul 29 00:56:37 R3 ucarp[1225]: | ||
+ | Jul 29 00:56:37 R3 ucarp[1225]: | ||
+ | </ | ||
+ | |||
+ | And check that R1 still can reach R4: | ||
+ | |||
+ | < | ||
+ | [root@R1]~# | ||
+ | PING 10.0.0.4 (10.0.0.4): 56 data bytes | ||
+ | 64 bytes from 10.0.0.4: icmp_seq=0 ttl=63 time=2.321 ms | ||
+ | 64 bytes from 10.0.0.4: icmp_seq=1 ttl=63 time=2.450 ms | ||
+ | |||
+ | </ |
documentation/examples/simple_ucarp_lab.txt · Last modified: 2017/07/07 00:24 by 127.0.0.1