Skip to content

Commit

Permalink
Merge branch 'master' into support-default-tinet-volume
Browse files Browse the repository at this point in the history
  • Loading branch information
AkiRa committed Feb 3, 2020
2 parents c542c81 + ecd65c6 commit 4d04f37
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 6 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,34 @@ Go implement of [slankdev/tinet](https://github.com/slankdev/tinet).
- docker
- graphviz (if you want to use `tn img`)

## Install
## Install and Build

to install
```
wget https://github.com/tinynetwork/tinet/releases/download/v0.0.0/tinet-go_linux_amd64.tar.gz -P /tmp
tar zxvf /tmp/tinet-go_linux_amd64.tar.gz -C /usr/local/bin
```

to build
```
git clone https://github.com/tinynetwork/tinet tinet && cd $_
docker run --rm -i -t -v $PWD:/v -w /v golang:1.12 go build
mv tinet /usr/local/bin
```

## Usage

```
tn up -c spec.yaml | sudo sh -x
tn conf -c spec.yaml | sudo sh -x
tn test -c spec.yaml | sudo sh -x
tn down -c spec.yaml | sudo sh -x
tinet up -c spec.yaml | sudo sh -x
tinet conf -c spec.yaml | sudo sh -x
tinet test -c spec.yaml | sudo sh -x
tinet down -c spec.yaml | sudo sh -x
```

## Command Options

```
➜ tn
# tinet
tinet is network emulator created by docker
Usage:
Expand Down
11 changes: 11 additions & 0 deletions examples/basic_bgp/mpbgp_ipv4_labeled_unicast/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# MP-BGP labeled unicast example

```
bgp unnumbered
ipv4-labeld-unicast enabled
[R0]-----------------[R1]
AS1 AS2
```

68 changes: 68 additions & 0 deletions examples/basic_bgp/mpbgp_ipv4_labeled_unicast/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

precmd:
- cmds:
- cmd: export IMAGE=slankdev/frr:centos-7-stable-7.0

nodes:
- name: R0
image: $IMAGE
interfaces:
- { name: net0, type: direct, args: R1#net0 }
- name: R1
image: $IMAGE
interfaces:
- { name: net0, type: direct, args: R0#net0 }

node_configs:
- name: R0
cmds:
- cmd: sh -c 'enable_seg6_router.py | sh'
- cmd: /usr/lib/frr/frrinit.sh start
- cmd: >-
vtysh -c "conf t"
-c "router bgp 1"
-c " bgp router-id 1.1.1.1"
-c " no bgp default ipv4-unicast"
-c " bgp bestpath as-path multipath-relax"
-c " bgp bestpath compare-routerid"
-c " neighbor FABRIC peer-group"
-c " neighbor FABRIC remote-as external"
-c " neighbor FABRIC capability extended-nexthop"
-c " neighbor net0 interface peer-group FABRIC"
-c " !"
-c " address-family ipv4 unicast"
-c " redistribute connected"
-c " redistribute kernel"
-c " exit-address-family"
-c " !"
-c " address-family ipv4 labeled-unicast"
-c " neighbor FABRIC activate"
-c " exit-address-family"
-c "!"
- name: R1
cmds:
- cmd: sh -c 'enable_seg6_router.py | sh'
- cmd: /usr/lib/frr/frrinit.sh start
- cmd: >-
vtysh -c "conf t"
-c "router bgp 2"
-c " bgp router-id 2.2.2.2"
-c " no bgp default ipv4-unicast"
-c " bgp bestpath as-path multipath-relax"
-c " bgp bestpath compare-routerid"
-c " neighbor FABRIC peer-group"
-c " neighbor FABRIC remote-as external"
-c " neighbor FABRIC capability extended-nexthop"
-c " neighbor net0 interface peer-group FABRIC"
-c " !"
-c " address-family ipv4 unicast"
-c " redistribute connected"
-c " redistribute kernel"
-c " exit-address-family"
-c " !"
-c " address-family ipv4 labeled-unicast"
-c " neighbor FABRIC activate"
-c " exit-address-family"
-c "!"

0 comments on commit 4d04f37

Please sign in to comment.