Skip to content

Commit

Permalink
examples: add basic_pbr
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
  • Loading branch information
slankdev committed Aug 24, 2020
1 parent b5157a1 commit 10470d5
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions examples/basic_pbr/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
postinit:
- cmds:
- cmd: |
cat <<EOF > /tmp/Corefile
.:53 {
forward . 8.8.8.8
log
errors
cache
}
EOF
- cmd: docker cp /tmp/Corefile S1:/Corefile

nodes:
- name: S1
image: slankdev/coredns:centos-7
net_base: bridge
interfaces:
- { name: net0, type: direct, args: HV1#net0 }
- { name: net1, type: direct, args: HV1#net1 }
- name: HV1
image: slankdev/coredns:centos-7
interfaces:
- { name: net0, type: direct, args: S1#net0 }
- { name: net1, type: direct, args: S1#net1 }

node_configs:
- name: S1
cmds:
- cmd: ip addr add 10.0.0.10/24 dev net0
- cmd: ip addr add 10.0.0.11/24 dev net1
- cmd: ip rule add prio 100 from 10.0.0.11 table 300
- cmd: ip route add default via 10.0.0.1 dev net1 table 300
- cmd: nohup coredns -conf /Corefile &

- name: HV1
cmds:
- cmd: ip addr add 10.0.0.1/24 dev net0
- cmd: ip addr add 10.0.0.1/24 dev net1
- cmd: ip route add 10.0.0.10/32 dev net0
- cmd: ip route add 10.0.0.11/32 dev net1

0 comments on commit 10470d5

Please sign in to comment.