Skip to content

Commit 1e2dc48

Browse files
Documentation: tutorial and documentation updated with the new notation
(from netmask to prefix len) Signed-off-by: Francesco Messina <francescomessina92@hotmail.com>
1 parent f01f6ec commit 1e2dc48

File tree

3 files changed

+32
-33
lines changed

3 files changed

+32
-33
lines changed

Documentation/cubes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ For instance:
158158
# create port2 on br1 (simplebridge), it doesn't require any further parameters
159159
polycubectl br1 ports add port2
160160

161-
# create portX on r1 (router), it requires ip and netmask parameters
162-
polycubectl r1 ports add port1 ip=10.0.1.1 netmask=255.255.255.0
163-
polycubectl r1 ports add port2 ip=10.0.2.1 netmask=255.255.255.0
164-
polycubectl r1 ports add port1 ip=10.0.3.1 netmask=255.255.255.0
161+
# create portX on r1 (router), it doesn't require mandatory parameters, but it is useful to assign an ip (during or after creation)
162+
polycubectl r1 ports add port1 ip=10.0.1.1/24
163+
polycubectl r1 ports add port2 ip=10.0.2.1/24
164+
polycubectl r1 ports add port1 ip=10.0.3.1/24
165165

166166
Connect Ports
167167
^^^^^^^^^^^^^

Documentation/tutorials/tutorial2/tutorial2.rst

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,13 @@ Before trying to add a port, let's use the ``polycubectl`` help to get the info
7777

7878
Other parameters:
7979
peer=value string Peer name, such as a network interfaces (e.g., 'veth0') or another cube (e.g., 'br1:port2')
80-
ip=value string IP address of the port
81-
netmask=value string Netmask of the port
80+
ip=value string IP address and prefix of the port
8281
mac=value string MAC address of the port
8382
Example:
84-
polycubectl r1 ports add port1 peer=r0:port1 ip=207.46.130.1 netmask=255.255.255.0 mac=B3:23:45:F5:3A
83+
polycubectl r1 ports add port1 peer=r0:port1 ip=207.46.130.1/24 mac=B3:23:45:F5:3A
8584

8685

87-
The output indicates that a port name is expected ``Keyword``, and following it the ``peer``, ``ip``, ``netmask`` and ``mac`` are supported parameters.
86+
The output indicates that a port name is expected ``Keyword``, and following it the ``peer``, ``ip`` and ``mac`` are supported parameters.
8887

8988

9089
**Connect** ``veth1`` **to** ``r1``
@@ -93,7 +92,7 @@ The output indicates that a port name is expected ``Keyword``, and following it
9392
::
9493

9594
# create new port on r1 and set the IP parameters
96-
polycubectl r1 ports add to_veth1 ip=10.0.1.254 netmask=255.255.255.0
95+
polycubectl r1 ports add to_veth1 ip=10.0.1.254/24
9796
# connect port to netdev
9897
polycubectl connect r1:to_veth1 veth1
9998

@@ -102,8 +101,8 @@ The router automatically adds a new local entry in the routing table.
102101
::
103102

104103
polycubectl r1 show route
105-
interface netmask network nexthop pathcost
106-
to_veth1 255.255.255.0 10.0.1.0 local 0
104+
interface network nexthop pathcost
105+
to_veth1 10.0.1.0/24 local 0
107106

108107

109108

@@ -112,7 +111,7 @@ The router automatically adds a new local entry in the routing table.
112111
::
113112

114113
# create new port on r1 and set the IP parameters
115-
polycubectl r1 ports add to_veth2 ip=10.0.2.254 netmask=255.255.255.0
114+
polycubectl r1 ports add to_veth2 ip=10.0.2.254/24
116115

117116
# connect router port to netdev interface
118117
polycubectl r1 ports to_veth2 set peer=veth2
@@ -126,7 +125,7 @@ The router automatically adds a new local entry in the routing table.
126125

127126
# create new port on r1 and set the IP parameters
128127
# notice that in this case 'peer' is also set so the port is also connected to the netdev
129-
polycubectl r1 ports add to_veth3 ip=10.0.3.254 netmask=255.255.255.0 peer=veth3
128+
polycubectl r1 ports add to_veth3 ip=10.0.3.254/24 peer=veth3
130129

131130

132131
Step 3: Check configuration
@@ -144,16 +143,16 @@ You should see an output similar to the next one, where ports are ``up`` and hav
144143
loglevel: info
145144

