StoneWork + GNS3

[Tutorial] StoneWork + GNS3 (Complete)

PANTHEON.tech has made StoneWork available on the GNS 3 marketplace. This makes it easy for anybody to try out our all-in-one solution, which combines multiple cloud-native network functions from our CNF portfolio, in a separate environment.

This tutorial will give you the basics on how to set-up StoneWork in an environment, where you can safely test out interaction and its positioning within your (simulated) network.

The goal of this tutorial is to have a basic setup, where we will:

  • Setup StoneWork interface IP address
  • Set the status of StoneWork to UP
  • Verify the connection by pinging the address

Components

StoneWork is a solution which, thanks to its modular architecture, enables you to combine multiple CNFs from the CNF portfolio, using only one data-plane, to increase the overall throughput, while keeping rich functionality.

GNS3 emulates network software, so you can try different virtual or real appliances in a completely separate environment and simulate a complex network.

Requirements

Setup the Environment: StoneWork in GNS3

After setting up your Linux environment and installing GNS3 on your distro of choice,

  1. Create a new project. We will call this one StoneWork Demo Run.
  2. Go to FileImport appliance and import both Alpine Linux & StoneWork Mini files. They will be saved as templates.
  3. Install the appliances. The default option we used is Install the appliance on your local computer. GNS3 will then inform you, in which category the appliance will appear.
  4. You will find both appliances by clicking on the next to last button, Browse all devices, on the left-side toolbar of GNS3.
gns3 appliances

Here, we can find all the imported and default appliances in GNS3

5. Drag both Alpine Linux & StoneWork Mini to the environment in the middle. Wait for the appliances to finish downloading.

6. Under the button for Browse all devices, click on Add a link. You will now be able to link both appliances together, to create a connection.

7. Click on AlpineLinux-1, and select the only available interface – eth0. Then click on StoneWorkmini-1, and select eth0 as well.

8. Click on the green button in the horizontal toolbar, to start all appliances.

StoneWork + GNS3 - Running Appliances

Both appliances are running and green-lit

Congratulations! The topology is set up and we will now continue the setup, in order for Alpine Linux and StoneWork to be able to ping (send packets to) each other.

9. Right-click on AlpineLinux-1 and select Console.

10. In the console window, type in ip add to view the IP addresses linking towards Alpine Linux.

ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
7: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
    link/ether b6:74:c3:ad:4f:a5 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::b474:c3ff:fead:4fa5/64 scope link 
       valid_lft forever preferred_lft forever

11. Then, add the following command to edit the IP address:

ip addr add 10.0.0.1/24 dev eth0

12. Verify the IP address by typing ip add again. The entire output should look like this:

/ # ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
7: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
    link/ether b6:74:c3:ad:4f:a5 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::b474:c3ff:fead:4fa5/64 scope link 
       valid_lft forever preferred_lft forever

Verify Connection: StoneWork in GNS3

Important: You can access the console for Alpine Linux via Right Click – Console, but StoneWork is accessed via Right Click – Auxiliary Console. Something to keep in mind, while commanding both instances.

We want to connect the interface, as well as connect both appliances.

  1. We will need to set up the configuration of StoneWork via CLI. Right-click on StoneWorkmini-1 and select Auxiliary Console. The path to StoneWork config should be the same as below. The entire command should look like this:
    cat /etc/stonework/config/day0-config.yaml
  2. If you want to change the StoneWork config, you will need to edit this file. The file should look like this:
    vppConfig:
      interfaces:
      - name: "my-eth0"
        type: AF_PACKET
        enabled: false
        physAddress: "3e:af:13:8f:a5:ba"
        afpacket:
          hostIfName: "eth0"
      - name: "my-eth1"
        type: AF_PACKET
        enabled: false
        physAddress: "52:12:91:be:c7:00"
        afpacket:
          hostIfName: "eth1"
      - name: "my-eth2"
        type: AF_PACKET
        enabled: false
        physAddress: "46:89:d6:41:44:29"
        afpacket:
          hostIfName: "eth2"
      - name: "my-eth3"
        type: AF_PACKET
        enabled: false
        physAddress: "2a:f6:78:04:64:7f"
        afpacket:
          hostIfName: "eth3"
      - name: "my-eth4"
        type: AF_PACKET
        enabled: false
        physAddress: "76:3d:2f:56:22:0f"
        afpacket:
          hostIfName: "eth4"
    
  3. To edit the config, we will edit the file via VIM:
    vim /etc/stonework/config/day0-config.yaml
  4. On your keyboard, click the A key to edit the file.
  5. In the file, set my-eth0 set enabled to true (instead of the default false). This way we make sure, that the interface will be UP & running.
  6. Then, type I on your keyboard to insert the following lines into the config, under enabled: true:
    ipAddresses:
    - "10.0.0.2/24"
  7. Save changes with ESC – colon (:) – w
  8. To exit VIM, type ESC – colon – q
  9. To update the configuration in StoneWork itself, type in the following command:
    agentctl config update --replace /etc/stonework/config/day0-config.yaml

