@@ -77,14 +77,13 @@ Before trying to add a port, let's use the ``polycubectl`` help to get the info
77
77
78
78
Other parameters:
79
79
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
82
81
mac=value string MAC address of the port
83
82
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
85
84
86
85
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.
88
87
89
88
90
89
**Connect ** ``veth1 `` **to ** ``r1 ``
@@ -93,7 +92,7 @@ The output indicates that a port name is expected ``Keyword``, and following it
93
92
::
94
93
95
94
# 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
97
96
# connect port to netdev
98
97
polycubectl connect r1:to_veth1 veth1
99
98
@@ -102,8 +101,8 @@ The router automatically adds a new local entry in the routing table.
102
101
::
103
102
104
103
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
107
106
108
107
109
108
@@ -112,7 +111,7 @@ The router automatically adds a new local entry in the routing table.
112
111
::
113
112
114
113
# 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
116
115
117
116
# connect router port to netdev interface
118
117
polycubectl r1 ports to_veth2 set peer=veth2
@@ -126,7 +125,7 @@ The router automatically adds a new local entry in the routing table.
126
125
127
126
# create new port on r1 and set the IP parameters
128
127
# 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
130
129
131
130
132
131
Step 3: Check configuration
@@ -144,16 +143,16 @@ You should see an output similar to the next one, where ports are ``up`` and hav
144
143
loglevel: info
145
144
146
145
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
151
150
152
151
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
157
156
158
157
159
158
Step 4: Test the connectivity between the namespaces and the router
0 commit comments