@@ -27,109 +27,111 @@ the Example" section above.
2727![ Diagram] ( network.png )
2828
29291 . Create or use an existing ziti network with at least one edge router. This can be accomplished easily by running
30- ```
31- ziti edge quickstart
32- ```
30+ ```
31+ ziti edge quickstart
32+ ```
3333
3434 after the quickstart runs, you'll have an ephemeral network usable for testing.
3535
36361 . Create at least two ziti identities and give them a common identity role i.e. #zping
37- ```
38- ziti edge create identity client -o client.jwt -a "zping"
39- ziti edge create identity server -o server.jwt -a "zping"
40- ziti edge enroll client.jwt
41- ziti edge enroll server.jwt
42- ```
37+ ```
38+ ziti edge create identity client -o client.jwt -a "zping"
39+ ziti edge create identity server -o server.jwt -a "zping"
40+ ziti edge enroll client.jwt
41+ ziti edge enroll server.jwt
42+ ```
4343
44441 . Create a simple sdk service named "ziti-ping". This is the default service name ` zping ` looks for. You can
4545 override the service by using the ` -s ` flag.
46- ```
47- ziti edge create service ziti-ping
48- ```
46+ ```
47+ ziti edge create service ziti-ping
48+ ```
4949
50501 . Create a bind policy with identityRoles set to [ #zping] and serviceroles set to [ @ziti-ping ] .
51- ```
52- ziti edge create service-policy zping.bind Bind --identity-roles "#zping" --service-roles "@ziti-ping"
53- ```
51+ ```
52+ ziti edge create service-policy zping.bind Bind --identity-roles "#zping" --service-roles "@ziti-ping"
53+ ```
5454
55551 . Create a dial service policy with identityRoles set to [ #zping] and serviceroles set to [ @ziti-ping ] .
56- ```
57- ziti edge create service-policy zping.dial Dial --identity-roles "#zping" --service-roles "@ziti-ping"
58- ```
56+ ```
57+ ziti edge create service-policy zping.dial Dial --identity-roles "#zping" --service-roles "@ziti-ping"
58+ ```
5959
60601 . Ensure that you have created appropriate edge-router and service-edge-router policies allowing the identities access
6161 edge-router(s) and the edge-routers access to the service. Verify by running policy-advisor. Both identities
6262 should be able to dial ** and** bind zping:
6363
64- ```
65- $ ziti edge policy-advisor identities -q
66- ERROR: Default Admin
67- - Identity does not have access to any services. Adjust service policies.
68-
69- OKAY : client (1) -> ziti-ping (1) Common Routers: (1/1) Dial: Y Bind: N
70-
71- OKAY : server (1) -> ziti-ping (1) Common Routers: (1/1) Dial: Y Bind: N
72-
73- ERROR: quickstart-router
74- - Identity does not have access to any services. Adjust service policies.
75- ```
64+ ```
65+ $ ziti edge policy-advisor identities -q
66+ ERROR: Default Admin
67+ - Identity does not have access to any services. Adjust service policies.
68+
69+ OKAY : client (1) -> ziti-ping (1) Common Routers: (1/1) Dial: Y Bind: N
70+
71+ OKAY : server (1) -> ziti-ping (1) Common Routers: (1/1) Dial: Y Bind: N
72+
73+ ERROR: quickstart-router
74+ - Identity does not have access to any services. Adjust service policies.
75+ ```
7676
77771 . In one window run the server
78- ```
79- build/zping server -c server.json
80- ```
81-
82- example:
83- ```
84- $ build/zping server -c server.json
85- INFO[0000] binding service ziti-ping
86-
87- 0xc00040d660 now serving
88-
89- INFO[0000] new service session session token=52e059d2-f166-4561-b5a4-b42056bcd787
90- INFO[0041] new connection
91- ```
78+ ```
79+ build/zping server -c server.json
80+ ```
81+
82+ example:
83+ ```
84+ $ build/zping server -c server.json
85+ INFO[ 0000] binding service ziti-ping
86+
87+ 0xc00040d660 now serving
88+
89+ INFO[ 0000] new service session session token=52e059d2-f166-4561-b5a4-b42056bcd787
90+ INFO[ 0041] new connection
91+ ```
9292
93931. In another window run the client
94- ```
95- build/zping client -c client.json -i server
96- ```
97- ```
98- $ build/zping client -c client.json -i server
99-
100- Sending 100 byte pings to server:
101-
102- 100 bytes from server: ziti_seq=1 time=0.609ms
103- 100 bytes from server: ziti_seq=2 time=0.670ms
104- 100 bytes from server: ziti_seq=3 time=0.381ms
105- 100 bytes from server: ziti_seq=4 time=0.387ms
106- 100 bytes from server: ziti_seq=5 time=0.564ms
107- 100 bytes from server: ziti_seq=6 time=0.455ms
108- 100 bytes from server: ziti_seq=7 time=0.446ms
109- 100 bytes from server: ziti_seq=8 time=0.377ms
110- 100 bytes from server: ziti_seq=9 time=0.455ms
111- 100 bytes from server: ziti_seq=10 time=0.502ms
112- 100 bytes from server: ziti_seq=11 time=0.977ms
113- 100 bytes from server: ziti_seq=12 time=0.487ms
114- ^C
115- --- server ping statistics ---
116- 12 packets transmitted and 12 packets received, 0.00% packet loss
117- round-trip min/max/avg/stddev 0.377/0.977/0.526/0.162 ms
118- ```
94+ ```
95+ build/zping client -c client.json -i server
96+ ```
97+
98+ example:
99+ ```
100+ $ build/zping client -c client.json -i server
101+
102+ Sending 100 byte pings to server:
103+
104+ 100 bytes from server: ziti_seq=1 time=0.609ms
105+ 100 bytes from server: ziti_seq=2 time=0.670ms
106+ 100 bytes from server: ziti_seq=3 time=0.381ms
107+ 100 bytes from server: ziti_seq=4 time=0.387ms
108+ 100 bytes from server: ziti_seq=5 time=0.564ms
109+ 100 bytes from server: ziti_seq=6 time=0.455ms
110+ 100 bytes from server: ziti_seq=7 time=0.446ms
111+ 100 bytes from server: ziti_seq=8 time=0.377ms
112+ 100 bytes from server: ziti_seq=9 time=0.455ms
113+ 100 bytes from server: ziti_seq=10 time=0.502ms
114+ 100 bytes from server: ziti_seq=11 time=0.977ms
115+ 100 bytes from server: ziti_seq=12 time=0.487ms
116+ ^C
117+ --- server ping statistics ---
118+ 12 packets transmitted and 12 packets received, 0.00% packet loss
119+ round-trip min/max/avg/stddev 0.377/0.977/0.526/0.162 ms
120+ ```
119121
1201221. Send 5 zpings from the client to the server using `-n 5`
121- ```
122- $ build/zping client -c client.json -i server -n 5
123-
124- Sending 100 byte pings to server:
125-
126- 100 bytes from server: ziti_seq=1 time=0.349ms
127- 100 bytes from server: ziti_seq=2 time=0.690ms
128- 100 bytes from server: ziti_seq=3 time=0.590ms
129- 100 bytes from server: ziti_seq=4 time=0.429ms
130- 100 bytes from server: ziti_seq=5 time=0.480ms
131-
132- --- server ping statistics ---
133- 5 packets transmitted and 5 packets received, 0.00% packet loss
134- round-trip min/max/avg/stddev 0.349/0.690/0.508/0.120 ms
135- ```
123+ ```
124+ $ build/zping client -c client.json -i server -n 5
125+
126+ Sending 100 byte pings to server:
127+
128+ 100 bytes from server: ziti_seq=1 time=0.349ms
129+ 100 bytes from server: ziti_seq=2 time=0.690ms
130+ 100 bytes from server: ziti_seq=3 time=0.590ms
131+ 100 bytes from server: ziti_seq=4 time=0.429ms
132+ 100 bytes from server: ziti_seq=5 time=0.480ms
133+
134+ --- server ping statistics ---
135+ 5 packets transmitted and 5 packets received, 0.00% packet loss
136+ round-trip min/max/avg/stddev 0.349/0.690/0.508/0.120 ms
137+ ```
0 commit comments