Skip to content

Commit

Permalink
Update pola example
Browse files Browse the repository at this point in the history
  • Loading branch information
Motok1 committed Nov 28, 2022
1 parent 8ab47fc commit 818a9fa
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 29 deletions.
17 changes: 17 additions & 0 deletions examples/package/frr.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM frrouting/frr:latest
LABEL maintainer "Motoki TAKENAKA <m.takenaka@ntt.com>"

SHELL ["/bin/bash", "-l", "-c"]

# Install packages
RUN apk update \
&& apk add tcpdump

# Setup FRRouting
RUN sed -i -e 's/=no/=yes/g' /etc/frr/daemons \
&& sed -i -e 's/pathd_options=" -A 127.0.0.1"/pathd_options=" -A 127.0.0.1 -M pathd_pcep"/g' /etc/frr/daemons \
&& touch /etc/frr/vtysh.conf \
&& echo "service integrated-vtysh-config" >> /etc/frr/vtysh.conf \
&& mkdir /var/log/frr \
&& touch /var/log/frr/frr.log \
&& chmod 766 /var/log/frr/frr.log
8 changes: 8 additions & 0 deletions examples/package/host_ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ubuntu:20.04
LABEL maintainer "Motoki TAKENAKA <m.takenaka@ntt.com>"

SHELL ["/bin/bash", "-c"]

# Install packages
RUN apt update \
&& apt install -y iproute2 iperf iputils-ping tcpdump tmux traceroute vim
7 changes: 7 additions & 0 deletions examples/package/pola.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ghcr.io/nttcom/pola:latest
LABEL maintainer "Motoki TAKENAKA <m.takenaka@ntt.com>"

SHELL ["/bin/bash", "-c"]

