-
Notifications
You must be signed in to change notification settings - Fork 1
/
commands.txt
274 lines (259 loc) · 7.46 KB
/
commands.txt
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
#0-01
cat /etc/lsb-release
uname -a
#0-02
docker version && docker-compose version
#0-03
docker images
#0-04
docker ps
#0-05
python3 --version
#0-06
python3 -m pip install snappi==1.14.0
#0-07
git clone https://github.com/open-traffic-generator/ac2-workshop.git
#1-01
docker pull ghcr.io/open-traffic-generator/keng-controller:1.14.0-1
docker pull ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.8.0.99
#1-02
docker images
docker ps
#1-03
sudo ip link add name veth0 type veth peer name veth1 && sudo ip link set dev veth0 up && sudo ip link set dev veth1 up
ip link
#1-04
docker run -d --name controller --network=host ghcr.io/open-traffic-generator/keng-controller:1.14.0-1 --http-port 8443 --accept-eula
#1-05
docker run -d --name traffic-engine-1 --network=host -e ARG_IFACE_LIST=virtual@af_packet,veth0 -e OPT_NO_HUGEPAGES=Yes --privileged -e OPT_LISTEN_PORT=5551 ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.8.0.99
#1-06
docker run -d --name traffic-engine-2 --network=host -e ARG_IFACE_LIST=virtual@af_packet,veth1 -e OPT_NO_HUGEPAGES=Yes --privileged -e OPT_LISTEN_PORT=5552 ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.8.0.99
#1-07
docker ps -a
#1-08
cd ~/ac2-workshop/lab-01
#1-09
vim lab-01_test.py
#1-10
python3 lab-01_test.py
#1-11
cat /proc/net/dev > counters1.log
#1-12
curl -k -d '{"choice":"flow"}' -X POST https://127.0.0.1:8443/monitor/metrics
curl -k -d '{"choice":"port"}' -X POST https://127.0.0.1:8443/monitor/metrics
#1-13
vim lab-01_test.py
#1-14
git diff
#1-15
python3 lab-01_test.py
#1-16
cat /proc/net/dev > counters2.log
diff counters1.log counters2.log
#1-17
docker ps -a
#1-18
bash -c "$(curl -sL https://get.otgcdn.net/otgen)" -- -v 0.6.2
#1-19
curl -k https://127.0.0.1:8443/config > ./lab-01-config.json
#1-20
more lab-01-config.json
#1-21
otgen run -k -a https://127.0.0.1:8443 -f lab-01-config.json -m flow | otgen transform -m flow | otgen display --mode table
#1-22
otgen run -k -a https://127.0.0.1:8443 -f lab-01-config.json -m port | otgen transform -m port | otgen display --mode table
#1-23
vi lab-01-config.json
#1-24
otgen run -k -a https://127.0.0.1:8443 -f lab-01-config.json -m flow | otgen transform -m flow | otgen display --mode table
#1-25
export OTG_API="https://localhost:8443"
export OTG_LOCATION_P1="localhost:5551"
export OTG_LOCATION_P2="localhost:5552"
#1-26
otgen create flow -s 1.1.1.1 -d 2.2.2.2 -p 80 --rate 100 --count 2000 | otgen run --insecure --metrics flow | otgen transform --metrics flow –counters \ frames | otgen display --mode table
#1-27
curl -k https://127.0.0.1:8443/config
#1-28
docker stop traffic-engine-1 traffic-engine-2 controller && docker rm traffic-engine-1 traffic-engine-2 controller
#1-29
docker ps -a
docker images
#1-30
sudo ip link delete veth0
#1-31
ip link && ip addr
#2-01
cd ~/ac2-workshop/lab-02
cat compose.yml
#2-02
docker-compose -f compose.yml up -d
sudo bash connect_containers_veth.sh lab-02_traffic_engine_1_1 lab-02_traffic_engine_2_1 veth0 veth1
#2-03
docker ps
#2-04
docker logs lab-02_traffic_engine_1_1
#2-05
docker logs lab-02_traffic_engine_2_1
#2-06
docker network ls
docker inspect lab-02_default
#2-07
docker network ls
docker inspect lab-02_default
#2-08
vi lab-02_test.py
#2-09
python3 lab-02_test.py
#2-10
curl -k -d '{"choice":"bgpv4"}' -X POST https://127.0.0.1:8443/monitor/metrics
#2-11
curl -k -d '{"choice":"ipv4_neighbors"}' -X POST https://127.0.0.1:8443/monitor/states
#2-12
curl -k -d '{"choice":"bgp_prefixes"}' -X POST https://127.0.0.1:8443/monitor/states
#2-13
vi lab-02_test.py
#2-14
sudo apt install tshark -y
ll
#2-15
tshark -r prx.pcap
#2-16
nano lab-02_test.py
#2-17
python3 lab-02_test.py
#2-18
nano lab-02_test.py
#2-19
tshark -r prx.pcap -Y tcp
#2-20
docker-compose down
#2-21
sudo ip netns del lab-02_traffic_engine_1_1 && sudo ip netns del lab-02_traffic_engine_2_1
#3-00
bash -c "$(curl -sL https://get.containerlab.dev)" -- -v 0.59.0
#3-01
cd ~/ac2-workshop/lab-03 && cat lab-03.yml
#3-02
sudo containerlab deploy -t lab-03.yml
#3-03
vi lab-03-1_test.py
#3-04
cat lab-03-1_test.py
#3-05
python3 lab-03-1_test.py
#3-06
cp lab-03-1_test.py lab-03-2_test.py
vi lab-03-2_test.py
#3-07
python3 lab-03-2_test.py
#3-08
vim lab-03-2_test.py
#3-09
ssh admin@clab-lab-03-srl
#3-10
enter candidate
set qos rewrite-rules dscp-policy test-rewrite map FC1 dscp 30
commit now
quit
#3-11
python3 lab-03-2_test.py
#3-12
sudo containerlab destroy -t lab-03.yml --cleanup
#4-01
cd ~/ac2-workshop/lab-04 && cat lab-04.yml
#4-02
sudo containerlab deploy -t lab-04.yml
#4-03
vim lab-04-1_test.py
#4-04
git diff lab-04-1_test.py
#4-05
ssh admin@clab-lab-04-srl
#4-06
watch show network-instance default protocols bgp routes ipv4 summary
#4-07
python3 lab-04-1_test.py
#4-08
curl -k -d '{"choice":"bgpv4"}' -X POST https://clab-lab-04-ixia-c:8443/monitor/metrics
#4-09
curl -k -d '{"choice":"bgp_prefixes"}' -X POST https://clab-lab-04-ixia-c:8443/monitor/states
#4-10
curl -k -d '{"choice":"flow"}' -X POST https://clab-lab-04-ixia-c:8443/monitor/metrics
#4-11
vim lab-04-1_test.py
#4-12
python3 lab-04-1_test.py
#4-13
vim lab-04-1_test.py
#4-14
python3 lab-04-1_test.py
#4-15
sudo containerlab destroy -t lab-04.yml --cleanup
#5-01
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
#5-02
curl -LO https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
#5-03
cd ~ && wget https://go.dev/dl/go1.23.2.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.23.2.linux-amd64.tar.gz
#5-04
export PATH=$PATH:/usr/local/go/bin && echo ""export PATH=$PATH:/usr/local/go/bin"" >> ~/.bashrc
go version
#5-05
wget https://github.com/openconfig/kne/archive/refs/tags/v0.2.1.tar.gz && tar -xvzf v0.2.1.tar.gz
cd kne-0.2.1 && make install
#5-06
bash -c "$(curl -sL https://get-gnmic.openconfig.net)"
#5-07
cd ~/ac2-workshop/lab-05 && cat kind-bridge.yaml
#5-08
cat ixiatg-configmap.yaml
#5-09
kne deploy kind-bridge.yaml
#5-10
kubectl get pods -A
#5-11
./load.sh
#5-12
cat ixia-c-b2b.textproto
#5-13
kne create ixia-c-b2b.textproto
#5-14
kubectl get pods -n ixia-c-b2b -o wide
kubectl get services -n ixia-c-b2b
#5-15
kubectl describe pods otg-port-eth1 -n ixia-c-b2b
#5-16
kubectl get services -n ixia-c-b2b
#5-17
vim lab-05-1_test.py
#5-18
python3 lab-05-1_test.py
#5-19
vim lab-05-2_test.py
#5-20
python3 lab-05-2_test.py
#5-21
vim lab-05-3_test.go
#5-22
go test -v lab-05-3_test.go
#5-23
kubectl get services -n ixia-c-b2b
#5-24
vim lab-05-3_test.go
#5-25
go test -v lab-05-3_test.go
#5-26
kubectl describe pods otg-controller -n ixia-c-b2b
#5-27
kubectl get services -n ixia-c-b2b
#5-28
gnmic -a 172.18.0.85:50051 --skip-verify -u admin -p admin get --path "flows"
#5-29
gnmic -a 172.18.0.85:50051 --skip-verify -u admin -p admin get --path "bgp-peers"
#5-30
kind delete cluster --name kne