diff options
Diffstat (limited to 'vnet/build.sh')
-rwxr-xr-x | vnet/build.sh | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/vnet/build.sh b/vnet/build.sh new file mode 100755 index 00000000..36818611 --- /dev/null +++ b/vnet/build.sh | |||
@@ -0,0 +1,89 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | wire() { | ||
4 | ip link add $1 \ | ||
5 | type veth \ | ||
6 | peer name $2 | ||
7 | } | ||
8 | |||
9 | set -x | ||
10 | |||
11 | # Not using this... | ||
12 | buildhub() { | ||
13 | wire hub0 ep0 | ||
14 | wire hub1 ep1 | ||
15 | wire hub2 ep2 | ||
16 | wire hub3 ep3 | ||
17 | wire hub4 ep4 | ||
18 | wire hub5 ep5 | ||
19 | wire hub6 ep6 | ||
20 | wire hub7 ep7 | ||
21 | |||
22 | wire hub8 ep8 | ||
23 | wire hub9 ep9 | ||
24 | wire hubA epA | ||
25 | wire hubB epB | ||
26 | wire hubC epC | ||
27 | wire hubD epD | ||
28 | wire hubE epE | ||
29 | wire hubF epF | ||
30 | |||
31 | brctl addbr hub | ||
32 | brctl addif hub hub0 | ||
33 | brctl addif hub hub1 | ||
34 | brctl addif hub hub2 | ||
35 | brctl addif hub hub3 | ||
36 | brctl addif hub hub4 | ||
37 | brctl addif hub hub5 | ||
38 | brctl addif hub hub6 | ||
39 | brctl addif hub hub7 | ||
40 | brctl addif hub hub8 | ||
41 | brctl addif hub hub9 | ||
42 | brctl addif hub hubA | ||
43 | brctl addif hub hubB | ||
44 | brctl addif hub hubC | ||
45 | brctl addif hub hubD | ||
46 | brctl addif hub hubE | ||
47 | brctl addif hub hubF | ||
48 | |||
49 | ip addr add 222.0.0.1 dev hub | ||
50 | } | ||
51 | |||
52 | # This is simpler... | ||
53 | buildtaps() { | ||
54 | ip tuntap add ep0 mode tap | ||
55 | ip tuntap add ep1 mode tap | ||
56 | ip tuntap add ep2 mode tap | ||
57 | ip tuntap add ep3 mode tap | ||
58 | ip tuntap add ep4 mode tap | ||
59 | ip tuntap add ep5 mode tap | ||
60 | ip tuntap add ep6 mode tap | ||
61 | ip tuntap add ep7 mode tap | ||
62 | ip tuntap add ep8 mode tap | ||
63 | ip tuntap add ep9 mode tap | ||
64 | ip tuntap add epA mode tap | ||
65 | ip tuntap add epB mode tap | ||
66 | ip tuntap add epC mode tap | ||
67 | ip tuntap add epD mode tap | ||
68 | ip tuntap add epE mode tap | ||
69 | ip tuntap add epF mode tap | ||
70 | } | ||
71 | |||
72 | buildtaps | ||
73 | |||
74 | ip addr add 80.99.99.99 dev ep0 | ||
75 | ip addr add 81.99.99.99 dev ep1 | ||
76 | ip addr add 82.99.99.99 dev ep2 | ||
77 | ip addr add 83.99.99.99 dev ep3 | ||
78 | ip addr add 84.99.99.99 dev ep4 | ||
79 | ip addr add 85.99.99.99 dev ep5 | ||
80 | ip addr add 86.99.99.99 dev ep6 | ||
81 | ip addr add 87.99.99.99 dev ep7 | ||
82 | ip addr add 88.99.99.99 dev ep8 | ||
83 | ip addr add 89.99.99.99 dev ep9 | ||
84 | ip addr add 90.99.99.99 dev epA | ||
85 | ip addr add 91.99.99.99 dev epB | ||
86 | ip addr add 92.99.99.99 dev epC | ||
87 | ip addr add 93.99.99.99 dev epD | ||
88 | ip addr add 94.99.99.99 dev epE | ||
89 | ip addr add 95.99.99.99 dev epF | ||