Skip to content

Commit

Permalink
Documentation: tutorial and documentation updated with the new notation
Browse files Browse the repository at this point in the history
(from netmask to prefix len)

Signed-off-by: Francesco Messina <francescomessina92@hotmail.com>
  • Loading branch information
francescomessina committed Jul 24, 2019
1 parent f01f6ec commit 1e2dc48
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 33 deletions.
8 changes: 4 additions & 4 deletions Documentation/cubes.rst
Expand Up @@ -158,10 +158,10 @@ For instance:
# create port2 on br1 (simplebridge), it doesn't require any further parameters
polycubectl br1 ports add port2

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

Connect Ports
^^^^^^^^^^^^^
Expand Down
33 changes: 16 additions & 17 deletions Documentation/tutorials/tutorial2/tutorial2.rst
Expand Up @@ -77,14 +77,13 @@ Before trying to add a port, let's use the ``polycubectl`` help to get the info

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


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


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

# create new port on r1 and set the IP parameters
polycubectl r1 ports add to_veth1 ip=10.0.1.254 netmask=255.255.255.0
polycubectl r1 ports add to_veth1 ip=10.0.1.254/24
# connect port to netdev
polycubectl connect r1:to_veth1 veth1

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

polycubectl r1 show route
interface netmask network nexthop pathcost
to_veth1 255.255.255.0 10.0.1.0 local 0
interface network nexthop pathcost
to_veth1 10.0.1.0/24 local 0



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

# create new port on r1 and set the IP parameters
polycubectl r1 ports add to_veth2 ip=10.0.2.254 netmask=255.255.255.0
polycubectl r1 ports add to_veth2 ip=10.0.2.254/24

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

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


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

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

route:
network netmask nexthop interface pathcost
10.0.1.0 255.255.255.0 local to_veth1 0
10.0.2.0 255.255.255.0 local to_veth2 0
10.0.3.0 255.255.255.0 local to_veth3 0
network nexthop interface pathcost
10.0.1.0/24 local to_veth1 0
10.0.2.0/24 local to_veth2 0
10.0.3.0/24 local to_veth3 0


Step 4: Test the connectivity between the namespaces and the router
Expand Down
24 changes: 12 additions & 12 deletions Documentation/tutorials/tutorial3/tutorial3.rst
Expand Up @@ -103,7 +103,7 @@ Step 3: Add and connect ports on routers
::

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

# Add a secondary address on r1 interface `to_br1`
polycubectl r1 ports to_br1 secondaryip add 10.0.2.254 255.255.255.0
polycubectl r1 ports to_br1 secondaryip add 10.0.2.254/24


**Connect** ``r2`` **to** ``br2``

::

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

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

# Add the secondary addresses on r2 interface `to_br2`
polycubectl r2 ports to_br2 secondaryip add 10.0.4.254 255.255.255.0
polycubectl r2 ports to_br2 secondaryip add 10.0.5.254 255.255.255.0
polycubectl r2 ports to_br2 secondaryip add 10.0.4.254/24
polycubectl r2 ports to_br2 secondaryip add 10.0.5.254/24

**Connect the routers**

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

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

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

::

polycubectl r1 route add 10.0.3.0 255.255.255.0 10.1.0.2
polycubectl r1 route add 10.0.4.0 255.255.255.0 10.1.0.2
polycubectl r1 route add 10.0.5.0 255.255.255.0 10.1.0.2
polycubectl r1 route add 10.0.3.0/24 10.1.0.2
polycubectl r1 route add 10.0.4.0/24 10.1.0.2
polycubectl r1 route add 10.0.5.0/24 10.1.0.2


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

::

polycubectl r2 route add 10.0.1.0 255.255.255.0 10.1.0.1
polycubectl r2 route add 10.0.2.0 255.255.255.0 10.1.0.1
polycubectl r2 route add 10.0.1.0/24 10.1.0.1
polycubectl r2 route add 10.0.2.0/24 10.1.0.1


**Show the routing tables of the routers**
Expand Down

0 comments on commit 1e2dc48

Please sign in to comment.