-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
146 lines (136 loc) · 3.81 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
version: '3.7'
# 10.0.0.0/24 10.0.1.0/24 10.0.2.0/24 10.0.3.0/24
# llr-client <.3-----.2> llr-netem-wlan <.2-----.3> llr-gateway <.3-----.2> llr-netem-sat <.2-----.3> llr-server
#
# vpn 10.8.0.2-----------------------------10.8.0.1
services:
llr-client:
image: llr
container_name: llr-client
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
volumes:
- ./config:/config:ro
- ./output:/output:rw
command: >
sh -c "ifconfig &&
ip route change default via 10.0.0.2 &&
ip route &&
touch output/client_ready &&
sleep infinity"
depends_on:
- llr-netem-wlan
- llr-gateway
- llr-netem-sat
- llr-server
networks:
llr-net-wlan-left:
ipv4_address: 10.0.0.3
llr-netem-wlan:
image: llr
container_name: llr-netem-wlan
privileged: true
cap_add:
- NET_ADMIN
command: >
sh -c "ifconfig &&
ip route change default via 10.0.1.3 &&
ip route &&
sysctl -w net.ipv4.ip_forward=1 &&
tc qdisc add dev wlanleft0 root handle 1:0 netem loss 1% &&
tc qdisc add dev wlanright0 root handle 1:0 netem loss 1% &&
sleep infinity"
networks:
llr-net-wlan-left:
ipv4_address: 10.0.0.2
llr-net-wlan-right:
ipv4_address: 10.0.1.2
llr-gateway:
image: llr
container_name: llr-gateway
privileged: true
cap_add:
- NET_ADMIN
volumes:
- ./config:/config:ro
command: >
sh -c "ifconfig &&
ifconfig &&
ip route del default &&
ip route add 10.0.0.0/24 via 10.0.1.2 &&
ip route add 10.0.3.0/24 via 10.0.2.2 &&
ip route &&
sysctl -w net.ipv4.ip_forward=1 &&
sleep infinity"
networks:
llr-net-wlan-right:
ipv4_address: 10.0.1.3
llr-net-sat-left:
ipv4_address: 10.0.2.3
llr-netem-sat:
image: llr
container_name: llr-netem-sat
privileged: true
cap_add:
- NET_ADMIN
command: >
sh -c "ifconfig &&
ifconfig &&
ip route change default via 10.0.2.3 &&
ip route &&
sysctl -w net.ipv4.ip_forward=1 &&
tc qdisc add dev satleft0 root handle 1:0 netem delay 100ms &&
tc qdisc add dev satright0 root handle 1:0 netem delay 100ms &&
sleep infinity"
networks:
llr-net-sat-left:
ipv4_address: 10.0.2.2
llr-net-sat-right:
ipv4_address: 10.0.3.2
llr-server:
image: llr
container_name: llr-server
cap_add:
- NET_ADMIN
volumes:
- ./config:/config:ro
- ./output:/output:rw
command: >
sh -c "ifconfig &&
ip route change default via 10.0.3.2 &&
ip route &&
sleep infinity"
networks:
llr-net-sat-right:
ipv4_address: 10.0.3.3
networks:
llr-net-wlan-left:
driver_opts:
com.docker.network.bridge.name: llr-wlan-left
com.docker.network.container_iface_prefix: wlanleft
ipam:
config:
- subnet: "10.0.0.0/24"
llr-net-wlan-right:
driver_opts:
com.docker.network.bridge.name: llr-wlan-right
com.docker.network.container_iface_prefix: wlanright
ipam:
config:
- subnet: "10.0.1.0/24"
llr-net-sat-left:
driver_opts:
com.docker.network.bridge.name: llr-sat-left
com.docker.network.container_iface_prefix: satleft
ipam:
config:
- subnet: "10.0.2.0/24"
llr-net-sat-right:
driver_opts:
com.docker.network.bridge.name: llr-sat-right
com.docker.network.container_iface_prefix: satright
ipam:
config:
- subnet: "10.0.3.0/24"