Skip to content

Commit

Permalink
Merge pull request #32 from slankdev/slankdev-add-example-sysctl
Browse files Browse the repository at this point in the history
examples: basic_sysctl
  • Loading branch information
AkiRa committed Feb 6, 2020
2 parents 509cb04 + 953b942 commit e9bf903
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/basic_sysctl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# sysctl example
```
tinet up | sh
tinet test all | sh
echo R1 sysctl state
docker exec R1 sysctl net.ipv4.ip_forward
docker exec R1 sysctl net.ipv4.ip_forward_use_pmtu
docker exec R1 sysctl net.ipv6.conf.all.forwarding
docker exec R1 sysctl net.ipv6.conf.all.disable_ipv6
echo R2 sysctl state
docker exec R2 sysctl net.ipv4.ip_forward
docker exec R2 sysctl net.ipv4.ip_forward_use_pmtu
docker exec R2 sysctl net.ipv6.conf.all.forwarding
docker exec R2 sysctl net.ipv6.conf.all.disable_ipv6
```
36 changes: 36 additions & 0 deletions examples/basic_sysctl/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

nodes:
- name: R1
image: slankdev/ubuntu:18.04
interfaces:
- { name: net0, type: direct, args: R2#net0 }
sysctls:
- { sysctl: net.ipv4.ip_forward=1 }
- { sysctl: net.ipv4.ip_forward_use_pmtu=1 }
- { sysctl: net.ipv6.conf.all.forwarding=1 }
- { sysctl: net.ipv6.conf.all.disable_ipv6=1 }

- name: R2
image: slankdev/ubuntu:18.04
interfaces:
- { name: net0, type: direct, args: R1#net0 }
sysctls:
- { sysctl: net.ipv4.ip_forward=0 }
- { sysctl: net.ipv4.ip_forward_use_pmtu=0 }
- { sysctl: net.ipv6.conf.all.forwarding=0 }
- { sysctl: net.ipv6.conf.all.disable_ipv6=0 }

test:
- name: all
cmds:
- cmd: echo R1 sysctl state
- cmd: docker exec R1 sysctl net.ipv4.ip_forward
- cmd: docker exec R1 sysctl net.ipv4.ip_forward_use_pmtu
- cmd: docker exec R1 sysctl net.ipv6.conf.all.forwarding
- cmd: docker exec R1 sysctl net.ipv6.conf.all.disable_ipv6
- cmd: echo R2 sysctl state
- cmd: docker exec R2 sysctl net.ipv4.ip_forward
- cmd: docker exec R2 sysctl net.ipv4.ip_forward_use_pmtu
- cmd: docker exec R2 sysctl net.ipv6.conf.all.forwarding
- cmd: docker exec R2 sysctl net.ipv6.conf.all.disable_ipv6

0 comments on commit e9bf903

Please sign in to comment.