RUN apt update \
&& apt install -y iputils-ping tcpdump tmux vim
24 changes: 14 additions & 10 deletions examples/sr-mpls_l3vpn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,35 @@ Create policy1.yaml (Apply Segment List 16002/16004/16003 to pe01)
```
```
srPolicy:
name: name
peerAddr: 10.0.255.1
name: policy1
pcepSessionAddr: 10.0.255.1
srcAddr: 10.255.0.1
dstAddr: 10.255.0.3
color: 1
segmentlist:
segmentList:
- sid: 16002
nai: 10.255.0.2
- sid: 16004
nai: 10.255.0.4
nai: 10.255.0.4
- sid: 16003
nai: 10.255.0.3
```

Apply and check SR Policy
```
# pola lsp add -f policy1.yaml
# pola sr-policy add -f policy1.yaml --no-link-state
success!
# pola lsp list
lsp(0):
peerAddr: 10.0.255.1
policyName: name
# pola sr-policy list
LSP(0):
PcepSessionAddr: 10.0.255.1
PolicyName: policy1
SrcAddr: 10.0.255.1
DstAddr: 10.255.0.3
path: 16002 -> 16004 -> 16003
Color: 0
Preference: 0
DstAddr: 10.255.0.3
SegmentList: 16002 -> 16004 -> 16003
```

Expand Down
36 changes: 17 additions & 19 deletions examples/sr-mpls_l3vpn/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,58 @@ preinit:
- cmd: modprobe mpls_router
- cmd: modprobe mpls_gso
- cmd: modprobe mpls_iptunnel
# Install Pola Docker Images
- cmd: NAME_IMAGE=pola:latest
- cmd: if [ "$(docker image ls -q $NAME_IMAGE)" = "" ]; then docker build -t $NAME_IMAGE -f ../package/pola.Dockerfile ../package;fi
# Install FRR Docker Images
- cmd: NAME_IMAGE=frr:latest
- cmd: if [ "$(docker image ls -q $NAME_IMAGE)" = "" ]; then docker build -t $NAME_IMAGE -f ../package/frr.Dockerfile ../package;fi
# Install host_ubuntu Docker Images
- cmd: NAME_IMAGE=host_ubuntu:latest
- cmd: if [ "$(docker image ls -q $NAME_IMAGE)" = "" ]; then docker build -t $NAME_IMAGE -f ../package/host_ubuntu.Dockerfile ../package;fi


postinit:
- cmds:
- cmd: docker cp polad/polad.yaml pola:/config.yaml

nodes:
- name: pola
image: watal/pola:latest
image: pola:latest
interfaces:
- { name: net0, type: bridge, args: Switch }
- name: pe01
image: watal/frr:latest
image: frr:latest
interfaces:
- { name: net0, type: direct, args: p01#net0 }
- { name: net1, type: direct, args: p02#net0 }
- { name: net2, type: direct, args: host01#net0 }
- { name: net3, type: bridge, args: Switch }
- name: pe02
image: watal/frr:latest
image: frr:latest
interfaces:
- { name: net0, type: direct, args: p01#net1 }
- { name: net1, type: direct, args: p02#net1 }
- { name: net2, type: direct, args: host02#net0 }
- { name: net3, type: bridge, args: Switch }
- name: p01
image: watal/frr:latest
image: frr:latest
interfaces:
- { name: net0, type: direct, args: pe01#net0 }
- { name: net1, type: direct, args: pe02#net0 }
- { name: net2, type: direct, args: p02#net2 }
- name: p02
image: watal/frr:latest
image: frr:latest
interfaces:
- { name: net0, type: direct, args: pe01#net1 }
- { name: net1, type: direct, args: pe02#net1 }
- { name: net2, type: direct, args: p01#net2 }
- name: host01
image: watal/ubuntu:20.04
image: host_ubuntu:latest
interfaces:
- { name: net0, type: direct, args: pe01#net2 }
- name: host02
image: watal/ubuntu:20.04
image: host_ubuntu:latest
interfaces:
- { name: net0, type: direct, args: pe02#net2 }

Expand All @@ -62,9 +72,6 @@ node_configs:
- cmd: '/usr/local/go/bin/polad -f config.yaml > /dev/null 2>&1 &'
- name: pe01
cmds:
- cmd: /usr/lib/frr/frr start
- cmd: sed -i -e 's/=no/=yes/g' /etc/frr/daemons
- cmd: /usr/lib/frr/frrinit.sh restart
- cmd: sysctl -w net.ipv4.ip_forward=1
- cmd: sysctl -w net.mpls.conf.lo.input=1
- cmd: sysctl -w net.mpls.conf.net0.input=1
Expand Down Expand Up @@ -145,9 +152,6 @@ node_configs:
-c 'exit'
- name: pe02
cmds:
- cmd: /usr/lib/frr/frr start
- cmd: sed -i -e 's/=no/=yes/g' /etc/frr/daemons
- cmd: /usr/lib/frr/frrinit.sh restart
- cmd: sysctl -w net.ipv4.ip_forward=1
- cmd: sysctl -w net.mpls.conf.lo.input=1
- cmd: sysctl -w net.mpls.conf.net0.input=1
Expand Down Expand Up @@ -207,9 +211,6 @@ node_configs:
-c 'exit'
- name: p01
cmds:
- cmd: /usr/lib/frr/frr start
- cmd: sed -i -e 's/=no/=yes/g' /etc/frr/daemons
- cmd: /usr/lib/frr/frrinit.sh restart
- cmd: sysctl -w net.ipv4.ip_forward=1
- cmd: sysctl -w net.mpls.conf.lo.input=1
- cmd: sysctl -w net.mpls.conf.net0.input=1
Expand Down Expand Up @@ -248,9 +249,6 @@ node_configs:
-c 'exit'
- name: p02
cmds:
- cmd: /usr/lib/frr/frr start
- cmd: sed -i -e 's/=no/=yes/g' /etc/frr/daemons
- cmd: /usr/lib/frr/frrinit.sh restart
- cmd: sysctl -w net.ipv4.ip_forward=1
- cmd: sysctl -w net.mpls.conf.lo.input=1
- cmd: sysctl -w net.mpls.conf.net0.input=1
Expand Down

0 comments on commit 818a9fa

Please sign in to comment.