Verify Updated Config in StoneWork

We have successfully set up the configuration of StoneWork! Now, we will verify the update in StoneWork.

  1. Type in the following command to the Auxiliary console of StoneWorkmin-1:
    agentctl config history
  2. The output will look like this:
    # agentctl config history
      SEQ  TYPE            START  INPUT      OPERATIONS          RESULT  SUMMARY                
      0    status sync     44m    <none>     <none>                      <none>                 
      1    config replace  44m    30 values  CREATE:5            ok      CONFIGURED:5           
      2    status update   43m    1  values  CREATE:1            ok      OBTAINED:1             
      3    status update   43m    1  values  CREATE:1            ok      OBTAINED:1             
      4    status update   43m    1  values  CREATE:1            ok      OBTAINED:1             
      5    status update   43m    1  values  CREATE:1            ok      OBTAINED:1             
      6    status update   43m    1  values  CREATE:1            ok      OBTAINED:1             
      7    config replace  5m     35 values  CREATE:3, UPDATE:1  ok      CONFIGURED:4           
      8    status update   5m     2  values  CREATE:1, DELETE:1  ok      OBTAINED:1, REMOVED:1  
    / # 
    
  3.  To double-check the settings in the VPP data-plane, type in vppctl into the same Terminal window, then show int. You should see, that the State of eth0 is up
     vppctl
        _______    _        _   _____  ___ 
     __/ __/ _   (_)__    | | / / _ / _ 
     _/ _// // / / / _    | |/ / ___/ ___/
     /_/ /____(_)_/___/   |___/_/  /_/    
    
    vpp# show int
                  Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count     
    host-eth0                         1      up          9000/0/0/0     rx packets                    16
                                                                        rx bytes                    1120
                                                                        drops                         16
                                                                        ip6                           16
    host-eth1                         2     down         9000/0/0/0     
    host-eth2                         3     down         9000/0/0/0     
    host-eth3                         4     down         9000/0/0/0     
    host-eth4                         5     down         9000/0/0/0     
    local0                            0     down          0/0/0/0
  4. To verify the IP address we’ve set up for StoneWork, type in show int addr :
    vpp# show int addr
    host-eth0 (up):
      L3 10.0.0.2/24
    host-eth1 (dn):
    host-eth2 (dn):
    host-eth3 (dn):
    host-eth4 (dn):
    local0 (dn):
    

    With everything set up correctly, we will make both appliances ping each other, to verify their connection.

Ping: StoneWork & Alpine Linux

The setup of our IP addresses looks like this:

  • Alpine Linux appliance (AlpineLinux-1): 10.0.0.1
  • StoneWork (StoneWorkmini-1): 10.0.0.2

Now, you can ping both ways with the following commands:

  • AlpineLinux-1: Open Console, type in ping 10.0.0.2
    / # ping 10.0.0.2
    PING 10.0.0.2 (10.0.0.2): 56 data bytes
    64 bytes from 10.0.0.2: seq=0 ttl=64 time=1.812 ms
    64 bytes from 10.0.0.2: seq=1 ttl=64 time=0.759 ms
    64 bytes from 10.0.0.2: seq=2 ttl=64 time=1.012 ms
    64 bytes from 10.0.0.2: seq=3 ttl=64 time=2.590 ms
    ^C
    --- 10.0.0.2 ping statistics ---
    4 packets transmitted, 4 packets received, 0% packet loss
    round-trip min/avg/max = 0.759/1.543/2.590 ms
  • StoneWorkmini-1: Open Auxiliary Console, type in vppctl, then ping 10.0.0.1
    vpp# ping 10.0.0.1
    116 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=2.6766 ms
    116 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=.8829 ms
    116 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=2.2815 ms
    116 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=3.2285 ms
    116 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=2.1995 ms
    
    Statistics: 5 sent, 5 received, 0% packet loss

Congratulations again! You have managed to set up StoneWork in GNS3. The purpose of this tutorial was to show you how to set up StoneWork in GNS3, in a separate environment, so you can test & play around with it.

Make sure to:

  • Contact us, if you are interested in StoneWork for commercial purposes. This demo showed a minimalistic distribution of StoneWork.
  • Check out CDNF.io for more CNFs

(Update, 5th of April 2021 – StoneWork is available on the GNS3 marketplace!)


by Július Milan & Filip Čúzy | Leave us your feedback on this post!

You can contact us here!

Explore our PANTHEON.tech GitHub.

Watch our YouTube Channel.