146145
ports:
147-
name uuid status peer ip netmask mac
148-
to_veth3 c51bb0ed-9e6f-44ed-a096-b13bc1011331 up veth3 10.0.3.254 255.255.255.0 72:59:a8:c2:c2:44
149-
to_veth2 48f8d130-aa32-4354-a1b5-105df9a8ad7b up veth2 10.0.2.254 255.255.255.0 d6:42:7f:65:b4:40
150-
to_veth1 46c685b9-4c80-4466-9d81-985598a07444 up veth1 10.0.1.254 255.255.255.0 52:f0:5f:2c:a5:a7
146+
name uuid status peer ip mac
147+
to_veth3 c51bb0ed-9e6f-44ed-a096-b13bc1011331 up veth3 10.0.3.254/24 72:59:a8:c2:c2:44
148+
to_veth2 48f8d130-aa32-4354-a1b5-105df9a8ad7b up veth2 10.0.2.254/24 d6:42:7f:65:b4:40
149+
to_veth1 46c685b9-4c80-4466-9d81-985598a07444 up veth1 10.0.1.254/24 52:f0:5f:2c:a5:a7
151150

152151
route:
153-
network netmask nexthop interface pathcost
154-
10.0.1.0 255.255.255.0 local to_veth1 0
155-
10.0.2.0 255.255.255.0 local to_veth2 0
156-
10.0.3.0 255.255.255.0 local to_veth3 0
152+
network nexthop interface pathcost
153+
10.0.1.0/24 local to_veth1 0
154+
10.0.2.0/24 local to_veth2 0
155+
10.0.3.0/24 local to_veth3 0
157156

158157

159158
Step 4: Test the connectivity between the namespaces and the router

Documentation/tutorials/tutorial3/tutorial3.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Step 3: Add and connect ports on routers
103103
::
104104

105105
# Create new port on r1 and set the IP parameters
106-
polycubectl r1 ports add to_br1 ip=10.0.1.254 netmask=255.255.255.0
106+
polycubectl r1 ports add to_br1 ip=10.0.1.254/24
107107
# Create a bridge interface on br1
108108
polycubectl br1 ports add to_r1
109109
# Connect both ports
@@ -117,15 +117,15 @@ In order to permit more networks on the same router interface we need to add a s
117117
::
118118

119119
# Add a secondary address on r1 interface `to_br1`
120-
polycubectl r1 ports to_br1 secondaryip add 10.0.2.254 255.255.255.0
120+
polycubectl r1 ports to_br1 secondaryip add 10.0.2.254/24
121121

122122

123123
**Connect** ``r2`` **to** ``br2``
124124

125125
::
126126

127127
# Create new port on r2 and set the IP parameters
128-
polycubectl r2 ports add to_br2 ip=10.0.3.254 netmask=255.255.255.0
128+
polycubectl r2 ports add to_br2 ip=10.0.3.254/24
129129

130130
# Create a bridge interface on br2
131131
polycubectl br2 ports add to_r2
@@ -139,8 +139,8 @@ In the router ``r2`` we have three different networks, so we need to add two sec
139139
::
140140

141141
# Add the secondary addresses on r2 interface `to_br2`
142-
polycubectl r2 ports to_br2 secondaryip add 10.0.4.254 255.255.255.0
143-
polycubectl r2 ports to_br2 secondaryip add 10.0.5.254 255.255.255.0
142+
polycubectl r2 ports to_br2 secondaryip add 10.0.4.254/24
143+
polycubectl r2 ports to_br2 secondaryip add 10.0.5.254/24
144144

145145
**Connect the routers**
146146

@@ -149,8 +149,8 @@ We need to create a point-to-point link between the routers to connect them. To
149149
::
150150

151151
# Create new port on r1 and r2 and set the IP parameters
152-
polycubectl r1 ports add to_r2 ip=10.1.0.1 netmask=255.255.255.252
153-
polycubectl r2 ports add to_r1 ip=10.1.0.2 netmask=255.255.255.252
152+
polycubectl r1 ports add to_r2 ip=10.1.0.1/30
153+
polycubectl r2 ports add to_r1 ip=10.1.0.2/30
154154

155155
# Connects the routers
156156
polycubectl connect r1:to_r2 r2:to_r1
@@ -164,9 +164,9 @@ We need to tell the router `r1` which are the networks reachable through `r2`
164164

165165
::
166166

167-
polycubectl r1 route add 10.0.3.0 255.255.255.0 10.1.0.2
168-
polycubectl r1 route add 10.0.4.0 255.255.255.0 10.1.0.2
169-
polycubectl r1 route add 10.0.5.0 255.255.255.0 10.1.0.2
167+
polycubectl r1 route add 10.0.3.0/24 10.1.0.2
168+
polycubectl r1 route add 10.0.4.0/24 10.1.0.2
169+
polycubectl r1 route add 10.0.5.0/24 10.1.0.2
170170

171171

172172
**Add static entries in the routing table of router `r2`**
@@ -175,8 +175,8 @@ We need to do the same on the router `r2`
175175

176176
::
177177

178-
polycubectl r2 route add 10.0.1.0 255.255.255.0 10.1.0.1
179-
polycubectl r2 route add 10.0.2.0 255.255.255.0 10.1.0.1
178+
polycubectl r2 route add 10.0.1.0/24 10.1.0.1
179+
polycubectl r2 route add 10.0.2.0/24 10.1.0.1
180180

181181

182182
**Show the routing tables of the routers**

0 commit comments

Comments
 (0)