documentation:examples:graphpath
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | documentation:examples:graphpath [2018/10/15 23:51] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Testing graphpath, the ASCII network diagram tool ====== | ||
+ | |||
+ | This lab show an jail/vnet based diagram used for testing BSDRP' | ||
+ | |||
+ | ===== Presentation ===== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | For testing this tools, we need to create a network with a topology allowing all graphpath use cases. | ||
+ | |||
+ | ==== Network diagram ==== | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | ===== Setting-up the lab ===== | ||
+ | |||
+ | ==== Downloading BSD Router Project images ==== | ||
+ | |||
+ | Download BSDRP serial image (prevent to have to use an X display) on Sourceforge. | ||
+ | |||
+ | ==== Download Lab scripts ===== | ||
+ | |||
+ | More information on these BSDRP lab scripts available on [[documentation: | ||
+ | |||
+ | Start the lab with only one router, example with bhyve under FreeBSD: | ||
+ | < | ||
+ | user:~ # tools/ | ||
+ | BSD Router Project (http:// | ||
+ | Setting-up a virtual lab with 1 VM(s): | ||
+ | - Working directory: /tmp/BSDRP | ||
+ | - Each VM has 1 core(s) and 512M RAM | ||
+ | - Emulated NIC: virtio-net | ||
+ | - Switch mode: bridge + tap | ||
+ | - 1 LAN(s) between all VM | ||
+ | - Full mesh Ethernet links between each VM | ||
+ | VM 1 have the following NIC: | ||
+ | - vtnet0 connected to LAN number 1 | ||
+ | For connecting to VM' | ||
+ | - VM 1 : cu -l /dev/nmdm1B | ||
+ | </ | ||
+ | |||
+ | ===== Network setup ===== | ||
+ | |||
+ | From BSDRP, you can configure all these with only one command line: | ||
+ | < | ||
+ | labconfig graphpath | ||
+ | </ | ||
+ | ==== Host (me) ==== | ||
+ | |||
+ | < | ||
+ | sysrc hostname=" | ||
+ | sysrc cloned_interfaces=" | ||
+ | sysrc ifconfig_bridge1=" | ||
+ | sysrc ifconfig_bridge1_ipv6=" | ||
+ | sysrc ifconfig_bridge2=" | ||
+ | sysrc ifconfig_bridge2_ipv6=" | ||
+ | sysrc ifconfig_bridge11=" | ||
+ | sysrc ifconfig_bridge12=" | ||
+ | sysrc ifconfig_bridge21=" | ||
+ | sysrc static_routes=" | ||
+ | sysrc route_host11=" | ||
+ | sysrc route_host12=" | ||
+ | sysrc route_host21=" | ||
+ | sysrc ipv6_static_routes=" | ||
+ | sysrc ipv6_route_host11=" | ||
+ | sysrc ipv6_route_host12=" | ||
+ | sysrc ipv6_route_host21=" | ||
+ | hostname me | ||
+ | service netif restart | ||
+ | service routing restart | ||
+ | </ | ||
+ | |||
+ | ==== Jail host11 ==== | ||
+ | |||
+ | host11 is configured as a simple host: | ||
+ | |||
+ | < | ||
+ | tenant -c -j host11 -i bridge11 | ||
+ | cat > / | ||
+ | hostname=" | ||
+ | ifconfig_epair111b=" | ||
+ | ifconfig_epair111b_ipv6=" | ||
+ | defaultrouter=" | ||
+ | ipv6_defaultrouter=" | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | ==== Jail host12 ==== | ||
+ | |||
+ | host12 is configured as a simple host: | ||
+ | |||
+ | < | ||
+ | tenant -c -j host12 -i bridge12 | ||
+ | cat > / | ||
+ | hostname=" | ||
+ | ifconfig_epair212b=" | ||
+ | ifconfig_epair212b_ipv6=" | ||
+ | defaultrouter=" | ||
+ | ipv6_defaultrouter=" | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | ==== Jail router11 ==== | ||
+ | |||
+ | router11 is configured as a router: | ||
+ | |||
+ | < | ||
+ | tenant -c -j router11 -i bridge1, | ||
+ | cat > / | ||
+ | hostname=" | ||
+ | gateway_enable=YES | ||
+ | ipv6_gateway_enable=YES | ||
+ | ifconfig_epair31b=" | ||
+ | ifconfig_epair31b_ipv6=" | ||
+ | ifconfig_epair311b=" | ||
+ | ifconfig_epair311b_ipv6=" | ||
+ | defaultrouter=" | ||
+ | ipv6_defaultrouter=" | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | ==== Jail router12 ==== | ||
+ | |||
+ | router12 is configured as a router: | ||
+ | |||
+ | < | ||
+ | tenant -c -j router12 -i bridge1, | ||
+ | cat > / | ||
+ | hostname=router12 | ||
+ | gateway_enable=YES | ||
+ | ipv6_gateway_enable=YES | ||
+ | ifconfig_epair41b=" | ||
+ | ifconfig_epair41b_ipv6=" | ||
+ | ifconfig_epair412b=" | ||
+ | ifconfig_epair412b_ipv6=" | ||
+ | defaultrouter=" | ||
+ | ipv6_defaultrouter=" | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | ==== Jail router21 ==== | ||
+ | |||
+ | router21 is configured as a router: | ||
+ | |||
+ | < | ||
+ | tenant -c -j router21 -i bridge2, | ||
+ | cat > / | ||
+ | hostname=" | ||
+ | gateway_enable=YES | ||
+ | ipv6_gateway_enable=YES | ||
+ | ifconfig_epair52b=" | ||
+ | ifconfig_epair52b_ipv6=" | ||
+ | ifconfig_epair521b=" | ||
+ | ifconfig_epair521b_ipv6=" | ||
+ | defaultrouter=" | ||
+ | ipv6_defaultrouter=" | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | ==== Jail host21 ==== | ||
+ | |||
+ | host21 is configured as a simple host: | ||
+ | |||
+ | < | ||
+ | tenant -c -j host21 -i bridge21 | ||
+ | cat > / | ||
+ | hostname=" | ||
+ | ifconfig_epair621b=" | ||
+ | ifconfig_epair621b_ipv6=" | ||
+ | defaultrouter=" | ||
+ | ipv6_defaultrouter=" | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | ==== Start the jails ==== | ||
+ | |||
+ | < | ||
+ | [root@me]~# service jail start | ||
+ | Starting jails: | ||
+ | epair111b: Ethernet address: 02: | ||
+ | epair212a: Ethernet address: 02: | ||
+ | epair212b: Ethernet address: 02: | ||
+ | epair31a: Ethernet address: 02: | ||
+ | epair31b: Ethernet address: 02: | ||
+ | epair41a: Ethernet address: 02: | ||
+ | epair41b: Ethernet address: 02: | ||
+ | epair311a: Ethernet address: 02: | ||
+ | epair311b: Ethernet address: 02: | ||
+ | epair52a: Ethernet address: 02: | ||
+ | epair52b: Ethernet address: 02: | ||
+ | epair412a: Ethernet address: 02: | ||
+ | epair412b: Ethernet address: 02: | ||
+ | epair621a: Ethernet address: 02: | ||
+ | epair621b: Ethernet address: 02: | ||
+ | epair521a: Ethernet address: 02: | ||
+ | epair521b: Ethernet address: 02: | ||
+ | | ||
+ | </ | ||
+ | |||
+ | And test host11 can reach host21: | ||
+ | < | ||
+ | [root@me]~# jexec host11 traceroute 10.0.21.21 | ||
+ | traceroute to 10.0.21.21 (10.0.21.21), | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | [root@me]~# jexec host11 traceroute6 2001: | ||
+ | traceroute6 to 2001: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ===== Testing graphpath ===== | ||
+ | |||
+ | Now, from the main host, we should be able to generate some ASCII network diagrams: | ||
+ | |||
+ | ==== Inet4 ==== | ||
+ | < | ||
+ | [root@me]~# ping -c 1 10.0.11.11 | ||
+ | [root@me]~# ping -c 1 10.0.12.12 | ||
+ | [root@me]~# ping -c 1 10.0.21.21 | ||
+ | [root@me]~# graphpath 10.0.11.11 10.0.12.12 | ||
+ | +-----------------------------+ | ||
+ | | SOURCE HOST | ||
+ | | IP: | ||
+ | +-----------------------------+ | ||
+ | | | | ||
+ | +-----------------------------+ | ||
+ | | ROUTER TOWARDS SOURCE | ||
+ | | IP: | ||
+ | | ARP: 02: | ||
+ | +-----------------------------+ | ||
+ | | | | ||
+ | --+---+------------------------+--- | ||
+ | | | ||
+ | +-----------------------------+ | ||
+ | | IF: | ||
+ | | MAC: 02: | ||
+ | | IP: | ||
+ | | net: 10.0.11.0 | ||
+ | | mask: 255.255.255.0 | ||
+ | | | | ||
+ | | THIS ROUTER | ||
+ | +-----------------------------+ | ||
+ | |||
+ | [root@me]~# graphpath 10.0.11.11 10.0.21.21 | ||
+ | +-----------------------------+ | ||
+ | | SOURCE HOST | | ||
+ | | IP: | ||
+ | +-----------------------------+ | ||
+ | | | ||
+ | +-----------------------------+ | ||
+ | | ROUTER TOWARDS SOURCE | ||
+ | | IP: | ||
+ | | ARP: 02: | ||
+ | +-----------------------------+ | ||
+ | | | ||
+ | +-----------------------------+ | ||
+ | | IF: | ||
+ | | MAC: 02: | ||
+ | | IP: | ||
+ | | net: 10.0.11.0 | ||
+ | | mask: 255.255.255.0 | ||
+ | | | | ||
+ | | THIS ROUTER | ||
+ | | | | ||
+ | | net: 10.0.21.0 | ||
+ | | mask: 255.255.255.0 | ||
+ | | IP: | ||
+ | | MAC: 02: | ||
+ | | IF: | ||
+ | +-----------------------------+ | ||
+ | | | ||
+ | +-----------------------------+ | ||
+ | | ROUTER TOWARDS DESTINATION | ||
+ | | IP: | ||
+ | | ARP: 02: | ||
+ | +-----------------------------+ | ||
+ | | | ||
+ | +-----------------------------+ | ||
+ | | DESTINATION HOST | | ||
+ | | IP: | ||
+ | +-----------------------------+ | ||
+ | |||
+ | [root@me]~# graphpath 10.0.11.11 10.0.1.12 | ||
+ | +-----------------------------+ | ||
+ | | SOURCE HOST | ||
+ | | IP: | ||
+ | | | ||
+ | +-----------------------------+ | ||
+ | | | | ||
+ | +-----------------------------+ | ||
+ | | ROUTER TOWARDS SOURCE | ||
+ | | IP: | ||
+ | | ARP: 02: | ||
+ | +-----------------------------+ | ||
+ | | | | ||
+ | --+---+------------------------+--- | ||
+ | | | ||
+ | +-----------------------------+ | ||
+ | | IF: | ||
+ | | MAC: 02: | ||
+ | | IP: | ||
+ | | net: 10.0.11.0 | ||
+ | | mask: 255.255.255.0 | ||
+ | | | | ||
+ | | THIS ROUTER | ||
+ | +-----------------------------+ | ||
+ | |||
+ | [root@me]~# | ||
+ | +-----------------------------+ | ||
+ | | SOURCE HOST | ||
+ | | IP: | ||
+ | | ARP: 02: | ||
+ | +-----------------------------+ | ||
+ | | | | ||
+ | | +-----------------------------+ | ||
+ | | | ROUTER TOWARDS DESTINATION | ||
+ | | | IP: | ||
+ | | | ARP: 02: | ||
+ | | +-----------------------------+ | ||
+ | | | | ||
+ | --+---+------------------------+--- | ||
+ | | | ||
+ | +-----------------------------+ | ||
+ | | IF: | ||
+ | | MAC: 02: | ||
+ | | IP: | ||
+ | | net: 10.0.1.0 | ||
+ | | mask: 255.255.255.0 | ||
+ | | | | ||
+ | | THIS ROUTER | ||
+ | +-----------------------------+ | ||
+ | </ | ||
+ | |||
+ | ==== Inet6 ==== | ||
+ | |||
+ | < | ||
+ | [root@me]~# ping6 -c 1 2001: | ||
+ | [root@me]~# ping6 -c 1 2001: | ||
+ | [root@me]~# ping6 -c 1 2001: | ||
+ | [root@me]~# graphpath 2001: | ||
+ | +---------------------------------------------------+ | ||
+ | | SOURCE HOST | ||
+ | | IP: | ||
+ | +---------------------------------------------------+ | ||
+ | | ||
+ | +---------------------------------------------------+ | ||
+ | | ROUTER TOWARDS SOURCE | ||
+ | | IP: | ||
+ | | NDP: 02: | ||
+ | +---------------------------------------------------+ | ||
+ | | ||
+ | | ||
+ | | | ||
+ | +---------------------------------------------------+ | ||
+ | | IF: | ||
+ | | MAC: 02: | ||
+ | | IP: | ||
+ | | net: 2001: | ||
+ | | mask: ffff: | ||
+ | | | | ||
+ | | THIS ROUTER | ||
+ | +---------------------------------------------------+ | ||
+ | |||
+ | [root@me]~# graphpath 2001: | ||
+ | +---------------------------------------------------+ | ||
+ | | SOURCE HOST | | ||
+ | | IP: | ||
+ | +---------------------------------------------------+ | ||
+ | | | ||
+ | +---------------------------------------------------+ | ||
+ | | ROUTER TOWARDS SOURCE | ||
+ | | IP: | ||
+ | | NDP: 02: | ||
+ | +---------------------------------------------------+ | ||
+ | | | ||
+ | +---------------------------------------------------+ | ||
+ | | IF: | ||
+ | | MAC: 02: | ||
+ | | IP: | ||
+ | | net: 2001: | ||
+ | | mask: ffff: | ||
+ | | | | ||
+ | | THIS ROUTER | ||
+ | | | | ||
+ | | net: 2001: | ||
+ | | mask: ffff: | ||
+ | | IP: | ||
+ | | MAC: 02: | ||
+ | | IF: | ||
+ | +---------------------------------------------------+ | ||
+ | | | ||
+ | +---------------------------------------------------+ | ||
+ | | ROUTER TOWARDS DESTINATION | ||
+ | | IP: | ||
+ | | NDP: 02: | ||
+ | +---------------------------------------------------+ | ||
+ | |||
+ | [root@me]~# graphpath 2001: | ||
+ | +---------------------------------------------------+ | ||
+ | | SOURCE HOST | ||
+ | | IP: | ||
+ | | | ||
+ | +---------------------------------------------------+ | ||
+ | | ||
+ | +---------------------------------------------------+ | ||
+ | | ROUTER TOWARDS SOURCE | ||
+ | | IP: | ||
+ | | NDP: 02: | ||
+ | +---------------------------------------------------+ | ||
+ | | ||
+ | | ||
+ | | | ||
+ | +---------------------------------------------------+ | ||
+ | | IF: | ||
+ | | MAC: 02: | ||
+ | | IP: | ||
+ | | net: 2001: | ||
+ | | mask: ffff: | ||
+ | | | | ||
+ | | THIS ROUTER | ||
+ | +---------------------------------------------------+ | ||
+ | |||
+ | [root@me]~# graphpath 2001: | ||
+ | +---------------------------------------------------+ | ||
+ | | SOURCE HOST | ||
+ | | IP: | ||
+ | | NDP: 02: | ||
+ | +---------------------------------------------------+ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | | ||
+ | +---------------------------------------------------+ | ||
+ | | IF: | ||
+ | | MAC: 02: | ||
+ | | IP: | ||
+ | | net: 2001: | ||
+ | | mask: ffff: | ||
+ | | | | ||
+ | | THIS ROUTER | ||
+ | +---------------------------------------------------+ | ||
+ | </ | ||
documentation/examples/graphpath.txt · Last modified: 2018/10/15 23:51 by 127.0.0.1