├── .gitignore ├── Dockerfiles ├── README.md ├── bird │ └── 18.10 │ │ └── Dockerfile ├── centos │ └── 7 │ │ ├── Dockerfile │ │ ├── disable_seg6_router.py │ │ └── enable_seg6_router.py ├── conntrack │ ├── Dockerfile │ └── build.sh ├── coredns │ ├── Dockerfile │ └── build.sh ├── cuishark │ └── Dockerfile ├── dpdk │ ├── 16.04 │ │ └── Dockerfile │ └── app │ │ ├── Dockerfile │ │ ├── README │ │ └── entrypoint.sh ├── etcd │ ├── Dockerfile │ └── build.sh ├── fedora │ └── 31 │ │ ├── Dockerfile │ │ ├── disable_seg6_router.py │ │ └── enable_seg6_router.py ├── frr │ ├── 18.04 │ │ ├── Dockerfile │ │ ├── disable_seg6_router.py │ │ └── enable_seg6_router.py │ ├── centos-7 │ │ ├── Dockerfile │ │ ├── build.sh │ │ ├── disable_seg6_router.py │ │ └── enable_seg6_router.py │ └── cumulus │ │ └── Dockerfile ├── gobgp │ └── 18.04 │ │ ├── Dockerfile │ │ ├── disable_seg6_router.py │ │ └── enable_seg6_router.py ├── ovs │ └── Dockerfile ├── rift │ └── ietf-rift-03 │ │ └── Dockerfile ├── tmp │ └── Dockerfile ├── topotest │ ├── Dockerfile │ ├── build.sh │ └── docker-start ├── ubuntu │ ├── 16.04 │ │ └── Dockerfile │ ├── 18.04 │ │ ├── Dockerfile │ │ ├── disable_seg6_router.py │ │ └── enable_seg6_router.py │ └── 18.10 │ │ ├── Dockerfile │ │ ├── disable_seg6_router.py │ │ └── enable_seg6_router.py └── vpp │ ├── 19.04 │ ├── Dockerfile │ ├── disable_seg6_router.py │ ├── enable_seg6_router.py │ ├── exec.vpp │ └── startup.conf │ └── 19.08 │ ├── Dockerfile │ ├── disable_seg6_router.py │ ├── enable_seg6_router.py │ ├── exec.vpp │ └── startup.conf ├── LICENSE ├── README.md ├── bin ├── main.py ├── tn └── tn.org ├── docs ├── QUICKSTART.md ├── segment_routing │ ├── README.md │ ├── draft-clad-spring-segment-routing-service-chaining-00.md │ ├── draft-filsfils-spring-srv6-network-programming-06.md │ ├── draft-ietf-6man-segment-routing-header-15.md │ ├── draft-ietf-spring-segment-routing-mpls-18.md │ ├── draft-ietf-spring-segment-routing-policy-02.md │ ├── draft-xuclad-spring-sr-service-programming-01.md │ ├── rfc8402.md │ └── rfc_txt2md.sh ├── specification_cli.md └── specification_yml.md ├── examples ├── WIP_shownet2018 │ ├── setup2.sh │ └── spec2.yaml ├── basic_bfd │ ├── spec.yaml │ └── topo.jpeg ├── basic_bgp │ ├── README.md │ ├── hv_bgp_dcn │ │ ├── README.md │ │ ├── spec.yaml │ │ └── topo.png │ ├── hv_bgp_dcn_isol │ │ ├── Makefile │ │ ├── README.md │ │ ├── spec.yaml │ │ └── topo.png │ ├── path_attr │ │ ├── README.md │ │ ├── spec.yaml │ │ └── topo.png │ ├── spec.yaml │ ├── unnumbered │ │ ├── r1.pcap │ │ └── spec.yaml │ └── vrf2vrf_rouet_leak │ │ ├── Makefile │ │ └── spec.yaml ├── basic_bgp_mpls_vpnv4 │ ├── README.md │ ├── r1.pcap │ ├── r2.pcap │ ├── spec.yaml │ └── topo.png ├── basic_bgp_srv6_vpnv4 │ ├── Makefile │ ├── README.md │ ├── frr.conf.srv6.R1 │ ├── frr.conf.srv6.R2 │ ├── spec.yaml │ └── topo.png ├── basic_bgp_unumbered │ └── spec.yaml ├── basic_bond │ └── spec.yaml ├── basic_clos │ ├── README.md │ ├── spec.v0.0.0.yaml │ ├── spec.v0.0.1.yaml │ ├── spec.v0.0.2.yaml │ ├── spec.v0.0.3.yaml │ ├── spec.yaml │ ├── topo.png │ ├── topo.v0.0.0.png │ ├── topo.v0.0.1.png │ ├── topo.v0.0.2.png │ └── topo.v0.0.3.png ├── basic_conntrack │ └── connection_sync │ │ ├── Makefile │ │ ├── README.md │ │ └── spec.yaml ├── basic_coredns │ └── blacklist │ │ ├── Corefile.NS1 │ │ ├── README.md │ │ ├── spec.yaml │ │ └── topo.png ├── basic_ebgp │ └── spec.yaml ├── basic_ecmp │ ├── README.md │ ├── scale.diff │ ├── spec.yaml │ └── topo.jpeg ├── basic_evpn │ ├── README.md │ ├── spec.yaml │ └── topo.png ├── basic_exabgp │ ├── Makefile │ ├── README.md │ ├── daemons.R1 │ ├── exabgp.conf │ ├── exabgp.conf.R2 │ ├── frr.conf.R1 │ └── spec.yaml ├── basic_fullroute │ ├── gobgpd.conf │ └── spec.yaml ├── basic_gre │ ├── README.md │ ├── spec.yaml │ └── topo.jpeg ├── basic_haproxy │ ├── README.md │ ├── spec.yaml │ └── topo.png ├── basic_ibgp_rr │ └── spec.yaml ├── basic_ipip │ ├── anycast_tunnel │ │ └── spec.yaml │ └── simple │ │ ├── README.md │ │ ├── spec.yaml │ │ └── topo.png ├── basic_iptables │ ├── napt │ │ ├── README.md │ │ └── spec.yaml │ └── test │ │ ├── README.md │ │ └── spec.yaml ├── basic_isis │ ├── README.md │ ├── spec.yaml │ └── topo.png ├── basic_ldp │ ├── README.md │ └── spec.yaml ├── basic_mpls │ └── spec.yaml ├── basic_namespace │ ├── README.md │ ├── spec.blue.yaml │ ├── spec.green.yaml │ └── topo.png ├── basic_napt │ └── spec.yaml ├── basic_netns │ └── spec.yaml ├── basic_nftables │ ├── masquerade │ │ ├── README.md │ │ └── spec.yaml │ └── snat │ │ ├── README.md │ │ └── spec.yaml ├── basic_ospfv2_bird │ ├── README.md │ ├── bird │ │ ├── R1_bird.conf │ │ ├── R2_bird.conf │ │ ├── R3_bird.conf │ │ └── R4_bird.conf │ ├── spec.yaml │ └── topo.png ├── basic_ospfv2_frr │ ├── README.md │ ├── spec.yaml │ └── topo.png ├── basic_ospfv3_bird_multiple_instance │ ├── R3_bird6.conf │ ├── README.md │ ├── spec.yaml │ └── topo.png ├── basic_ospfv3_frr │ ├── README.md │ ├── spec.yaml │ └── topo.png ├── basic_peer │ └── spec.yaml ├── basic_pim │ ├── README.md │ └── spec.yaml ├── basic_pim2 │ ├── README.md │ ├── spec.yaml │ └── topo.jpeg ├── basic_pppoe_WIP │ └── spec.yaml ├── basic_rift │ ├── README.md │ ├── ietf_rift_python │ │ ├── meta_topology_2c_2x2.yaml │ │ ├── rift_leaf1.yaml │ │ ├── rift_leaf2.yaml │ │ ├── rift_spine1.yaml │ │ └── rift_spine2.yaml │ ├── spec.yaml │ └── topo.png ├── basic_rtbh │ ├── README.md │ ├── spec.yaml │ └── topo.png ├── basic_source_routing │ ├── README.md │ ├── spec.yaml │ └── topo.jpeg ├── basic_srmpls │ ├── spec.yaml │ └── topo.jpeg ├── basic_srv6 │ ├── README.md │ ├── linux │ │ ├── binding_sid │ │ │ ├── README.md │ │ │ ├── spec.yaml │ │ │ └── topo.jpeg │ │ ├── end_bpf_WIP │ │ │ ├── Makefile │ │ │ ├── bpf_helpers.h │ │ │ ├── filter.c │ │ │ └── spec.yaml │ │ ├── hands_on │ │ │ ├── README.md │ │ │ ├── img.png │ │ │ └── spec.yaml │ │ ├── l2vpn │ │ │ ├── README.md │ │ │ ├── spec.yaml │ │ │ └── topo.jpeg │ │ ├── sfc │ │ │ ├── README.md │ │ │ ├── spec.yaml │ │ │ └── topo.jpeg │ │ ├── srv6_unaware │ │ │ ├── README.md │ │ │ ├── function │ │ │ │ ├── Makefile │ │ │ │ └── main.cc │ │ │ ├── function1 │ │ │ │ ├── Makefile │ │ │ │ ├── edenman_chikuwa.cc │ │ │ │ ├── main.cc │ │ │ │ └── ntt_ipa.cc │ │ │ └── spec.yaml │ │ ├── transit │ │ │ ├── README.md │ │ │ ├── spec.yaml │ │ │ └── topo.jpeg │ │ ├── vpn_v4_per_ce │ │ │ ├── README.md │ │ │ ├── spec.yaml │ │ │ └── topo.jpeg │ │ ├── vpn_v4_per_vrf │ │ │ ├── README.md │ │ │ ├── spec.yaml │ │ │ └── topo.jpeg │ │ ├── vpn_v6_per_ce │ │ │ ├── README.md │ │ │ ├── spec.yaml │ │ │ └── topo.jpeg │ │ ├── vpn_v6_per_vrf │ │ │ ├── README.md │ │ │ ├── spec.yaml │ │ │ └── topo.jpeg │ │ └── vrf_redirect │ │ │ ├── README.md │ │ │ ├── spec.yaml │ │ │ └── topo.jpeg │ └── vpp │ │ └── vpn4_per_ce │ │ ├── README.md │ │ ├── spec.yaml │ │ └── topo.png ├── basic_tc │ └── spec.yaml ├── basic_vpnv4 │ ├── README.md │ ├── spec.yaml │ └── topo.png ├── basic_vpp │ ├── README.md │ ├── nat.yaml │ ├── spec.yaml │ └── topo.png ├── basic_vrf │ ├── README.md │ ├── frr.spec.yaml │ ├── iproute2.spec.yaml │ └── topo.png ├── basic_vrrp │ ├── conntrack │ │ ├── keepalived.conf.R1 │ │ ├── keepalived.conf.R2 │ │ └── spec.yaml │ └── simple │ │ └── spec.yaml ├── basic_vxlan │ ├── vxlan_mcast.yaml │ └── vxlan_ucast.yaml ├── basic_xdp │ ├── Dockerfile │ ├── Makefile │ ├── filter.c │ └── spec.yaml ├── bgp_test │ ├── dut.conf │ └── spec.yaml ├── bgp_test2 │ └── spec.yaml ├── flowspec │ └── spec.yaml ├── ovs_port_vlan │ └── spec.yaml └── vrouter_test3 │ └── README.md ├── projects ├── frr_dev │ ├── Makefile │ ├── README.md │ ├── frr.conf.R1 │ ├── frr.conf.R2 │ ├── frr.conf.mpls.R1 │ ├── frr.conf.mpls.R2 │ ├── frr.conf.srv6.R1 │ ├── frr.conf.srv6.R2 │ ├── spec.yaml │ └── topo.png ├── frr_dev_2node │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── frr.conf.R1 │ ├── frr.conf.R2 │ ├── spec.yaml │ └── topo.png ├── frr_dev_3node │ ├── .gitignore │ ├── Makefile │ ├── checkpatch │ │ ├── check.sh │ │ └── execute.sh │ ├── docker │ │ ├── Dockerfile │ │ ├── daemons │ │ ├── disable_seg6_router.py │ │ └── enable_seg6_router.py │ ├── frr.conf.CLOS │ ├── frr.conf.R1 │ ├── frr.conf.R2 │ └── spec.yaml ├── frr_dev_4node │ ├── .gitignore │ ├── Makefile │ ├── checkpatch │ │ ├── check.sh │ │ └── execute.sh │ ├── daemons.CLOS │ ├── docker │ │ ├── Dockerfile │ │ ├── daemons │ │ ├── disable_seg6_router.py │ │ └── enable_seg6_router.py │ ├── frr.conf.CLOS1 │ ├── frr.conf.CLOS2 │ ├── frr.conf.R1 │ ├── frr.conf.R2 │ └── spec.yaml ├── frr_hack_mplsvpn │ ├── Makefile │ ├── README.md │ ├── frr.conf.R1 │ ├── frr.conf.R2 │ ├── spec.yaml │ └── topo.png ├── ovr_testbed │ ├── README.md │ ├── spec.yaml │ ├── startup.conf │ └── startup.vpp ├── phys_connect │ ├── Makefile │ └── spec.yaml ├── sandbox │ └── spec.yaml ├── shownet │ ├── ospfv3_vrf │ │ ├── R3_bird6.conf │ │ ├── README.md │ │ ├── spec.yaml │ │ └── topo.png │ ├── shownet2019 │ │ ├── monitor_ospf_nei.sh │ │ └── spec.yaml │ ├── shownet2019_2 │ │ ├── H1_bird6.conf │ │ ├── Makefile │ │ ├── monitor_H1_ospf_nei.sh │ │ ├── neigh_flush.sh │ │ ├── proxy │ │ │ ├── bird6.conf │ │ │ ├── del.sh │ │ │ ├── monitor.sh │ │ │ └── rc.local.sh │ │ └── spec.yaml │ ├── shownet2019_3 │ │ ├── H1_bird6.conf │ │ ├── Makefile │ │ ├── monitor_H1_ospf_nei.sh │ │ └── spec.yaml │ ├── shownet2019_final │ │ ├── H1_bird6.conf │ │ ├── Makefile │ │ ├── monitor_H1_ospf_nei.sh │ │ ├── proxy │ │ │ ├── bird6.conf │ │ │ ├── del.sh │ │ │ ├── monitor.sh │ │ │ └── rc.local.sh │ │ └── spec.yaml │ ├── srv6_end_am │ │ └── spec.yaml │ ├── srv6_testbed_1if │ │ ├── README.md │ │ ├── capture │ │ │ ├── blu_R3_net0_ou_linux.pcap │ │ │ ├── blu_R3_net1_in_linux.pcap │ │ │ ├── grn_R3_net0_in_linux.pcap │ │ │ └── grn_R3_net1_ou_linux.pcap │ │ ├── function1 │ │ │ ├── Makefile │ │ │ └── main.cc │ │ ├── img │ │ │ ├── encoder.png │ │ │ ├── proxy.png │ │ │ └── topo.png │ │ └── spec.yaml │ ├── srv6_testbed_2if │ │ ├── README.md │ │ ├── img │ │ │ └── topo.png │ │ └── spec.yaml │ ├── srv6_testbed_old │ │ ├── README.md │ │ ├── debug_rx.tmux │ │ ├── debug_txrx.tmux │ │ ├── encode_demo.jpeg │ │ ├── spec.yaml │ │ └── topo.jpeg │ └── verif_multi_vrf_static_route │ │ └── spec.yaml ├── srv6_dx4_verif │ └── spec.yaml ├── srv6_pseudo_dt4 │ ├── README.md │ └── spec.yaml ├── verification │ ├── P5N │ │ └── spec.yaml │ ├── P5N_plus │ │ └── spec.yaml │ └── P5N_pp │ │ └── spec.yaml └── vrouter │ ├── ovr │ ├── develop │ │ └── spec.yaml │ └── integrated_test │ │ └── spec.yaml │ ├── router_test_portmirror │ ├── README.md │ └── spec.yaml │ ├── router_test_portmirror_mlx5 │ ├── README.md │ └── spec.yaml │ ├── vrouter_test │ ├── dut.conf │ └── spec.yaml │ ├── vrouter_test2 │ ├── dut.conf │ └── spec.yaml │ ├── vrouter_test3 │ ├── README.md │ ├── dut.yaml │ ├── spec.yaml │ └── start_frr.sh │ ├── vrouter_test4 │ ├── README.md │ ├── spec.yaml │ ├── sriov.yaml │ └── start_frr.sh │ ├── vrouter_test_portmirror │ ├── README.md │ └── spec.yaml │ └── vrouter_test_vrrp │ └── spec.yaml ├── requirement.txt ├── test ├── Makefile ├── spec.yaml └── test.sh └── tools ├── echo_server.py ├── http_server.py └── linkstat.py /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | vendor 3 | .DS_Store 4 | *.o 5 | *.out 6 | -------------------------------------------------------------------------------- /Dockerfiles/README.md: -------------------------------------------------------------------------------- 1 | # Dockerfiles -------------------------------------------------------------------------------- /Dockerfiles/bird/18.10/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | 3 | # FROM slankdev/ubuntu:18.10 4 | FROM slankdev/sandbox 5 | MAINTAINER Hiroki Shirokura 6 | 7 | # (base=slankdev/ubuntu18:10) Bird 8 | # RUN apt update && apt install -y bird 9 | WORKDIR /tmp/ 10 | RUN apt update && apt install -y libncurses-dev libreadline-dev wget \ 11 | && wget ftp://bird.network.cz/pub/bird/bird-1.6.6.tar.gz \ 12 | && tar xpf /tmp/bird-*.tar.gz && cd /tmp/bird* \ 13 | && ./configure --enable-ipv6=yes && make && make install 14 | -------------------------------------------------------------------------------- /Dockerfiles/centos/7/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM centos:centos7 3 | MAINTAINER Hiroki Shirokura 4 | 5 | RUN yum install git autoconf automake libtool make \ 6 | readline-devel texinfo net-snmp-devel groff pkgconfig \ 7 | json-c-devel pam-devel bison flex pytest c-ares-devel \ 8 | python-devel systemd-devel python-sphinx libcap-devel \ 9 | sudo iproute traceroute iputils bash-completion tcpdump \ 10 | wireshark gdb wget vim libunwind libunwind-devel \ 11 | iptables-services 12 | 13 | ADD https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-0.16.111-0.x86_64.rpm /tmp 14 | ADD https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-debuginfo-0.16.111-0.x86_64.rpm /tmp 15 | ADD https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-devel-0.16.111-0.x86_64.rpm /tmp 16 | ADD https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-10/CentOS-7-x86_64-Packages/libyang-0.16.111-0.src.rpm /tmp 17 | 18 | ADD ./enable_seg6_router.py /usr/bin/enable_seg6_router.py 19 | ADD ./disable_seg6_router.py /usr/bin/disable_seg6_router.py 20 | RUN chmod +x /usr/bin/enable_seg6_router.py 21 | RUN chmod +x /usr/bin/disable_seg6_router.py 22 | 23 | -------------------------------------------------------------------------------- /Dockerfiles/centos/7/disable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=0') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=0') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=0'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/centos/7/enable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=1') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=1') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=1'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/conntrack/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM slankdev/frr:centos-7-stable-7.0 3 | MAINTAINER Hiroki Shirokura 4 | 5 | RUN yum install -y conntrack-tools keepalived nc iptstate nftables 6 | 7 | ADD https://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/iproute2-5.4.0.tar.gz /tmp/iproute2-5.4.0.tar.gz 8 | RUN cd /tmp && tar xpf iproute2-5.4.0.tar.gz && cd iproute2-5.4.0 && ./configure && make -j8 && make install 9 | -------------------------------------------------------------------------------- /Dockerfiles/conntrack/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | docker build -t slankdev/conntrack:centos-7 . 3 | -------------------------------------------------------------------------------- /Dockerfiles/coredns/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM slankdev/frr:centos-7-stable-7.0 3 | MAINTAINER Hiroki Shirokura 4 | 5 | ADD https://github.com/coredns/coredns/releases/download/v1.6.6/coredns_1.6.6_linux_amd64.tgz /tmp 6 | RUN yum -y install bind-utils \ 7 | && cd /tmp && tar xpf coredns_1.6.6_linux_amd64.tgz && mv coredns /usr/bin/coredns \ 8 | && bash -c 'echo -e ".:53 {\n errors\n log\n forward . 8.8.8.8\n}" > /Corefile' 9 | -------------------------------------------------------------------------------- /Dockerfiles/coredns/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | docker build -t slankdev/coredns:centos-7 . 3 | -------------------------------------------------------------------------------- /Dockerfiles/cuishark/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM slankdev/docker-ubuntu 3 | MAINTAINER Hiroki Shirokura 4 | 5 | # (base=slankdev/ubuntu:16.04) install libcuishark 6 | RUN git clone http://github.com/cuishark/libcuishark $HOME/libcuishark \ 7 | && cd $HOME/libcuishark && ./bootstrap.sh && make && make install 8 | 9 | # install cuishark 10 | RUN go get github.com/cuishark/cuishark \ 11 | && cd $GOPATH/src/github.com/cuishark/cuishark/cgocuishark && go install \ 12 | && cd $GOPATH/src/github.com/cuishark/cuishark/cuishark && go install \ 13 | && cp $GOPATH/bin/cuishark /usr/local/bin 14 | 15 | 16 | -------------------------------------------------------------------------------- /Dockerfiles/dpdk/16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | 3 | FROM slankdev/ubuntu:16.04 4 | MAINTAINER Hiroki Shirokura 5 | 6 | RUN apt update \ 7 | && apt install -y libnuma-dev numactl linux-headers-`uname -r` 8 | 9 | WORKDIR /usr/local/src/git 10 | RUN git clone git://dpdk.org/dpdk dpdk.master \ 11 | && cp -rf dpdk.master dpdk.v16.11 \ 12 | && cp -rf dpdk.master dpdk.v17.11 \ 13 | && cp -rf dpdk.master dpdk.v18.11 14 | 15 | WORKDIR /usr/local/src/http 16 | ADD https://fast.dpdk.org/rel/dpdk-16.11.8.tar.xz dpdk-16.11.8.tar.xz 17 | ADD https://fast.dpdk.org/rel/dpdk-17.11.4.tar.xz dpdk-17.11.4.tar.xz 18 | ADD https://fast.dpdk.org/rel/dpdk-18.11.tar.xz dpdk-18.11.tar.xz 19 | RUN tar xpf dpdk-16.11.8.tar.xz \ 20 | && tar xpf dpdk-17.11.4.tar.xz \ 21 | && tar xpf dpdk-18.11.tar.xz 22 | 23 | WORKDIR /usr/local/src/git/dpdk.v16.11 24 | RUN git checkout -b v16.11 refs/tags/v16.11 \ 25 | && export RTE_SDK=`pwd` \ 26 | && export RTE_TARGET=x86_64-native-linuxapp-gcc \ 27 | && make install T=$RTE_TARGET -j`nproc` 28 | 29 | WORKDIR /usr/local/src/git/dpdk.v17.11 30 | RUN git checkout -b v17.11 refs/tags/v17.11 \ 31 | && export RTE_SDK=`pwd` \ 32 | && export RTE_TARGET=x86_64-native-linuxapp-gcc \ 33 | && make install T=$RTE_TARGET -j`nproc` 34 | 35 | WORKDIR /usr/local/src/git/dpdk.v18.11 36 | RUN git checkout -b v18.11 refs/tags/v18.11 \ 37 | && export RTE_SDK=`pwd` \ 38 | && export RTE_TARGET=x86_64-native-linuxapp-gcc \ 39 | && make install T=$RTE_TARGET -j`nproc` 40 | 41 | WORKDIR /usr/local/src/http/dpdk-stable-16.11.8 42 | RUN export RTE_SDK=`pwd` \ 43 | && export RTE_TARGET=x86_64-native-linuxapp-gcc \ 44 | && make install T=$RTE_TARGET -j`nproc` 45 | 46 | WORKDIR /usr/local/src/http/dpdk-stable-17.11.4 47 | RUN export RTE_SDK=`pwd` \ 48 | && export RTE_TARGET=x86_64-native-linuxapp-gcc \ 49 | && make install T=$RTE_TARGET -j`nproc` 50 | 51 | WORKDIR /usr/local/src/http/dpdk-18.11 52 | RUN export RTE_SDK=`pwd` \ 53 | && export RTE_TARGET=x86_64-native-linuxapp-gcc \ 54 | && make install T=$RTE_TARGET -j`nproc` 55 | 56 | 57 | -------------------------------------------------------------------------------- /Dockerfiles/dpdk/app/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM slankdev/dpdk 3 | MAINTAINER Hiroki Shirokura 4 | 5 | # move to slankdev/dpdk 6 | RUN apt update && apt install -y \ 7 | build-essential libnss-extrausers \ 8 | vim python xz-utils \ 9 | sysstat screen git ntp ntpdate tig bwm-ng tmux \ 10 | silversearcher-ag libnuma-dev automake 11 | 12 | # move to slankdev/dpdk 13 | WORKDIR /tmp 14 | ADD http://www.lttng.org/files/urcu/userspace-rcu-0.9.3.tar.bz2 userspace-rcu.tar.bz2 15 | RUN tar xpf userspace-rcu.tar.bz2 && cd userspace-rcu-0.9.3 \ 16 | && ./configure && make -j`nproc` && make install -j`nproc` 17 | 18 | # ENV REPO ???? 19 | ENV REPO https://github.com/slankdev/xellico 20 | 21 | ENV COMMIT master 22 | WORKDIR /root/workspace 23 | COPY ./entrypoint.sh / 24 | # CMD /entrypoint.sh 25 | CMD bash 26 | 27 | -------------------------------------------------------------------------------- /Dockerfiles/dpdk/app/README: -------------------------------------------------------------------------------- 1 | 2 | Docker runだけでやりたい. 3 | -------------------------------------------------------------------------------- /Dockerfiles/dpdk/app/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ue 3 | echo repo=$REPO commit=$COMMIT 4 | mkdir -p /root/workspace 5 | git clone $REPO /root/workspace/repo 6 | cd /root/workspace/repo 7 | 8 | git checkout -b WIP-interface-tapmirror origin/WIP-interface-tapmirror 9 | ./autogen.sh 10 | 11 | export RTE_TARGET=x86_64-native-linuxapp-gcc 12 | 13 | # export RTE_SDK=/usr/local/src/git/dpdk.v16.11 14 | # ./configure && make clean && make 15 | 16 | export RTE_SDK=/usr/local/src/git/dpdk.v17.11 17 | ./configure && make clean && make 18 | 19 | export RTE_SDK=/usr/local/src/git/dpdk.v18.11 20 | ./configure && make clean && make 21 | 22 | # export RTE_SDK=/usr/local/src/http/dpdk-stable-16.11.8 23 | # ./configure && make clean && make 24 | 25 | export RTE_SDK=/usr/local/src/http/dpdk-stable-17.11.4 26 | ./configure && make clean && make 27 | 28 | # export RTE_SDK=/usr/local/src/http/dpdk-stable-18.11 29 | # ./configure && make clean && make 30 | 31 | -------------------------------------------------------------------------------- /Dockerfiles/etcd/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM slankdev/frr:centos-7-stable-7.0 3 | MAINTAINER Hiroki Shirokura 4 | 5 | ENV GOOGLE_URL https://storage.googleapis.com/etcd 6 | ENV GITHUB_URL https://github.com/coreos/etcd/releases/download 7 | ENV DOWNLOAD_URL ${GOOGLE_URL} 8 | ENV ETCD_VER v3.2.21 9 | ENV ETCDCTL_API 3 10 | 11 | ADD ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz /tmp 12 | RUN cd /tmp && tar xpf etcd-${ETCD_VER}-linux-amd64.tar.gz \ 13 | && cp /tmp/etcd-${ETCD_VER}-linux-amd64/etcd /usr/bin \ 14 | && cp /tmp/etcd-${ETCD_VER}-linux-amd64/etcdctl /usr/bin \ 15 | -------------------------------------------------------------------------------- /Dockerfiles/etcd/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | docker build -t slankdev/etcd:centos-7 . 3 | -------------------------------------------------------------------------------- /Dockerfiles/fedora/31/disable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=0') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=0') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=0'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/fedora/31/enable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=1') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=1') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=1'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/frr/18.04/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | 3 | FROM slankdev/ubuntu:18.04 4 | MAINTAINER Hiroki Shirokura 5 | 6 | # (base=slankdev/ubuntu18:04) basic package install 7 | ADD https://github.com/FRRouting/frr/releases/download/frr-6.0/frr_6.0-1.ubuntu18.04+1_amd64.deb /frr.deb 8 | RUN apt update \ 9 | && apt install -y iproute2 libatm1 libc-ares2 \ 10 | libelf1 libmnl0 libpopt0 libxtables12 logrotate \ 11 | libjson-c3 libreadline7 \ 12 | && dpkg -i /frr.deb \ 13 | && sed -i -e 's/=no/=yes/g' /etc/frr/daemons 14 | 15 | # (Add util) 16 | ADD ./enable_seg6_router.py /usr/bin/enable_seg6_router.py 17 | ADD ./disable_seg6_router.py /usr/bin/disable_seg6_router.py 18 | RUN chmod +x /usr/bin/enable_seg6_router.py 19 | RUN chmod +x /usr/bin/disable_seg6_router.py 20 | -------------------------------------------------------------------------------- /Dockerfiles/frr/18.04/disable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=0') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=0') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=0'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/frr/18.04/enable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=1') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=1') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=1'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/frr/centos-7/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | docker build -t slankdev/frr:centos-7-stable-7.0 . 3 | -------------------------------------------------------------------------------- /Dockerfiles/frr/centos-7/disable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=0') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=0') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=0'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/frr/centos-7/enable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=1') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=1') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=1'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/frr/cumulus/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM cumulusnetworks/frrouting:latest 3 | MAINTAINER Hiroki Shirokura 4 | 5 | # (base=ubuntu16:04) basic package install 6 | RUN apt update \ 7 | && apt install -y iputils-ping traceroute sudo \ 8 | vim git tmux silversearcher-ag bash-completion \ 9 | netcat-openbsd telnet iperf tcpdump openvswitch-switch \ 10 | bison flex ipvsadm keepalived python-scapy \ 11 | && echo "" > ~/.bashrc \ 12 | && echo "if [ -f /etc/bash_completion ] && ! shopt -oq posix; then" >> ~/.bashrc \ 13 | && echo " . /etc/bash_completion" >> ~/.bashrc \ 14 | && echo "fi" >> ~/.bashrc 15 | 16 | # (base=ubuntu16:04) install tcpdump 17 | RUN apt update && apt -y install tcpdump \ 18 | && mv /usr/sbin/tcpdump /usr/bin/tcpdump 19 | 20 | # (base=ubuntu16:04) golang-1.10 install 21 | RUN apt update \ 22 | && apt install -y apt-file software-properties-common \ 23 | && add-apt-repository -y ppa:gophers/archive \ 24 | && apt update && apt install -y golang-1.10-go \ 25 | && echo "export GOPATH=\$HOME/go" >> ~/.bashrc \ 26 | && echo "export PATH=\$PATH:/usr/lib/go-1.10/bin" >> ~/.bashrc \ 27 | && echo "export PATH=\$PATH:\$GOPATH/bin" >> ~/.bashrc 28 | 29 | # (base=golang-1.10) openconfigd & frrd install 30 | RUN apt update && apt install -y automake \ 31 | && export PATH=$PATH:/usr/lib/go-1.10/bin \ 32 | && export GOPATH=$HOME/go \ 33 | && go get -v github.com/coreswitch/openconfigd/openconfigd \ 34 | && cd $GOPATH/src/github.com/coreswitch/openconfigd/openconfigd \ 35 | && git checkout -b v0.8.1 refs/tags/v0.8.1 && go install \ 36 | && go get -v github.com/coreswitch/openconfigd/cli_command \ 37 | && cd $GOPATH/src/github.com/coreswitch/openconfigd/cli \ 38 | && ./configure && make && sudo make install \ 39 | && cd $GOPATH/src/github.com/coreswitch/openconfigd/ \ 40 | && cp bash_completion.d/cli /etc/bash_completion.d/ \ 41 | && go get -v github.com/slankdev/frr/frrd 42 | 43 | RUN git clone git://git.kernel.org/pub/scm/network/iproute2/iproute2.git \ 44 | && cd iproute2 && ./configure && make && make install 45 | 46 | -------------------------------------------------------------------------------- /Dockerfiles/gobgp/18.04/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM slankdev/ubuntu:18.04 3 | MAINTAINER Hiroki Shirokura 4 | 5 | # (base=slankdev/ubuntu18:04) basic package install 6 | ADD https://raw.githubusercontent.com/osrg/gobgp/master/tools/completion/gobgp-static-completion.bash /etc/bash_completion.d/ 7 | ADD https://raw.githubusercontent.com/osrg/gobgp/master/tools/completion/gobgp-dynamic-completion.bash /etc/bash_completion.d/ 8 | ADD https://raw.githubusercontent.com/osrg/gobgp/master/tools/completion/gobgp-completion.bash /etc/bash_completion.d/ 9 | ADD https://github.com/osrg/gobgp/releases/download/v2.6.0/gobgp_2.6.0_linux_amd64.tar.gz /gobgp.tgz 10 | RUN tar xpf /gobgp.tgz \ 11 | && mv gobgp gobgpd /usr/bin 12 | 13 | # (Add util) 14 | ADD ./enable_seg6_router.py /usr/bin/enable_seg6_router.py 15 | ADD ./disable_seg6_router.py /usr/bin/disable_seg6_router.py 16 | RUN chmod +x /usr/bin/enable_seg6_router.py 17 | RUN chmod +x /usr/bin/disable_seg6_router.py 18 | 19 | -------------------------------------------------------------------------------- /Dockerfiles/gobgp/18.04/disable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=0') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=0') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=0'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/gobgp/18.04/enable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=1') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=1') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=1'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/ovs/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM slankdev/ubuntu:18.04 3 | MAINTAINER Hiroki Shirokura 4 | 5 | # (base=slankdev/ubuntu18:04) ovs preparation 6 | CMD \ 7 | mkdir -p /etc/openvswitch && \ 8 | mkdir -p /var/run/openvswitch && \ 9 | ovsdb-tool create \ 10 | /etc/openvswitch/conf.db \ 11 | /usr/share/openvswitch/vswitch.ovsschema && \ 12 | ovsdb-server \ 13 | --remote=punix:/var/run/openvswitch/db.sock \ 14 | --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ 15 | --pidfile --detach && \ 16 | ovs-vsctl --no-wait init && \ 17 | ovs-vswitchd unix:/var/run/openvswitch/db.sock --pidfile 18 | -------------------------------------------------------------------------------- /Dockerfiles/rift/ietf-rift-03/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM slankdev/ubuntu:18.04-tmp 3 | MAINTAINER Hiroki Shirokura 4 | WORKDIR /root 5 | SHELL ["/bin/bash", "-c"] 6 | 7 | # (base=slankdev/ubuntu18:04) basic package install 8 | RUN apt update && apt install -y python3 virtualenv \ 9 | && git clone https://github.com/brunorijsman/rift-python \ 10 | && cd rift-python && git checkout -b 4b84c137467 4b84c137467 \ 11 | && virtualenv env --python=python3 && source env/bin/activate \ 12 | && pip install -r requirements.txt \ 13 | && sh -c 'echo source $HOME/rift-python/env/bin/activate >> $HOME/.bashrc' 14 | 15 | -------------------------------------------------------------------------------- /Dockerfiles/tmp/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM slankdev/frr 3 | 4 | # RUN sh -c 'echo nameserver 103.2.130.6 > /etc/resolv.conf' \ 5 | # && apt update && apt install -y pppoeconf pppoe \ 6 | # && sh -c 'echo nameserver 8.8.8.8 > /etc/resolv.conf' 7 | # RUN echo slank 8 | 9 | -------------------------------------------------------------------------------- /Dockerfiles/topotest/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | docker build -t slankdev/topotest . 3 | -------------------------------------------------------------------------------- /Dockerfiles/topotest/docker-start: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /etc/openvswitch 4 | mkdir -p /var/run/openvswitch 5 | 6 | ovsdb-tool create \ 7 | /etc/openvswitch/conf.db \ 8 | /usr/share/openvswitch/vswitch.ovsschema && \ 9 | 10 | ovsdb-server \ 11 | --remote=punix:/var/run/openvswitch/db.sock \ 12 | --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ 13 | --pidfile --detach 14 | 15 | ovs-vsctl --no-wait init 16 | ovs-vswitchd unix:/var/run/openvswitch/db.sock --pidfile --detach 17 | 18 | #sleep forever 19 | # exec tail -f /dev/null 20 | bash 21 | -------------------------------------------------------------------------------- /Dockerfiles/ubuntu/16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM ubuntu:16.04 3 | MAINTAINER Hiroki Shirokura 4 | 5 | # (base=ubuntu16:04) basic package install 6 | RUN apt update \ 7 | && apt install -y iputils-ping traceroute sudo \ 8 | vim git tmux silversearcher-ag bash-completion \ 9 | netcat-openbsd telnet iperf tcpdump openvswitch-switch \ 10 | bison flex mtr python-scapy curl pppoe pppoeconf lldpd \ 11 | && echo "" > ~/.bashrc \ 12 | && echo "if [ -f /etc/bash_completion ] && ! shopt -oq posix; then" >> ~/.bashrc \ 13 | && echo " . /etc/bash_completion" >> ~/.bashrc \ 14 | && echo "fi" >> ~/.bashrc 15 | 16 | # (base=ubuntu16:04) install tcpdump 17 | RUN apt update && apt -y install tcpdump \ 18 | && mv /usr/sbin/tcpdump /usr/bin/tcpdump 19 | 20 | # (base=ubuntu16:04) golang-1.10 install 21 | RUN apt update \ 22 | && apt install -y apt-file software-properties-common \ 23 | && add-apt-repository -y ppa:gophers/archive \ 24 | && apt update && apt install -y golang-1.10-go \ 25 | && echo "export GOPATH=\$HOME/go" >> ~/.bashrc \ 26 | && echo "export PATH=\$PATH:/usr/lib/go-1.10/bin" >> ~/.bashrc \ 27 | && echo "export PATH=\$PATH:\$GOPATH/bin" >> ~/.bashrc 28 | 29 | -------------------------------------------------------------------------------- /Dockerfiles/ubuntu/18.04/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM ubuntu:18.04 3 | MAINTAINER Hiroki Shirokura 4 | 5 | # (base=ubuntu18:04) basic package install 6 | RUN apt update \ 7 | && apt install -y iputils-ping traceroute sudo \ 8 | vim git tmux silversearcher-ag bash-completion \ 9 | netcat-openbsd telnet iperf tcpdump openvswitch-switch \ 10 | bison flex iproute2 mtr python-scapy curl pppoe pppoeconf lldpd \ 11 | iptables ethtool \ 12 | && echo "" > ~/.bashrc \ 13 | && echo "if [ -f /etc/bash_completion ] && ! shopt -oq posix; then" >> ~/.bashrc \ 14 | && echo " . /etc/bash_completion" >> ~/.bashrc \ 15 | && echo "fi" >> ~/.bashrc 16 | 17 | # (base=ubuntu18:04) install tcpdump 18 | RUN apt update && apt -y install tcpdump \ 19 | && mv /usr/sbin/tcpdump /usr/bin/tcpdump 20 | 21 | # (base=ubuntu18:04) golang-1.10 install 22 | RUN apt update \ 23 | && apt install -y apt-file software-properties-common \ 24 | && add-apt-repository -y ppa:gophers/archive \ 25 | && apt update && apt install -y golang-1.10-go \ 26 | && echo "export GOPATH=\$HOME/go" >> ~/.bashrc \ 27 | && echo "export PATH=\$PATH:/usr/lib/go-1.10/bin" >> ~/.bashrc \ 28 | && echo "export PATH=\$PATH:\$GOPATH/bin" >> ~/.bashrc 29 | 30 | # (Add util) 31 | ADD ./enable_seg6_router.py /usr/bin/enable_seg6_router.py 32 | ADD ./disable_seg6_router.py /usr/bin/disable_seg6_router.py 33 | RUN chmod +x /usr/bin/enable_seg6_router.py 34 | RUN chmod +x /usr/bin/disable_seg6_router.py 35 | -------------------------------------------------------------------------------- /Dockerfiles/ubuntu/18.04/disable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=0') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=0') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=0'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/ubuntu/18.04/enable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=1') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=1') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=1'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/ubuntu/18.10/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM ubuntu:18.10 3 | MAINTAINER Hiroki Shirokura 4 | 5 | # (base=ubuntu18:04) basic package install 6 | RUN apt update \ 7 | && apt install -y iputils-ping traceroute sudo \ 8 | vim git tmux silversearcher-ag bash-completion \ 9 | netcat-openbsd telnet iperf tcpdump openvswitch-switch \ 10 | bison flex iproute2 mtr python-scapy curl pppoe pppoeconf lldpd \ 11 | && echo "" > ~/.bashrc \ 12 | && echo "if [ -f /etc/bash_completion ] && ! shopt -oq posix; then" >> ~/.bashrc \ 13 | && echo " . /etc/bash_completion" >> ~/.bashrc \ 14 | && echo "fi" >> ~/.bashrc 15 | 16 | # (base=ubuntu18:04) install tcpdump 17 | RUN apt update && apt -y install tcpdump \ 18 | && mv /usr/sbin/tcpdump /usr/bin/tcpdump 19 | 20 | # (base=ubuntu18:04) golang-1.10 install 21 | RUN apt update \ 22 | && apt install -y apt-file software-properties-common \ 23 | && add-apt-repository -y ppa:gophers/archive \ 24 | && apt update && apt install -y golang-1.10-go \ 25 | && echo "export GOPATH=\$HOME/go" >> ~/.bashrc \ 26 | && echo "export PATH=\$PATH:/usr/lib/go-1.10/bin" >> ~/.bashrc \ 27 | && echo "export PATH=\$PATH:\$GOPATH/bin" >> ~/.bashrc 28 | 29 | # (Add util) 30 | ADD ./enable_seg6_router.py /usr/bin/enable_seg6_router.py 31 | ADD ./disable_seg6_router.py /usr/bin/disable_seg6_router.py 32 | RUN chmod +x /usr/bin/enable_seg6_router.py 33 | RUN chmod +x /usr/bin/disable_seg6_router.py 34 | -------------------------------------------------------------------------------- /Dockerfiles/ubuntu/18.10/disable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=0') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=0') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=0'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/ubuntu/18.10/enable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=1') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=1') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=1'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/vpp/19.04/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM slankdev/ubuntu:18.04-tmp 3 | MAINTAINER Hiroki Shirokura 4 | 5 | # (Add util) 6 | ADD ./enable_seg6_router.py /usr/bin/enable_seg6_router.py 7 | ADD ./disable_seg6_router.py /usr/bin/disable_seg6_router.py 8 | RUN chmod +x /usr/bin/enable_seg6_router.py 9 | RUN chmod +x /usr/bin/disable_seg6_router.py 10 | 11 | # (base=slankdev/ubuntu18:04) basic package install 12 | RUN sh -c "curl -s https://packagecloud.io/install/repositories/fdio/1904/script.deb.sh | sudo bash" \ 13 | && apt install -y vpp 14 | ADD ./startup.conf /etc/vpp/startup.conf 15 | ADD ./exec.vpp /etc/vpp/exec.vpp 16 | -------------------------------------------------------------------------------- /Dockerfiles/vpp/19.04/disable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=0') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=0') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=0'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/vpp/19.04/enable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=1') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=1') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=1'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/vpp/19.04/exec.vpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/Dockerfiles/vpp/19.04/exec.vpp -------------------------------------------------------------------------------- /Dockerfiles/vpp/19.04/startup.conf: -------------------------------------------------------------------------------- 1 | unix { 2 | nodaemon 3 | cli-listen /run/vpp/cli.sock 4 | exec /etc/vpp/exec.vpp 5 | gid vpp 6 | } 7 | 8 | api-segment { 9 | gid vpp 10 | } 11 | -------------------------------------------------------------------------------- /Dockerfiles/vpp/19.08/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM slankdev/ubuntu:18.04-tmp 3 | MAINTAINER Hiroki Shirokura 4 | 5 | # (Add util) 6 | ADD ./enable_seg6_router.py /usr/bin/enable_seg6_router.py 7 | ADD ./disable_seg6_router.py /usr/bin/disable_seg6_router.py 8 | RUN chmod +x /usr/bin/enable_seg6_router.py 9 | RUN chmod +x /usr/bin/disable_seg6_router.py 10 | 11 | # (base=slankdev/ubuntu18:04) basic package install 12 | RUN sh -c "curl -s https://packagecloud.io/install/repositories/fdio/1904/script.deb.sh | sudo bash" \ 13 | && apt install -y vpp 14 | ADD ./startup.conf /etc/vpp/startup.conf 15 | ADD ./exec.vpp /etc/vpp/exec.vpp 16 | -------------------------------------------------------------------------------- /Dockerfiles/vpp/19.08/disable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=0') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=0') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=0'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/vpp/19.08/enable_seg6_router.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | print('#!/bin/sh') 5 | print('sysctl -w net.ipv6.conf.all.forwarding=1') 6 | print('sysctl -w net.ipv6.conf.all.disable_ipv6=0') 7 | print('sysctl -w net.ipv6.conf.all.seg6_enabled=1') 8 | print('sysctl -w net.ipv4.conf.all.rp_filter=0') 9 | print('sysctl -w net.ipv6.conf.default.forwarding=1') 10 | print('sysctl -w net.ipv6.conf.default.disable_ipv6=0') 11 | print('sysctl -w net.ipv6.conf.default.seg6_enabled=1') 12 | print('sysctl -w net.ipv4.conf.default.rp_filter=0') 13 | ifs = os.listdir(path='/sys/class/net') 14 | for iface in ifs: 15 | print('sysctl -w net.ipv6.conf.{}.disable_ipv6=0'.format(iface)) 16 | print('sysctl -w net.ipv6.conf.{}.seg6_enabled=1'.format(iface)) 17 | print('sysctl -w net.ipv4.conf.{}.rp_filter=0'.format(iface)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dockerfiles/vpp/19.08/exec.vpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/Dockerfiles/vpp/19.08/exec.vpp -------------------------------------------------------------------------------- /Dockerfiles/vpp/19.08/startup.conf: -------------------------------------------------------------------------------- 1 | unix { 2 | nodaemon 3 | cli-listen /run/vpp/cli.sock 4 | exec /etc/vpp/exec.vpp 5 | gid vpp 6 | } 7 | 8 | api-segment { 9 | gid vpp 10 | } 11 | -------------------------------------------------------------------------------- /docs/segment_routing/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Yonda 3 | 4 | - [ ] [Segment Routing Architecture](rfc8402.md) 5 | - [ ] [Segment Routing Policy](draft-ietf-spring-segment-routing-policy-02.md) 6 | - [ ] [Segment Routing MPLS](draft-ietf-spring-segment-routing-mpls-18.md) 7 | - [x] [Segment Routing Header](draft-ietf-6man-segment-routing-header-15.md) 8 | - [x] [SRv6 Network Programming](draft-filsfils-spring-srv6-network-programming-06.md) 9 | - [ ] [Segment Routing Service Chaining](draft-clad-spring-segment-routing-service-chaining-00.md) 10 | - [x] [SR Service Programming](draft-xuclad-spring-sr-service-programming-01.md) 11 | 12 | -------------------------------------------------------------------------------- /docs/segment_routing/rfc_txt2md.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ue 3 | 4 | FILE=draft-ietf-spring-segment-routing-policy-02.md 5 | FOOTER_REGEX="^Filsfils.*$" 6 | HEADER_REGEX="^Internet-Draft.*$" 7 | 8 | H2_REGEX="^[0-9]*\. " 9 | H3_REGEX="^[0-9]*\.[0-9]*\. " 10 | H4_REGEX="^[0-9]*\.[0-9]*\.[0-9]*\. " 11 | H5_REGEX="^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\. " 12 | H6_REGEX="^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\. " 13 | 14 | echo \[\+\] List the mached as-a Header and Footer 15 | echo \ \ \* header: match=`grep "$HEADER_REGEX" $FILE | wc -l`, regex=\"$HEADER_REGEX\" 16 | echo \ \ \* footer: match=`grep "$FOOTER_REGEX" $FILE | wc -l`, regex=\"$FOOTER_REGEX\" 17 | sed -i -e "s/\($HEADER_REGEX\)//g" $FILE 18 | sed -i -e "s/\($FOOTER_REGEX\)//g" $FILE 19 | 20 | echo \[\+\] List the mached as-a H2,H3,H4,H5,H6 21 | echo \ \ \* h2: match=`grep "$H2_REGEX" $FILE | wc -l`, regex=\"$H2_REGEX\" 22 | echo \ \ \* h3: match=`grep "$H3_REGEX" $FILE | wc -l`, regex=\"$H3_REGEX\" 23 | echo \ \ \* h4: match=`grep "$H4_REGEX" $FILE | wc -l`, regex=\"$H4_REGEX\" 24 | echo \ \ \* h5: match=`grep "$H5_REGEX" $FILE | wc -l`, regex=\"$H5_REGEX\" 25 | echo \ \ \* h6: match=`grep "$H6_REGEX" $FILE | wc -l`, regex=\"$H6_REGEX\" 26 | sed -i -e "s/\($H2_REGEX\)/## \1/g" $FILE 27 | sed -i -e "s/\($H3_REGEX\)/### \1/g" $FILE 28 | sed -i -e "s/\($H4_REGEX\)/#### \1/g" $FILE 29 | sed -i -e "s/\($H5_REGEX\)/##### \1/g" $FILE 30 | sed -i -e "s/\($H6_REGEX\)/###### \1/g" $FILE 31 | 32 | -------------------------------------------------------------------------------- /examples/basic_bfd/topo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_bfd/topo.jpeg -------------------------------------------------------------------------------- /examples/basic_bgp/README.md: -------------------------------------------------------------------------------- 1 | 2 | # BGP Playground 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/basic_bgp/hv_bgp_dcn/README.md: -------------------------------------------------------------------------------- 1 | 2 | # HV route advertisement study for BGP-DCN 3 | 4 | - [GOOD reference about routing-info manupulation by @ukinau](https://engineering.linecorp.com/ja/blog/openstack-summit-vancouver-2018-recap-2-2/) 5 | - [GOOD reference about proxy arp by @ukinau](https://qiita.com/ukinau/items/cb25588fb0c276a009dc) 6 | 7 | ![](topo.png) 8 | 9 | ``` 10 | docker exec TOR vtysh -c 'show bgp ipv4 unicast' 11 | BGP table version is 4, local router ID is 10.255.0.99, vrf id 0 12 | Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, 13 | i internal, r RIB-failure, S Stale, R Removed 14 | Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self 15 | Origin codes: i - IGP, e - EGP, ? - incomplete 16 | 17 | Network Next Hop Metric LocPrf Weight Path 18 | *> 1.1.1.1/32 0.0.0.0 0 32768 ? 19 | *> 10.0.0.11/32 dn1 0 0 65001 ? 20 | *> 10.0.0.12/32 dn1 0 0 65001 ? 21 | *> 10.0.0.13/32 dn1 0 0 65001 ? 22 | 23 | Displayed 4 routes and 4 total paths 24 | ``` 25 | 26 | -------------------------------------------------------------------------------- /examples/basic_bgp/hv_bgp_dcn/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_bgp/hv_bgp_dcn/topo.png -------------------------------------------------------------------------------- /examples/basic_bgp/hv_bgp_dcn_isol/Makefile: -------------------------------------------------------------------------------- 1 | 2 | sh: 3 | docker exec TOR vtysh -c 'show bgp ipv4 vpn' 4 | -------------------------------------------------------------------------------- /examples/basic_bgp/hv_bgp_dcn_isol/README.md: -------------------------------------------------------------------------------- 1 | 2 | # HV route advertisement study for BGP-DCN 3 | 4 | - [GOOD reference about routing-info manupulation by @ukinau](https://engineering.linecorp.com/ja/blog/openstack-summit-vancouver-2018-recap-2-2/) 5 | - [GOOD reference about proxy arp by @ukinau](https://qiita.com/ukinau/items/cb25588fb0c276a009dc) 6 | 7 | ![](topo.png) 8 | 9 | ``` 10 | docker exec TOR vtysh -c 'show bgp ipv4 unicast' 11 | BGP table version is 4, local router ID is 10.255.0.99, vrf id 0 12 | Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, 13 | i internal, r RIB-failure, S Stale, R Removed 14 | Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self 15 | Origin codes: i - IGP, e - EGP, ? - incomplete 16 | 17 | Network Next Hop Metric LocPrf Weight Path 18 | *> 1.1.1.1/32 0.0.0.0 0 32768 ? 19 | *> 10.0.0.11/32 dn1 0 0 65001 ? 20 | *> 10.0.0.12/32 dn1 0 0 65001 ? 21 | *> 10.0.0.13/32 dn1 0 0 65001 ? 22 | 23 | Displayed 4 routes and 4 total paths 24 | ``` 25 | 26 | -------------------------------------------------------------------------------- /examples/basic_bgp/hv_bgp_dcn_isol/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_bgp/hv_bgp_dcn_isol/topo.png -------------------------------------------------------------------------------- /examples/basic_bgp/path_attr/README.md: -------------------------------------------------------------------------------- 1 | 2 | # BGP route-map playground (import-prefix-filter) 3 | 4 | ![](topo.png) 5 | 6 | ``` 7 | docker exec R3 vtysh -c 'show bgp ipv4 unicast' 8 | BGP table version is 1, local router ID is 10.255.0.3, vrf id 0 9 | Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, 10 | i internal, r RIB-failure, S Stale, R Removed 11 | Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self 12 | Origin codes: i - IGP, e - EGP, ? - incomplete 13 | 14 | Network Next Hop Metric LocPrf Weight Path 15 | *> 10.0.0.2/32 net0 0 65001 65002 i 16 | 17 | Displayed 1 routes and 1 total paths 18 | ``` 19 | ``` 20 | docker exec R4 vtysh -c 'show bgp ipv4 unicast' 21 | BGP table version is 3, local router ID is 10.255.0.4, vrf id 0 22 | Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, 23 | i internal, r RIB-failure, S Stale, R Removed 24 | Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self 25 | Origin codes: i - IGP, e - EGP, ? - incomplete 26 | 27 | Network Next Hop Metric LocPrf Weight Path 28 | *> 10.0.0.1/32 net0 0 65001 65002 i 29 | *> 10.0.0.2/32 net0 0 65001 65002 i 30 | *> 10.0.0.3/32 net0 0 65001 65002 i 31 | 32 | Displayed 3 routes and 3 total paths 33 | ``` 34 | 35 | -------------------------------------------------------------------------------- /examples/basic_bgp/path_attr/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_bgp/path_attr/topo.png -------------------------------------------------------------------------------- /examples/basic_bgp/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | nodes: 3 | - name: R1 4 | image: slankdev/frr 5 | interfaces: 6 | - { name: net0, type: direct, args: R2#net0 } 7 | - name: R2 8 | image: slankdev/frr 9 | interfaces: 10 | - { name: net0, type: direct, args: R1#net0 } 11 | 12 | node_configs: 13 | - name: R1 14 | cmds: 15 | - cmd: /usr/lib/frr/frr start 16 | - cmd: ip addr add 10.0.0.1/24 dev net0 17 | - cmd: >- 18 | vtysh -c "conf t" 19 | -c "router bgp 65001" 20 | -c "bgp router-id 10.255.0.1" 21 | -c "neighbor 10.0.0.2 remote-as 65002" 22 | - name: R2 23 | cmds: 24 | - cmd: /usr/lib/frr/frr start 25 | - cmd: ip addr add 10.0.0.2/24 dev net0 26 | - cmd: >- 27 | vtysh -c "conf t" 28 | -c "router bgp 65002" 29 | -c "bgp router-id 10.255.0.2" 30 | -c "neighbor 10.0.0.1 remote-as 65001" 31 | 32 | -------------------------------------------------------------------------------- /examples/basic_bgp/unnumbered/r1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_bgp/unnumbered/r1.pcap -------------------------------------------------------------------------------- /examples/basic_bgp/vrf2vrf_rouet_leak/Makefile: -------------------------------------------------------------------------------- 1 | 2 | sh: 3 | docker exec R1 ip route list 4 | @echo 5 | docker exec R1 ip route list vrf red 6 | @echo 7 | docker exec R1 ip route list vrf blu 8 | @echo 9 | docker exec R1 ip route list vrf grn 10 | -------------------------------------------------------------------------------- /examples/basic_bgp/vrf2vrf_rouet_leak/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | nodes: 3 | - name: R1 4 | image: slankdev/frr-dev:latest 5 | interfaces: 6 | - { name: net0, type: direct, args: R2#net0 } 7 | - name: R2 8 | image: slankdev/frr-dev:latest 9 | interfaces: 10 | - { name: net0, type: direct, args: R1#net0 } 11 | 12 | 13 | node_configs: 14 | - name: R1 15 | cmds: 16 | - cmd: ip link add red type vrf table 10 17 | - cmd: ip link add blu type vrf table 20 18 | - cmd: ip link add grn type vrf table 30 19 | - cmd: ip link set red up 20 | - cmd: ip link set blu up 21 | - cmd: ip link set grn up 22 | - cmd: ip link set net0 vrf red 23 | - cmd: /usr/lib/frr/frrinit.sh start 24 | - cmd: >- 25 | vtysh -c 'conf t' 26 | -c 'int net0' -c 'ip addr 10.0.0.1/24' -c 'exit' 27 | -c 'router bgp 1 vrf red' 28 | -c ' bgp router-id 1.1.1.1' 29 | -c ' address-family ipv4 unicast' 30 | -c ' redistribute connected' 31 | -c ' exit-address-family' 32 | -c 'router bgp 2 vrf blu' 33 | -c ' bgp router-id 2.2.2.2' 34 | -c ' address-family ipv4 unicast' 35 | -c ' import vrf red' 36 | -c ' exit-address-family' 37 | -c 'router bgp 3 vrf grn' 38 | -c ' bgp router-id 3.3.3.3' 39 | -c ' address-family ipv4 unicast' 40 | -c ' import vrf blu' 41 | -c ' exit-address-family' 42 | 43 | -------------------------------------------------------------------------------- /examples/basic_bgp_mpls_vpnv4/r1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_bgp_mpls_vpnv4/r1.pcap -------------------------------------------------------------------------------- /examples/basic_bgp_mpls_vpnv4/r2.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_bgp_mpls_vpnv4/r2.pcap -------------------------------------------------------------------------------- /examples/basic_bgp_mpls_vpnv4/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_bgp_mpls_vpnv4/topo.png -------------------------------------------------------------------------------- /examples/basic_bgp_srv6_vpnv4/frr.conf.srv6.R1: -------------------------------------------------------------------------------- 1 | hostname R1 2 | log file /tmp/frr.log 3 | ! 4 | debug bgp vpn label 5 | debug bgp vpn leak-from-vrf 6 | debug bgp vpn leak-to-vrf 7 | debug bgp vpn rmap-event 8 | debug bgp vpn adv-prefix-sid 9 | ! 10 | int net0 11 | ipv6 address 2001::1/64 12 | ! 13 | int net1 vrf vrf1 14 | ip address 30.1.0.1/24 15 | ! 16 | int net2 vrf vrf2 17 | ip address 30.3.0.1/24 18 | ! 19 | int net3 vrf vrf3 20 | ip address 30.5.0.1/24 21 | ! 22 | router bgp 65001 23 | bgp router-id 10.255.0.1 24 | neighbor 2001::2 remote-as 65002 25 | ! 26 | address-family ipv4 unicast 27 | redistribute connected 28 | redistribute static 29 | exit-address-family 30 | ! 31 | address-family ipv4 srv6-vpn 32 | neighbor 2001::2 activate 33 | exit-address-family 34 | ! 35 | router bgp 65001 vrf vrf1 36 | bgp router-id 10.255.0.1 37 | ! 38 | address-family ipv4 unicast 39 | redistribute connected 40 | sid srv6-vpn export 1:1:: 41 | rd srv6-vpn export 65001:1 42 | rt srv6-vpn both 100:1 43 | export srv6-vpn 44 | import srv6-vpn 45 | exit-address-family 46 | ! 47 | router bgp 65001 vrf vrf2 48 | bgp router-id 10.255.0.1 49 | ! 50 | address-family ipv4 unicast 51 | redistribute connected 52 | sid srv6-vpn export 1:2:: 53 | rd srv6-vpn export 65001:2 54 | rt srv6-vpn both 100:2 55 | export srv6-vpn 56 | import srv6-vpn 57 | exit-address-family 58 | ! 59 | router bgp 65001 vrf vrf3 60 | bgp router-id 10.255.0.1 61 | ! 62 | address-family ipv4 unicast 63 | redistribute connected 64 | sid srv6-vpn export 1:3:: 65 | rd srv6-vpn export 65001:3 66 | rt srv6-vpn both 100:3 67 | export srv6-vpn 68 | import srv6-vpn 69 | exit-address-family 70 | ! 71 | line vty 72 | ! 73 | -------------------------------------------------------------------------------- /examples/basic_bgp_srv6_vpnv4/frr.conf.srv6.R2: -------------------------------------------------------------------------------- 1 | hostname R2 2 | log file /tmp/frr.log 3 | ! 4 | debug bgp vpn label 5 | debug bgp vpn leak-from-vrf 6 | debug bgp vpn leak-to-vrf 7 | debug bgp vpn rmap-event 8 | debug bgp vpn adv-prefix-sid 9 | ! 10 | int net0 11 | ipv6 address 2001::2/64 12 | ! 13 | int net1 vrf vrf1 14 | ip address 30.2.0.1/24 15 | ! 16 | int net2 vrf vrf2 17 | ip address 30.4.0.1/24 18 | ! 19 | int net3 vrf vrf3 20 | ip address 30.6.0.1/24 21 | ! 22 | router bgp 65002 23 | bgp router-id 10.255.0.2 24 | neighbor 2001::1 remote-as 65001 25 | ! 26 | address-family ipv4 unicast 27 | redistribute connected 28 | redistribute static 29 | exit-address-family 30 | ! 31 | address-family ipv4 srv6-vpn 32 | neighbor 2001::1 activate 33 | exit-address-family 34 | ! 35 | router bgp 65002 vrf vrf1 36 | bgp router-id 10.255.0.2 37 | ! 38 | address-family ipv4 unicast 39 | redistribute connected 40 | sid srv6-vpn export 2:1:: 41 | rd srv6-vpn export 65002:1 42 | rt srv6-vpn both 100:1 43 | export srv6-vpn 44 | import srv6-vpn 45 | exit-address-family 46 | ! 47 | router bgp 65002 vrf vrf2 48 | bgp router-id 10.255.0.2 49 | ! 50 | address-family ipv4 unicast 51 | redistribute connected 52 | sid srv6-vpn export 2:2:: 53 | rd srv6-vpn export 65002:2 54 | rt srv6-vpn both 100:2 55 | export srv6-vpn 56 | import srv6-vpn 57 | exit-address-family 58 | ! 59 | router bgp 65002 vrf vrf3 60 | bgp router-id 10.255.0.2 61 | ! 62 | address-family ipv4 unicast 63 | redistribute connected 64 | sid srv6-vpn export 2:3:: 65 | rd srv6-vpn export 65002:3 66 | rt srv6-vpn both 100:3 67 | export srv6-vpn 68 | import srv6-vpn 69 | exit-address-family 70 | ! 71 | line vty 72 | ! 73 | -------------------------------------------------------------------------------- /examples/basic_bgp_srv6_vpnv4/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_bgp_srv6_vpnv4/topo.png -------------------------------------------------------------------------------- /examples/basic_bond/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | precmd: 3 | - cmds: 4 | - cmd: export IMAGE=slankdev/frr 5 | - cmd: export IMAGE=slankdev/gobgp 6 | - cmd: export IMAGE=slankdev/ubuntu:18.04 7 | 8 | nodes: 9 | - name: R1 10 | image: $IMAGE 11 | interfaces: 12 | - { name: net0, type: direct, args: R2#net0 } 13 | - { name: net1, type: direct, args: R2#net1 } 14 | - name: R2 15 | image: $IMAGE 16 | interfaces: 17 | - { name: net0, type: direct, args: R1#net0 } 18 | - { name: net1, type: direct, args: R1#net1 } 19 | 20 | node_configs: 21 | - name: R1 22 | cmds: 23 | - cmd: ip link add bond0 type bond miimon 100 mode active-backup 24 | - cmd: ip link set bond0 up 25 | - cmd: ip link set net0 down 26 | - cmd: ip link set net1 down 27 | - cmd: ip link set net0 master bond0 28 | - cmd: ip link set net1 master bond0 29 | - cmd: ip addr add 10.0.0.1/24 dev bond0 30 | - name: R2 31 | cmds: 32 | - cmd: ip link add bond0 type bond miimon 100 mode active-backup 33 | - cmd: ip link set bond0 up 34 | - cmd: ip link set net0 down 35 | - cmd: ip link set net1 down 36 | - cmd: ip link set net0 master bond0 37 | - cmd: ip link set net1 master bond0 38 | - cmd: ip addr add 10.0.0.2/24 dev bond0 39 | 40 | test: 41 | - name: p2p 42 | cmds: 43 | - cmd: echo slankdev slankdev 44 | - cmd: echo slankdev slankdev 45 | 46 | -------------------------------------------------------------------------------- /examples/basic_clos/README.md: -------------------------------------------------------------------------------- 1 | 2 | # CLOS Topology 3 | 4 | Practice of designing DCN. Following are principle of Design. 5 | - using modernaized technology (such as BGP-unnumbered.) 6 | 7 | Version 8 | - 0.0.0: basic CLOS-network ([yaml](./spec.v0.0.0.yaml)) 9 | - 0.0.1: using BGP-unnumbered ([yaml](./spec.v0.0.1.yaml)) 10 | - 0.0.2: using ECMP anycast ([yaml](./spec.v0.0.2.yaml)) 11 | - 0.0.3: add VM and ToR nodes ([yaml](./spec.v0.0.3.yaml)) 12 | - 0.0.4: support multi-tenancy ([yaml](./spec.v0.0.4.yaml)) (**currentry version**) 13 | - 0.0.5: support SRv6 network slicing ([yaml](./spec.v0.0.5.yaml)) 14 | 15 | **version v0.0.3** 16 | ![](./topo.v0.0.3.png) 17 | 18 | **version v0.0.2** 19 | ![](./topo.v0.0.2.png) 20 | 21 | **version v0.0.1** 22 | ![](./topo.v0.0.1.png) 23 | 24 | **version v0.0.0** 25 | ![](./topo.v0.0.0.png) 26 | 27 | references 28 | - LINE-SRv6-DCN ENOG55 http://enog.jp/wp-content/uploads/2018/12/05_20190222_ENOG55_LINE.pdf 29 | - Large Scale DC Network Design https://www.slideshare.net/MasayukiKobayashi/dc-66865243 30 | - Good TiNET examples by MIYA-kun https://github.com/mi2428/netben 31 | - LINE DCN Overview by Kobayashi-san 2018.10 https://www.slideshare.net/linecorp/ss-116867631 32 | - About designing the LINE-NW from scrach by Kobayashi-san 2019.01 https://www.janog.gr.jp/meeting/janog43/application/files/7915/4823/1858/janog43-line-kobayashi.pdf 33 | - OpenStack Summit Vancouver 2018 Recap LINE-verda https://engineering.linecorp.com/ja/blog/openstack-summit-vancouver-2018-recap-2-2 34 | 35 | operation performance 36 | ``` 37 | v0.0.3 sh -c 'tn up | sudo sh' 38 | real 0m29.151s 39 | user 0m6.945s 40 | sys 0m4.472s 41 | 42 | v0.0.3 sh -c 'tn conf | sudo sh' frr-all 43 | real 1m25.104s 44 | user 0m6.110s 45 | sys 0m4.263s 46 | 47 | v0.0.3 sh -c 'tn conf | sudo sh' frr-zebra,bgpd 48 | real 1m13.867s 49 | user 0m6.239s 50 | sys 0m4.143s 51 | ``` 52 | -------------------------------------------------------------------------------- /examples/basic_clos/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_clos/topo.png -------------------------------------------------------------------------------- /examples/basic_clos/topo.v0.0.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_clos/topo.v0.0.0.png -------------------------------------------------------------------------------- /examples/basic_clos/topo.v0.0.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_clos/topo.v0.0.1.png -------------------------------------------------------------------------------- /examples/basic_clos/topo.v0.0.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_clos/topo.v0.0.2.png -------------------------------------------------------------------------------- /examples/basic_clos/topo.v0.0.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_clos/topo.v0.0.3.png -------------------------------------------------------------------------------- /examples/basic_conntrack/connection_sync/Makefile: -------------------------------------------------------------------------------- 1 | 2 | NAME=N1 3 | log_N1: 4 | while :; do \ 5 | docker exec $(NAME) vtysh -c 'conf te' -c 'log file /tmp/frr.log'; \ 6 | docker exec -it $(NAME) tail -f /tmp/frr.log; \ 7 | sleep 1 ; done 8 | 9 | -------------------------------------------------------------------------------- /examples/basic_conntrack/connection_sync/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Connection Sync with conntrackd and keepalived 3 | 4 | ``` 5 | tn upconf | sudo sh 6 | ``` 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/basic_coredns/blacklist/Corefile.NS1: -------------------------------------------------------------------------------- 1 | .:53 { 2 | errors 3 | log 4 | forward . 8.8.8.8 5 | } 6 | 7 | ichihara.org { 8 | etcd ichihara.org { 9 | path /dns-server01 10 | endpoint http://10.0.0.100:2379 11 | } 12 | } 13 | 14 | emacs.org { 15 | } 16 | sublimetext.com { 17 | } 18 | -------------------------------------------------------------------------------- /examples/basic_coredns/blacklist/README.md: -------------------------------------------------------------------------------- 1 | 2 | # CoreDNS example (very simple blacklist) 3 | 4 | ![](topo.png) 5 | 6 | - Blacklisted 7 | - emacs.org 8 | - sublimetext.com 9 | 10 | ``` 11 | docker exec R1 nslookup slank.dev 12 | docker exec R1 nslookup test1.ichihara.org 13 | docker exec R1 nslookup test2.ichihara.org 14 | 15 | docker exec R1 nslookup www.vim.org 16 | docker exec R1 nslookup emacs.org 17 | docker exec R1 nslookup sublimetext.com 18 | ``` 19 | -------------------------------------------------------------------------------- /examples/basic_coredns/blacklist/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_coredns/blacklist/topo.png -------------------------------------------------------------------------------- /examples/basic_ecmp/README.md: -------------------------------------------------------------------------------- 1 | 2 | ![](topo.jpeg) 3 | -------------------------------------------------------------------------------- /examples/basic_ecmp/scale.diff: -------------------------------------------------------------------------------- 1 | diff --git a/examples/basic_ecmp/spec.yaml b/examples/basic_ecmp/spec.yaml 2 | index c2c0bd2..79ab538 100644 3 | --- a/examples/basic_ecmp/spec.yaml 4 | +++ b/examples/basic_ecmp/spec.yaml 5 | @@ -38,6 +38,16 @@ nodes: 6 | interfaces: 7 | - { name: net0, type: direct, args: R3#net1 } 8 | 9 | + - name: R4 10 | + image: slankdev/frr 11 | + interfaces: 12 | + - { name: net0, type: bridge, args: B0 } 13 | + - { name: net1, type: direct, args: S4#net0 } 14 | + - name: S4 15 | + image: tmp 16 | + interfaces: 17 | + - { name: net0, type: direct, args: R4#net1 } 18 | + 19 | switches: 20 | - name: B0 21 | interfaces: 22 | @@ -45,6 +55,7 @@ switches: 23 | - { name: net0, type: container, args: R1 } 24 | - { name: net0, type: container, args: R2 } 25 | - { name: net0, type: container, args: R3 } 26 | + - { name: net0, type: container, args: R4 } 27 | 28 | node_configs: 29 | - name: S0 30 | @@ -123,6 +134,26 @@ node_configs: 31 | - cmd: sh -c "echo S3 > index.html" 32 | - cmd: nohup python3 -m http.server 80 & 33 | 34 | + - name: R4 35 | + cmds: 36 | + - cmd: /usr/lib/frr/frr start 37 | + - cmd: ip addr add 10.255.0.40/32 dev lo 38 | + - cmd: ip addr add 10.0.0.40/24 dev net0 39 | + - cmd: ip addr add 192.168.0.1/24 dev net1 40 | + - cmd: ip route replace default via 10.0.0.1 41 | + - cmd: >- 42 | + vtysh -c 'conf t' 43 | + -c 'router bgp 100' 44 | + -c ' bgp router-id 10.255.0.40' 45 | + -c ' neighbor 10.0.0.1 remote-as 100' 46 | + -c ' network 192.168.0.2/32' 47 | + - name: S4 48 | + cmds: 49 | + - cmd: ip addr add 192.168.0.2/24 dev net0 50 | + - cmd: ip route replace default via 192.168.0.1 51 | + - cmd: sh -c "echo S4 > index.html" 52 | + - cmd: nohup python3 -m http.server 80 & 53 | + 54 | test: 55 | - cmds: 56 | # local link 57 | -------------------------------------------------------------------------------- /examples/basic_ecmp/topo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_ecmp/topo.jpeg -------------------------------------------------------------------------------- /examples/basic_evpn/README.md: -------------------------------------------------------------------------------- 1 | 2 | # EVPN 3 | 4 | ![](./topo.png) 5 | 6 | -------------------------------------------------------------------------------- /examples/basic_evpn/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_evpn/topo.png -------------------------------------------------------------------------------- /examples/basic_exabgp/Makefile: -------------------------------------------------------------------------------- 1 | 2 | exabgp: 3 | exabgp ./exabgp.conf 4 | 5 | PCAP_PATH=/vagrant 6 | getcapture: 7 | tcpdump -ni net0 -w $(PCAP_PATH)/in.pcap & 8 | exabgp ./exabgp.conf & 9 | sleep 2 10 | killall tcpdump 11 | killall python3 12 | 13 | show: 14 | docker exec R1 vtysh -c 'sh bgp ipv4 uni' 15 | 16 | -------------------------------------------------------------------------------- /examples/basic_exabgp/README.md: -------------------------------------------------------------------------------- 1 | 2 | # ExaBGP test 3 | 4 | ``` 5 | tn upconf | sudo sh 6 | docker_mount_netns R2 ns0 7 | ip netns exec ns0 bash 8 | make //execute exabgp 9 | make getcapture //execute exabgp and pcap. 10 | ``` 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/basic_exabgp/exabgp.conf: -------------------------------------------------------------------------------- 1 | neighbor 10.0.0.1 { 2 | router-id 2.2.2.2; 3 | local-address 10.0.0.2; 4 | local-as 2; 5 | peer-as 1; 6 | 7 | #capability { 8 | # nexthop true; 9 | #} 10 | 11 | family { 12 | ipv4 unicast; 13 | ipv4 mpls-vpn; 14 | } 15 | 16 | nexthop { 17 | #ipv4 unicast ipv6; 18 | #ipv4 mpls-vpn ipv6; 19 | } 20 | 21 | static { 22 | #route 1.1.1.1/32 next-hop 2.2.2.2; 23 | #route 1.1.1.3/32 next-hop 2.2.2.2 bgp-prefix-sid [ 888 ]; 24 | #route 1.1.1.6/32 next-hop 3.3.3.3 bgp-prefix-sid-srv6 ( ipv6 A:: ); 25 | #route 2.2.2.2/32 rd 1:1 nexthop 2.2.2.2 extended-community [0x ] 26 | #route 1.1.1.10/32 next-hop cafe::1; 27 | #route 10.0.0.0/24 rd 65000:1 next-hop 200.10.0.101 extended-community [ 0x0002fde800000001 ] label 3 bgp-prefix-sid-srv6 ( vpn A:: ); 28 | #route 10.0.0.0/24 rd 65000:1 next-hop 200.10.0.101 extended-community [ 0x0002fde800000001 ] label 3 bgp-prefix-sid-srv6 ( l3vpn A:: ); 29 | route 10.0.0.0/24 rd 1:1 next-hop cafe::1 extended-community [ 0x0002fde800000001 ] label 3 bgp-prefix-sid-srv6 ( l3vpn 2001:1::10 ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /examples/basic_exabgp/exabgp.conf.R2: -------------------------------------------------------------------------------- 1 | neighbor 10.0.0.1 { 2 | router-id 2.2.2.2; 3 | local-address 10.0.0.2; 4 | local-as 2; 5 | peer-as 1; 6 | #graceful-restart; 7 | 8 | static { 9 | route 8.8.8.8/32 next-hop 10.0.0.2; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/basic_exabgp/frr.conf.R1: -------------------------------------------------------------------------------- 1 | hostname R1 2 | log file /tmp/frr.log 3 | ! 4 | int net0 5 | ip address 10.0.0.1/24 6 | no shutdown 7 | ! 8 | router bgp 1 9 | bgp router-id 1.1.1.1 10 | neighbor 10.0.0.2 remote-as 2 11 | neighbor 10.0.0.2 capability extended-nexthop 12 | ! 13 | address-family ipv4 unicast 14 | redistribute kernel 15 | exit-address-family 16 | ! 17 | address-family ipv4 vpn 18 | neighbor 10.0.0.2 activate 19 | exit-address-family 20 | ! 21 | line vty 22 | ! 23 | -------------------------------------------------------------------------------- /examples/basic_exabgp/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | postinit: 3 | - cmds: 4 | - cmd: docker cp daemons.R1 R1:/etc/frr/daemons 5 | - cmd: docker cp frr.conf.R1 R1:/etc/frr/frr.conf 6 | - cmd: docker cp exabgp.conf.R2 R2:/root/exabgp.conf 7 | 8 | nodes: 9 | - name: R1 10 | # image: slankdev/centos-frr-dev:7 11 | image: slankdev/frr:centos-7-latest 12 | interfaces: 13 | - { name: net0, type: direct, args: R2#net0 } 14 | - name: R2 15 | image: slankdev/exabgp 16 | interfaces: 17 | - { name: net0, type: direct, args: R1#net0 } 18 | 19 | node_configs: 20 | - name: R1 21 | cmds: 22 | - cmd: sysctl -w 'net.ipv6.conf.net0.disable_ipv6=0' 23 | - cmd: /usr/lib/frr/frrinit.sh start 24 | - name: R2 25 | cmds: 26 | - cmd: sysctl -w 'net.ipv6.conf.net0.disable_ipv6=0' 27 | - cmd: ip addr add 10.0.0.2/24 dev net0 28 | 29 | -------------------------------------------------------------------------------- /examples/basic_fullroute/gobgpd.conf: -------------------------------------------------------------------------------- 1 | [global.config] 2 | as = 200 3 | router-id = "10.255.0.2" 4 | 5 | [[neighbors]] 6 | [neighbors.config] 7 | neighbor-address = "10.0.0.1" 8 | peer-as = 100 9 | -------------------------------------------------------------------------------- /examples/basic_fullroute/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | # precmd: 3 | # - cmds: 4 | # - cmd: export IMAGE=slankdev/frr 5 | # - cmd: export IMAGE=slankdev/gobgp 6 | # - cmd: export IMAGE=slankdev/ubuntu:18.04 7 | 8 | postinit: 9 | - cmds: 10 | - cmd: docker cp gobgpd.conf RR:/root/gobgpd.conf 11 | 12 | nodes: 13 | - name: R1 14 | image: slankdev/frr 15 | interfaces: 16 | - { name: net0, type: direct, args: RR#net0 } 17 | - name: RR 18 | image: slankdev/gobgp 19 | interfaces: 20 | - { name: net0, type: direct, args: R1#net0 } 21 | 22 | node_configs: 23 | - name: R1 24 | cmds: 25 | - cmd: ip link add dum0 type dummy 26 | - cmd: ip link add dum1 type dummy 27 | - cmd: ip link add dum2 type dummy 28 | - cmd: ip link add dum3 type dummy 29 | - cmd: /usr/lib/frr/frr start 30 | - cmd: >- 31 | vtysh -c "conf t" 32 | -c "int dum0" 33 | -c " ip addr 10.10.0.1/24" 34 | -c " no shutdown" 35 | -c " exit" 36 | -c "int dum1" 37 | -c " ip addr 10.11.0.1/24" 38 | -c " no shutdown" 39 | -c " exit" 40 | -c "int dum2" 41 | -c " ip addr 10.12.0.1/24" 42 | -c " no shutdown" 43 | -c " exit" 44 | -c "int dum3" 45 | -c " ip addr 10.13.0.1/24" 46 | -c " no shutdown" 47 | -c " exit" 48 | -c "int net0" 49 | -c " ip addr 10.0.0.1/24" 50 | -c " no shutdown" 51 | -c " exit" 52 | -c "router bgp 100" 53 | -c " bgp router-id 10.255.0.1" 54 | -c " neighbor 10.0.0.2 remote-as 200" 55 | -c " exit" 56 | - name: RR 57 | cmds: 58 | - cmd: ip addr add 10.0.0.2/24 dev net0 59 | - cmd: nohup gobgpd -f /root/gobgpd.conf & 60 | 61 | test: 62 | - name: p2p 63 | cmds: 64 | - cmd: echo slankdev slankdev 65 | - cmd: echo slankdev slankdev 66 | 67 | -------------------------------------------------------------------------------- /examples/basic_gre/README.md: -------------------------------------------------------------------------------- 1 | 2 | # GRE 3 | 4 | ![](topo.jpeg) 5 | 6 | ``` 7 | modprobe ip_gre 8 | ip tunnel add mode gre remote local ttl 9 | ip link set mtu up 10 | ip addr add / dev 11 | ``` 12 | -------------------------------------------------------------------------------- /examples/basic_gre/topo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_gre/topo.jpeg -------------------------------------------------------------------------------- /examples/basic_haproxy/README.md: -------------------------------------------------------------------------------- 1 | # HAProxy demonstration 2 | 3 | ![](./topo.png) 4 | 5 | **How to test**
6 | P1 is configured HAProxy container as-a TCP proxy. 7 | You can check the behabiour of proxy when you run 8 | the curl command to access 10.0.0.1(P1's address) on C1. 9 | ``` 10 | $ cd /path/to/here 11 | $ tn upconf | sudo sh 12 | ... 13 | $ docker exec C1 curl -s 10.0.0.1 14 | S1 15 | $ docker exec C1 curl -s 10.0.0.1 16 | S2 17 | $ docker exec C1 curl -s 10.0.0.1 18 | S3 19 | $ docker exec C1 curl -s 10.0.0.1 20 | S4 21 | $ docker exec C1 curl -s 10.0.0.1 22 | S1 23 | $ docker exec C1 curl -s 10.0.0.1 24 | S2 25 | ``` 26 | -------------------------------------------------------------------------------- /examples/basic_haproxy/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_haproxy/topo.png -------------------------------------------------------------------------------- /examples/basic_ipip/simple/README.md: -------------------------------------------------------------------------------- 1 | 2 | # IPIP tunnel 3 | 4 | ![](topo.png) 5 | 6 | -------------------------------------------------------------------------------- /examples/basic_ipip/simple/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | meta: 3 | namespace: ns_ 4 | 5 | nodes: 6 | - name: R1 7 | image: slankdev/frr:centos-7-stable-7.0 8 | interfaces: 9 | - { name: net0, type: direct, args: R2#net0 } 10 | - name: R2 11 | image: slankdev/frr:centos-7-stable-7.0 12 | interfaces: 13 | - { name: net0, type: direct, args: R1#net0 } 14 | - { name: net1, type: direct, args: R3#net0 } 15 | - name: R3 16 | image: slankdev/frr:centos-7-stable-7.0 17 | interfaces: 18 | - { name: net0, type: direct, args: R2#net1 } 19 | 20 | node_configs: 21 | - name: R1 22 | cmds: 23 | - cmd: ip addr add 10.0.0.1/24 dev net0 24 | - cmd: ip route add default via 10.0.0.2 25 | - cmd: ip tunnel add tun0 mode ipip remote 10.1.0.2 local 10.0.0.1 dev net0 26 | - cmd: ip addr add 1.1.1.1 peer 1.1.1.2 dev tun0 27 | - cmd: ip link set tun0 up 28 | - name: R2 29 | cmds: 30 | - cmd: ip addr add 10.0.0.2/24 dev net0 31 | - cmd: ip addr add 10.1.0.1/24 dev net1 32 | - name: R3 33 | cmds: 34 | - cmd: ip addr add 10.1.0.2/24 dev net0 35 | - cmd: ip route add default via 10.1.0.1 36 | - cmd: ip tunnel add tun0 mode ipip remote 10.0.0.1 local 10.1.0.2 dev net0 37 | - cmd: ip addr add 1.1.1.2 peer 1.1.1.1 dev tun0 38 | - cmd: ip link set tun0 up 39 | 40 | -------------------------------------------------------------------------------- /examples/basic_ipip/simple/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_ipip/simple/topo.png -------------------------------------------------------------------------------- /examples/basic_iptables/napt/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Managed NAPT example 3 | 4 | ``` 5 | tn upconf | sudo sh 6 | docker exec -it S1 tcpdump -ni net0 -Qin '(tcp[tcpflags] & tcp-syn)' != 0 7 | docker exec C1 curl --interface 10.0.0.2 20.0.0.2 8 | docker exec C1 curl --interface 10.0.0.3 20.0.0.2 9 | docker exec C1 curl --interface 10.0.0.4 20.0.0.2 10 | docker exec S1 conntrack -L 11 | ``` 12 | -------------------------------------------------------------------------------- /examples/basic_iptables/test/README.md: -------------------------------------------------------------------------------- 1 | 2 | # iptables study 3 | 4 | ``` 5 | root@R2:/# iptables -L 6 | Chain INPUT (policy ACCEPT) 7 | target prot opt source destination 8 | 9 | Chain FORWARD (policy ACCEPT) 10 | target prot opt source destination 11 | LOG all -- 10.0.0.2 anywhere LOG level warning 12 | 13 | Chain OUTPUT (policy ACCEPT) 14 | target prot opt source destination 15 | ``` 16 | 17 | ``` 18 | root@R2:/# iptables-save │ 19 | # Generated by iptables-save v1.6.1 on Wed May 15 10:12:54 2019 │ 20 | *filter │ 21 | :INPUT ACCEPT [5:420] │ 22 | :FORWARD ACCEPT [6:504] │ 23 | :OUTPUT ACCEPT [5:420] │ 24 | -A FORWARD -s 10.0.0.2/32 -j LOG │ 25 | COMMIT │ 26 | # Completed on Wed May 15 10:12:54 2019 27 | ``` 28 | 29 | ``` 30 | root@R2:/# iptables -A FORWARD -s 10.0.0.2 -j LOG 31 | root@R2:/# iptables -D FORWARD -s 10.0.0.2 -j LOG 32 | ``` 33 | 34 | If you want to check the LOG of iptables on network-namespace, 35 | following kernel option helps you. this option enables us, 36 | output netns's log to host's log. 37 | ``` 38 | sudo sh -c 'echo 0 > /proc/sys/net/netfilter/nf_log_all_netns' 39 | dmesg 40 | ``` 41 | -------------------------------------------------------------------------------- /examples/basic_iptables/test/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | nodes: 3 | - name: R1 4 | image: slankdev/sandbox 5 | interfaces: 6 | - { name: net0, type: direct, args: R2#net0 } 7 | - name: R2 8 | image: slankdev/sandbox 9 | interfaces: 10 | - { name: net0, type: direct, args: R1#net0 } 11 | - { name: net1, type: direct, args: R3#net0 } 12 | - name: R3 13 | image: slankdev/sandbox 14 | interfaces: 15 | - { name: net0, type: direct, args: R2#net1 } 16 | 17 | node_configs: 18 | - name: R1 19 | cmds: 20 | - cmd: ip addr add 10.0.0.2/24 dev net0 21 | - cmd: ip route add default via 10.0.0.1 22 | - name: R2 23 | cmds: 24 | - cmd: ip addr add 10.0.0.1/24 dev net0 25 | - cmd: ip addr add 20.0.0.1/24 dev net1 26 | - name: R3 27 | cmds: 28 | - cmd: ip addr add 20.0.0.2/24 dev net0 29 | - cmd: ip route add default via 20.0.0.1 30 | 31 | -------------------------------------------------------------------------------- /examples/basic_isis/README.md: -------------------------------------------------------------------------------- 1 | 2 | # ISIS 3 | 4 | ![](topo.png) 5 | 6 | ``` 7 | tn upconf | sudo sh 8 | ``` 9 | 10 | ## Reference 11 | 12 | - http://docs.frrouting.org/en/latest/isisd.html 13 | -------------------------------------------------------------------------------- /examples/basic_isis/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_isis/topo.png -------------------------------------------------------------------------------- /examples/basic_ldp/README.md: -------------------------------------------------------------------------------- 1 | 2 | # LDP Example 3 | 4 | create basic mpls backbone-network 5 | ![](./topo.png) 6 | 7 | ``` 8 | host# modprobe mpls_router 9 | host# modprobe mpls_iptunnel 10 | ``` 11 | 12 | references 13 | - https://github.com/FRRouting/frr/blob/master/doc/developer/ldpd-basic-test-setup.md 14 | - https://github.com/FRRouting/frr/issues/651 15 | - http://docs.frrouting.org/en/latest/ldpd.html 16 | -------------------------------------------------------------------------------- /examples/basic_namespace/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Namespace Isolation 3 | 4 | ![](./topo.png) 5 | 6 | ``` 7 | cd path/to/here 8 | tn -f spec.blue.yaml upconf | sudo sh 9 | tn -f spec.green.yaml upconf | sudo sh 10 | docker ps 11 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 12 | 6d5f9e4d6c51 slankdev/ubuntu:18.04 "/bin/bash" 2 seconds ago Up 1 second green_R2 13 | 92210c5eea85 slankdev/ubuntu:18.04 "/bin/bash" 3 seconds ago Up 2 seconds green_R1 14 | 48a50568c9c1 slankdev/ubuntu:18.04 "/bin/bash" 7 seconds ago Up 6 seconds blue_R2 15 | 86c2c4c9fc52 slankdev/ubuntu:18.04 "/bin/bash" 7 seconds ago Up 7 seconds blue_R1 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /examples/basic_namespace/spec.blue.yaml: -------------------------------------------------------------------------------- 1 | 2 | meta: 3 | namespace: blue_ 4 | 5 | nodes: 6 | - name: R1 7 | image: slankdev/ubuntu:18.04 8 | interfaces: 9 | - { name: net0, type: direct, args: R2#net0 } 10 | - name: R2 11 | image: slankdev/ubuntu:18.04 12 | interfaces: 13 | - { name: net0, type: direct, args: R1#net0 } 14 | 15 | node_configs: 16 | - name: R1 17 | cmds: 18 | - cmd: ip addr add 10.0.0.1/24 dev net0 19 | - name: R2 20 | cmds: 21 | - cmd: ip addr add 10.0.0.2/24 dev net0 22 | 23 | -------------------------------------------------------------------------------- /examples/basic_namespace/spec.green.yaml: -------------------------------------------------------------------------------- 1 | 2 | meta: 3 | namespace: green_ 4 | 5 | nodes: 6 | - name: R1 7 | image: slankdev/ubuntu:18.04 8 | interfaces: 9 | - { name: net0, type: direct, args: R2#net0 } 10 | - name: R2 11 | image: slankdev/ubuntu:18.04 12 | interfaces: 13 | - { name: net0, type: direct, args: R1#net0 } 14 | 15 | node_configs: 16 | - name: R1 17 | cmds: 18 | - cmd: ip addr add 10.0.0.1/24 dev net0 19 | - name: R2 20 | cmds: 21 | - cmd: ip addr add 10.0.0.2/24 dev net0 22 | 23 | -------------------------------------------------------------------------------- /examples/basic_namespace/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_namespace/topo.png -------------------------------------------------------------------------------- /examples/basic_napt/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | # DESCRIPTION: NAPT network using FRR 3 | # 4 | # TOPO: 5 | # S0 6 | # (net0).2| 7 | # | 8 | # WAN:20.0.0.0/24 | 9 | # | 10 | # (net0).1| 11 | # R1(NAPT) 12 | # (net1).1| 13 | # | 14 | # LAN:10.0.0.0/24 | 15 | # | 16 | # (net0).2| 17 | # C0 18 | # 19 | # INIT: 20 | # cns spec7.yaml init | sudo sh 21 | # ./setup7.sh 22 | # FINI: 23 | # cns spec7.yaml fini | sudo sh 24 | # 25 | 26 | nodes: 27 | - name: R0 28 | image: slankdev/frr 29 | interfaces: 30 | - name: net0 31 | type: direct 32 | args: S0#net0 33 | - name: net1 34 | type: direct 35 | args: C0#net0 36 | - name: S0 37 | image: slankdev/ubuntu:16.04 38 | interfaces: 39 | - name: net0 40 | type: direct 41 | args: R0#net0 42 | - name: C0 43 | image: slankdev/ubuntu:16.04 44 | interfaces: 45 | - name: net0 46 | type: direct 47 | args: R0#net1 48 | 49 | node_configs: 50 | - name: R0 51 | cmds: 52 | - cmd: >- 53 | vtysh -c "conf t" 54 | -c "interface net0" 55 | -c "ip address 20.0.0.1/24" 56 | -c "exit" 57 | -c "interface net1" 58 | -c "ip address 10.0.0.1/24" 59 | -c "exit" 60 | - cmd: >- 61 | iptables -t nat -A POSTROUTING 62 | -s 10.0.0.0/24 -j MASQUERADE 63 | 64 | - name: S0 65 | cmds: 66 | - cmd: ip addr add 20.0.0.2/24 dev net0 67 | - cmd: ip route del default 68 | - cmd: ip route add default via 20.0.0.1 69 | 70 | - name: C0 71 | cmds: 72 | - cmd: ip addr add 10.0.0.2/24 dev net0 73 | - cmd: ip route del default 74 | - cmd: ip route add default via 10.0.0.1 75 | 76 | test: 77 | - cmds: 78 | - cmd: docker exec C0 ping -c2 20.0.0.2 79 | - cmd: docker exec -d S0 iperf -s 80 | - cmd: docker exec C0 iperf -c 20.0.0.2 81 | -------------------------------------------------------------------------------- /examples/basic_netns/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | nodes: 3 | - name: H0 4 | type: netns 5 | interfaces: 6 | - { name: net0, type: direct, args: C0#net0 } 7 | - { name: net1, type: direct, args: C1#net0 } 8 | - name: C0 9 | image: slankdev/ubuntu:18.04 10 | interfaces: 11 | - { name: net0, type: direct, args: H0#net0 } 12 | - name: C1 13 | image: slankdev/ubuntu:18.04 14 | interfaces: 15 | - { name: net0, type: direct, args: H0#net1 } 16 | 17 | node_configs: 18 | - name: H0 19 | cmds: 20 | - cmd: ip addr add 10.0.0.1/24 dev net0 21 | - cmd: ip addr add 10.1.0.1/24 dev net1 22 | - name: C0 23 | cmds: 24 | - cmd: ip addr add 10.0.0.2/24 dev net0 25 | - cmd: ip route replace default via 10.0.0.1 26 | - name: C1 27 | cmds: 28 | - cmd: ip addr add 10.1.0.2/24 dev net0 29 | - cmd: ip route replace default via 10.1.0.1 30 | 31 | test: 32 | - cmds: 33 | - cmd: echo slankdev 34 | 35 | -------------------------------------------------------------------------------- /examples/basic_nftables/masquerade/README.md: -------------------------------------------------------------------------------- 1 | 2 | # nftables study (MASQ) 3 | 4 | check nft is enabled (m is OK) 5 | ``` 6 | # cat /boot/config-`uname -r` | grep CONFIG_NF_TABLES 7 | CONFIG_NF_TABLES=m 8 | CONFIG_NF_TABLES_INET=m 9 | CONFIG_NF_TABLES_NETDEV=m 10 | CONFIG_NF_TABLES_IPV4=m 11 | CONFIG_NF_TABLES_ARP=m 12 | CONFIG_NF_TABLES_IPV6=m 13 | CONFIG_NF_TABLES_BRIDGE=m 14 | ``` 15 | 16 | - Good reference 17 | - https://knowledge.sakura.ad.jp/22636/ 18 | - https://www.slideshare.net/s1061123/nftables-the-next-generation-firewall-in-linux 19 | -------------------------------------------------------------------------------- /examples/basic_nftables/masquerade/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | postinit: 3 | - cmds: 4 | - cmd: docker cp ../../../tools/http_server.py R3:/usr/bin 5 | - cmd: docker cp ../../../tools/echo_server.py R3:/usr/bin 6 | 7 | nodes: 8 | - name: R1 9 | image: slankdev/conntrack:centos-7 10 | interfaces: 11 | - { name: net0, type: direct, args: R2#net0 } 12 | - name: R2 13 | image: slankdev/conntrack:centos-7 14 | interfaces: 15 | - { name: net0, type: direct, args: R1#net0 } 16 | - { name: net1, type: direct, args: R3#net0 } 17 | - name: R3 18 | image: slankdev/conntrack:centos-7 19 | interfaces: 20 | - { name: net0, type: direct, args: R2#net1 } 21 | 22 | node_configs: 23 | - name: R1 24 | cmds: 25 | - cmd: ip addr add 10.0.0.2/24 dev net0 26 | - cmd: ip route add default via 10.0.0.1 27 | 28 | - name: R2 29 | cmds: 30 | - cmd: ip addr add 10.0.0.1/24 dev net0 31 | - cmd: ip addr add 20.0.0.1/24 dev net1 32 | - cmd: nft create table ip nat 33 | - cmd: nft create chain ip nat prerouting { type nat hook prerouting priority 0 \;} 34 | - cmd: nft create chain ip nat postrouting { type nat hook postrouting priority 0 \;} 35 | - cmd: nft add rule nat postrouting ip saddr 10.0.0.0/24 oif net1 masquerade 36 | 37 | - name: R3 38 | cmds: 39 | - cmd: ip addr add 20.0.0.2/24 dev net0 40 | - cmd: nohup http_server.py & 41 | 42 | -------------------------------------------------------------------------------- /examples/basic_nftables/snat/README.md: -------------------------------------------------------------------------------- 1 | 2 | # nftables study (SNAT) 3 | 4 | check nft is enabled (m is OK) 5 | ``` 6 | # cat /boot/config-`uname -r` | grep CONFIG_NF_TABLES 7 | CONFIG_NF_TABLES=m 8 | CONFIG_NF_TABLES_INET=m 9 | CONFIG_NF_TABLES_NETDEV=m 10 | CONFIG_NF_TABLES_IPV4=m 11 | CONFIG_NF_TABLES_ARP=m 12 | CONFIG_NF_TABLES_IPV6=m 13 | CONFIG_NF_TABLES_BRIDGE=m 14 | ``` 15 | 16 | - Good reference 17 | - https://knowledge.sakura.ad.jp/22636/ 18 | - https://www.slideshare.net/s1061123/nftables-the-next-generation-firewall-in-linux 19 | -------------------------------------------------------------------------------- /examples/basic_nftables/snat/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | postinit: 3 | - cmds: 4 | - cmd: docker cp ../../../tools/http_server.py R3:/usr/bin 5 | - cmd: docker cp ../../../tools/echo_server.py R3:/usr/bin 6 | 7 | nodes: 8 | - name: R1 9 | image: slankdev/conntrack:centos-7 10 | interfaces: 11 | - { name: net0, type: direct, args: R2#net0 } 12 | - name: R2 13 | image: slankdev/conntrack:centos-7 14 | interfaces: 15 | - { name: net0, type: direct, args: R1#net0 } 16 | - { name: net1, type: direct, args: R3#net0 } 17 | - name: R3 18 | image: slankdev/conntrack:centos-7 19 | interfaces: 20 | - { name: net0, type: direct, args: R2#net1 } 21 | 22 | node_configs: 23 | - name: R1 24 | cmds: 25 | - cmd: ip addr add 10.0.0.2/24 dev net0 26 | - cmd: ip route add default via 10.0.0.1 27 | 28 | - name: R2 29 | cmds: 30 | - cmd: ip addr add 10.0.0.1/24 dev net0 31 | - cmd: ip addr add 20.0.0.1/24 dev net1 32 | - cmd: nft create table ip nat 33 | - cmd: nft create chain ip nat prerouting { type nat hook prerouting priority 0 \;} 34 | - cmd: nft create chain ip nat postrouting { type nat hook postrouting priority 0 \;} 35 | - cmd: nft add rule nat postrouting ip protocol tcp snat to 20.0.0.1:100-200 36 | 37 | - name: R3 38 | cmds: 39 | - cmd: ip addr add 20.0.0.2/24 dev net0 40 | - cmd: nohup http_server.py & 41 | 42 | -------------------------------------------------------------------------------- /examples/basic_ospfv2_bird/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Multiple OSPFv3 Instance using Bird 3 | 4 | ![](./topo.png) 5 | 6 | ``` 7 | ``` 8 | -------------------------------------------------------------------------------- /examples/basic_ospfv2_bird/bird/R1_bird.conf: -------------------------------------------------------------------------------- 1 | router id 10.255.0.1; 2 | 3 | protocol device { 4 | } 5 | 6 | protocol kernel { 7 | learn; 8 | export all; 9 | import all; 10 | } 11 | 12 | protocol ospf instance_A { 13 | router id 10.255.0.1; 14 | export all; 15 | import all; 16 | area 0.0.0.0 { 17 | interface "net0" { 18 | hello 10; 19 | wait 40; 20 | type ptp; 21 | }; 22 | interface "net1" { 23 | hello 10; 24 | wait 40; 25 | type ptp; 26 | }; 27 | interface "net2" { 28 | hello 10; 29 | wait 40; 30 | type ptp; 31 | }; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /examples/basic_ospfv2_bird/bird/R2_bird.conf: -------------------------------------------------------------------------------- 1 | router id 10.255.0.2; 2 | 3 | protocol device { 4 | } 5 | 6 | protocol kernel { 7 | learn; 8 | export all; 9 | import all; 10 | } 11 | 12 | protocol ospf instance_A { 13 | router id 10.255.0.2; 14 | export all; 15 | import all; 16 | area 0.0.0.0 { 17 | interface "net0" { 18 | hello 10; 19 | wait 40; 20 | type ptp; 21 | }; 22 | interface "net1" { 23 | hello 10; 24 | wait 40; 25 | type ptp; 26 | }; 27 | }; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /examples/basic_ospfv2_bird/bird/R3_bird.conf: -------------------------------------------------------------------------------- 1 | router id 10.255.0.3; 2 | 3 | protocol device { 4 | } 5 | 6 | protocol kernel { 7 | learn; 8 | export all; 9 | import all; 10 | } 11 | 12 | protocol ospf instance_A { 13 | router id 10.255.0.3; 14 | export all; 15 | import all; 16 | area 0.0.0.0 { 17 | interface "net0" { 18 | hello 10; 19 | wait 40; 20 | type ptp; 21 | }; 22 | interface "net1" { 23 | hello 10; 24 | wait 40; 25 | type ptp; 26 | }; 27 | interface "net2" { 28 | hello 10; 29 | wait 40; 30 | type ptp; 31 | }; 32 | }; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /examples/basic_ospfv2_bird/bird/R4_bird.conf: -------------------------------------------------------------------------------- 1 | router id 10.255.0.4; 2 | 3 | protocol device { 4 | } 5 | 6 | protocol kernel { 7 | learn; 8 | export all; 9 | import all; 10 | } 11 | 12 | protocol ospf instance_A { 13 | router id 10.255.0.4; 14 | export all; 15 | import all; 16 | area 0.0.0.0 { 17 | interface "net0" { 18 | hello 10; 19 | wait 40; 20 | type ptp; 21 | }; 22 | interface "net1" { 23 | hello 10; 24 | wait 40; 25 | type ptp; 26 | }; 27 | interface "net2" { 28 | hello 10; 29 | wait 40; 30 | type ptp; 31 | }; 32 | }; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /examples/basic_ospfv2_bird/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_ospfv2_bird/topo.png -------------------------------------------------------------------------------- /examples/basic_ospfv2_frr/README.md: -------------------------------------------------------------------------------- 1 | 2 | # OSPFv2 using FRR 3 | 4 | ![](./topo.png) 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/basic_ospfv2_frr/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_ospfv2_frr/topo.png -------------------------------------------------------------------------------- /examples/basic_ospfv3_bird_multiple_instance/R3_bird6.conf: -------------------------------------------------------------------------------- 1 | router id 10.255.0.3; 2 | 3 | protocol device dev0 { 4 | } 5 | 6 | protocol kernel ker0 { 7 | learn; 8 | export all; 9 | import all; 10 | } 11 | 12 | table red; 13 | protocol kernel ker1 { 14 | learn; 15 | export all; 16 | import all; 17 | table red; 18 | kernel table 10; 19 | } 20 | 21 | table blu; 22 | protocol kernel ker2 { 23 | learn; 24 | export all; 25 | import all; 26 | table blu; 27 | kernel table 20; 28 | } 29 | 30 | protocol direct dir1 { 31 | table red; 32 | interface "net0"; 33 | interface "net2"; 34 | } 35 | 36 | protocol direct dir2 { 37 | table blu; 38 | interface "net1"; 39 | interface "net3"; 40 | } 41 | 42 | protocol ospf ored { 43 | vrf "red"; 44 | table red; 45 | router id 10.255.0.30; 46 | export all; 47 | import all; 48 | area 0.0.0.0 { 49 | interface "net0" { 50 | hello 10; 51 | wait 40; 52 | type ptp; 53 | }; 54 | interface "net2" { 55 | hello 10; 56 | wait 40; 57 | type ptp; 58 | }; 59 | }; 60 | } 61 | 62 | protocol ospf oblu { 63 | vrf "blu"; 64 | table blu; 65 | router id 10.255.0.31; 66 | export all; 67 | import all; 68 | area 0.0.0.0 { 69 | interface "net1" { 70 | hello 10; 71 | wait 40; 72 | type ptp; 73 | }; 74 | interface "net3" { 75 | hello 10; 76 | wait 40; 77 | type ptp; 78 | }; 79 | }; 80 | } 81 | 82 | -------------------------------------------------------------------------------- /examples/basic_ospfv3_bird_multiple_instance/README.md: -------------------------------------------------------------------------------- 1 | 2 | # OSPFv3 Multiple Instance(VRF) using Bird 3 | 4 | ![](./topo.png) 5 | 6 | - the tmp image should include **bird-1.6.6** 7 | - also kernel's version can be perform l3mdev 8 | -------------------------------------------------------------------------------- /examples/basic_ospfv3_bird_multiple_instance/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_ospfv3_bird_multiple_instance/topo.png -------------------------------------------------------------------------------- /examples/basic_ospfv3_frr/README.md: -------------------------------------------------------------------------------- 1 | 2 | # OSPFv3 using FRR 3 | 4 | ![](./topo.png) 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/basic_ospfv3_frr/topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slankdev/tinet/7901b07f4a5e574a4c8782517d63add666e98e20/examples/basic_ospfv3_frr/topo.png -------------------------------------------------------------------------------- /examples/basic_peer/spec.yaml: -------------------------------------------------------------------------------- 1 | 2 | precmd: 3 | - cmds: 4 | - cmd: export IMAGE=slankdev/frr:centos-7-stable-7.0 5 | 6 | nodes: 7 | - name: R0 8 | image: $IMAGE 9 | interfaces: 10 | - { name: net0, type: direct, args: R1#net0 } 11 | - name: R1 12 | image: $IMAGE 13 | interfaces: 14 | - { name: net0, type: direct, args: R0#net0 } 15 | 16 | node_configs: 17 | - name: R0 18 | cmds: 19 | - cmd: sh -c 'enable_seg6_router.py | sh' 20 | - cmd: /usr/lib/frr/frrinit.sh start 21 | - cmd: >- 22 | vtysh -c "conf t" 23 | -c "router bgp 1" 24 | -c " bgp router-id 1.1.1.1" 25 | -c " bgp bestpath as-path multipath-relax" 26 | -c " bgp bestpath compare-routerid" 27 | -c " neighbor FABRIC peer-group" 28 | -c " neighbor FABRIC remote-as external" 29 | -c " neighbor FABRIC capability extended-nexthop" 30 | -c " neighbor net0 interface peer-group FABRIC" 31 | -c " !" 32 | -c " address-family ipv4 unicast" 33 | -c " redistribute connected" 34 | -c " redistribute kernel" 35 | -c " exit-address-family" 36 | 37 | - name: R1 38 | cmds: 39 | - cmd: sh -c 'enable_seg6_router.py | sh' 40 | - cmd: /usr/lib/frr/frrinit.sh start 41 | - cmd: >- 42 | vtysh -c "conf t" 43 | -c "router bgp 2" 44 | -c " bgp router-id 2.2.2.2" 45 | -c " bgp bestpath as-path multipath-relax" 46 | -c " bgp bestpath compare-routerid" 47 | -c " neighbor FABRIC peer-group" 48 | -c " neighbor FABRIC remote-as external" 49 | -c " neighbor FABRIC capability extended-nexthop" 50 | -c " neighbor net0 interface peer-group FABRIC" 51 | -c " !" 52 | -c " address-family ipv4 unicast" 53 | -c " redistribute connected" 54 | -c " redistribute kernel" 55 | -c " exit-address-family" 56 | 57 | -------------------------------------------------------------------------------- /examples/basic_pim/README.md: -------------------------------------------------------------------------------- 1 | 2 | # PIM Multicast Test 3 | 4 | multicast test 5 | ``` 6 | iperf -u -s -B 239.1.1.5 -i 1 7 | iperf -u -c 239.1.1.5 -i -T -t