Skip to content

Commit

Permalink
Added more test configs and silenced sysctl
Browse files Browse the repository at this point in the history
  • Loading branch information
grapheo12 committed Feb 4, 2021
1 parent ebce78a commit 254d39f
Show file tree
Hide file tree
Showing 4 changed files with 225 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/namespaces/namespaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func RemoveNamespace(ns string) {

func PrintNamespace(ns string) {
fmt.Printf("ip netns add %s\n", ns)
fmt.Printf("ip netns exec %s sysctl -w net.ipv4.ip_forward=1\n", ns)
fmt.Printf("ip netns exec %s sysctl -wq net.ipv4.ip_forward=1\n", ns)
fmt.Printf("ip netns exec %s ip link set lo up\n", ns)
}

Expand Down
50 changes: 50 additions & 0 deletions test/test2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
namespaces:
- N1
- N2
- N3
- N4

devices:
veth:
- V1:
namespace: N1
peer: V2
ip: 10.0.10.66/24

- V2:
namespace: N2
ip: 10.0.10.67/24

- V3:
namespace: N2
peer: V4
ip: 10.0.20.66/24

- V4:
namespace: N3
ip: 10.0.20.67/24

- V5:
namespace: N3
peer: V6
ip: 10.0.30.66/24

- V6:
namespace: N4
ip: 10.0.30.67/24

routes:
N1:
V1:
- 10.0.20.0/24:10.0.10.67
- 10.0.30.0/24:10.0.10.67
N2:
V3:
- 10.0.30.0/24:10.0.20.67
N3:
V4:
- 10.0.10.0/24:10.0.20.66
N4:
V6:
- 10.0.20.0/24:10.0.30.66
- 10.0.10.0/24:10.0.30.66
96 changes: 96 additions & 0 deletions test/test3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
namespaces:
- H1
- H2
- H3
- H4
- R1
- R2
- R3

devices:
veth:
- V1:
namespace: H1
peer: V2
ip: 10.0.10.66/24
- V2:
namespace: R1
ip: 10.0.10.67/24

- V3:
namespace: H2
peer: V4
ip: 10.0.20.66/24
- V4:
namespace: R1
ip: 10.0.20.67/24

- V5:
namespace: R1
peer: V6
ip: 10.0.30.66/24
- V6:
namespace: R2
ip: 10.0.30.67/24

- V7:
namespace: R2
peer: V8
ip: 10.0.40.66/24
- V8:
namespace: R3
ip: 10.0.40.67/24

- V9:
namespace: R3
peer: V10
ip: 10.0.50.66/24
- V10:
namespace: H3
ip: 10.0.50.67/24

- V11:
namespace: R3
peer: V12
ip: 10.0.60.66/24
- V12:
namespace: H4
ip: 10.0.60.67/24


routes:
H1:
V1:
- 10.0.0.0/16:10.0.10.67

H2:
V3:
- 10.0.0.0/16:10.0.20.67

H3:
V10:
- 10.0.0.0/16:10.0.50.66

H4:
V12:
- 10.0.0.0/16:10.0.60.66

R1:
V5:
- 10.0.40.0/24:10.0.30.67
- 10.0.50.0/24:10.0.30.67
- 10.0.60.0/24:10.0.30.67

R2:
V6:
- 10.0.10.0/24:10.0.30.66
- 10.0.20.0/24:10.0.30.66
V7:
- 10.0.50.0/24:10.0.40.67
- 10.0.60.0/24:10.0.40.67

R3:
V8:
- 10.0.30.0/24:10.0.40.66
- 10.0.10.0/24:10.0.40.66
- 10.0.20.0/24:10.0.40.66
78 changes: 78 additions & 0 deletions test/test4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
namespaces:
- N1
- N2
- N3
- N4
- N5
- N6

devices:
veth:
- V1:
namespace: N1
peer: V2
ip: 10.0.10.66/24
- V2:
namespace: N2
ip: 10.0.10.67/24

- V3:
namespace: N2
peer: V4
ip: 10.0.20.66/24
- V4:
namespace: N3
ip: 10.0.20.67/24

- V5:
namespace: N3
peer: V6
ip: 10.0.30.66/24
- V6:
namespace: N4
ip: 10.0.30.67/24

- V7:
namespace: N4
peer: V8
ip: 10.0.40.66/24
- V8:
namespace: N5
ip: 10.0.40.67/24

- V9:
namespace: N5
peer: V10
ip: 10.0.50.66/24
- V10:
namespace: N6
ip: 10.0.50.67/24

- V11:
namespace: N6
peer: V12
ip: 10.0.60.66/24
- V12:
namespace: N1
ip: 10.0.60.67/24


routes:
N1:
V1:
- 10.0.0.0/16:10.0.10.67
N2:
V3:
- 10.0.0.0/16:10.0.20.67
N3:
V5:
- 10.0.0.0/16:10.0.30.67
N4:
V7:
- 10.0.0.0/16:10.0.40.67
N5:
V9:
- 10.0.0.0/16:10.0.50.67
N6:
V11:
- 10.0.0.0/16:10.0.60.67

0 comments on commit 254d39f

Please sign in to comment.