Compile SRv6 uSID and VPP on ubuntu 20.04

PS: Compile Server base on “focal-server-cloudimg-amd64.vmdk”, 20200706 update.

General Config on ubuntu

Config port by new “ip” cmd, and DNS

[email protected]:/opt# ip addr add 10.75.37.59/24 dev ens4
# config addr for one port 
[email protected]:/opt# ip addr del 172.16.1.163/24 dev ens3
# delet addr for one port
[email protected]:/opt# ip addr
# equal with ifconfig
[email protected]:/opt# ip link set ens4 up
# up one port 
[email protected]:/opt# ip -s link ls ens4
# cool cmd, check RX/TX packets, errors, dropped, overrun, mcast
[email protected]:/opt# ip route add default via 10.75.37.1 
# config default route
[email protected]:/opt# ip route
# check v4 route table
[email protected]:/opt# ip -6 route
# check v6 route table
[email protected]:/opt# echo 'nameserver 64.104.123.144' > /etc/resolv.conf

Permanent IP/DNS Config

Above cmd is temporary, after reboot, the config will disappear. If you want to permanent config IP/DNS, can config “netplan” that use YAML format:

[email protected]:/opt# more /etc/netplan/50-cloud-init.yaml 
# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        ens3:
            dhcp4: true
            match:
                macaddress: 5e:00:00:00:00:00
            set-name: ens3
        ens4:
            dhcp4: no
            addresses: [10.75.37.59/24]
            gateway4: 10.75.37.1
            nameservers:
                addresses: [64.104.123.144]
            match:
                macaddress: fa:16:3e:47:6c:8a
            set-name: ens4          
    version: 2

After config, update by follow cmd:

[email protected]:/opt# netplan apply

Update Source

[email protected]:/opt# cp /etc/apt/sources.list /etc/apt/sources.list.bak
[email protected]:/opt# nano /etc/apt/sources.list
[email protected]:/opt# more /etc/apt/sources.list
#Ali Source
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

[email protected]:/opt# apt-get update

Compile SRv6 uSID kernel

Get srv6-usid-linux-kernel and Compile

[email protected]:/opt# apt install make
[email protected]:/opt# apt install make-guile
[email protected]:/opt# apt install gcc
[email protected]:/opt# apt install flex
[email protected]:/opt# apt install bison
[email protected]:/opt# apt install libghc-ncurses-dev
[email protected]:/opt# apt install libssl-dev
[email protected]:/opt# apt install libelf-dev
[email protected]:/opt# apt install rpm
[email protected]:/opt#
[email protected]:/optl# git clone -b srv6-usid-public https://github.com/netgroup/srv6-usid-linux-kernel.git
# Clone branch kernel from github
[email protected]:/optl# cd srv6-usid-linux-kernel/
[email protected]:/opt/srv6-usid-linux-kernel# make oldconfig
[email protected]:/opt/srv6-usid-linux-kernel# make menuconfig
# Choose moduel from kernel
# Linux will choose ".config" for default profile, if you change another name
# in menuconfig, that will not use when compile. Btw, if you want to default
# menuconfig, direct to "rm -rf .config" that is ok.
#
# check enable follow items
# Networking support
#   Networking options
#     The IPv6 protocol
#       IPv6: Segment Routing HMAC support
#       IPv6: Segment Routing Header encapsulation support 

[email protected]:/opt/srv6-usid-linux-kernel# make
# Compile, That will take about 2-3 hours at first compile. If you change
# some menuconfig and compile again, that will fast because the compiled
# package will not be compiled again.

[email protected]:/opt/srv6-usid-linux-kernel# make modules_install
# install kernel modules
[email protected]:/opt/srv6-usid-linux-kernel# make install
# install kernel
[email protected]:/opt/srv6-usid-linux-kernel# make help | grep deb
# check how to build kernel to rpm
# diff make have diff option, can check by the cmd
[email protected]:/opt/srv6-usid-linux-kernel# make deb-pkg
# re-compile and generate deb pacakage, if rpm, change other cmd
# move to other ubuntu 20.04 and direct install
# as follow example
[email protected]:/opt/srv6-usid-linux-kernel# reboot
# Reboot and choose new kernel

[email protected]:~$ uname -a
Linux server-test 5.6.0+ #2 SMP Wed Jul 8 12:20:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[email protected]:~$ cat /proc/sys/net/ipv6/seg6_local/usid_block_len
32
[email protected]:~$ cat /proc/sys/net/ipv6/seg6_local/usid_len
16
# Check whether SRv6 usid kernel work normally

Install/Use new kernel at other 20.04 Server

[email protected]:/home/cisco# apt update
[email protected]:/home/cisco# ls -l
total 970232
-rw-r--r-- 1 root root   7627564 Jul 10 12:51 linux-headers-5.6.0+_5.6.0+-1_amd64.deb
-rw-r--r-- 1 root root 923395452 Jul 10 13:08 linux-image-5.6.0+-dbg_5.6.0+-1_amd64.deb
-rw-r--r-- 1 root root  61396560 Jul 10 12:52 linux-image-5.6.0+_5.6.0+-1_amd64.deb
-rw-r--r-- 1 root root   1082292 Jul 10 12:51 linux-libc-dev_5.6.0+-1_amd64.deb
[email protected]:/home/cisco#
[email protected]:/home/cisco# dpkg -i *
# if everything normal work, will auto update grub and use new kernel

Switch kernel

Check grub:

[email protected]# more /boot/grub/grub.cfg |grep menu
if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
  menuentry_id_option=""
export menuentry_id_option
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-bf0b9c12-4f13-4550-abd4-73136c300301' {
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-bf0b9c12-4f13-4550-abd4-73136c300301' {
        menuentry 'Ubuntu, with Linux 5.6.0+' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.6.0+-advanced-bf0b9c12-4f13-4550-abd4-73136c300301' {
        menuentry 'Ubuntu, with Linux 5.6.0+ (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.6.0+-recovery-bf0b9c12-4f13-4550-abd4-73136c300301' {
        menuentry 'Ubuntu, with Linux 5.4.0-40-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-40-generic-advanced-bf0b9c12-4f13-4550-abd4-73136c300301' {
        menuentry 'Ubuntu, with Linux 5.4.0-40-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-40-generic-recovery-bf0b9c12-4f13-4550-abd4-73136c300301' {
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
[email protected]:/opt/trex/v2.81# 

Boot id as follow summary:

menuentry: 0
submenu: 1
menuentry: 0 ‘Ubuntu, with Linux 5.6.0+’
menuentry: 1 ‘Ubuntu, with Linux 5.6.0+ (recovery mode)’
menuentry: 2 ‘Ubuntu, with Linux 5.4.0-40-generic’
menuentry: 3 ‘Ubuntu, with Linux 5.4.0-40-generic (recovery mode)’

Now boot by 5.6.0, if want to boot by 5.4.0, change “/etc/default/grub”:

[email protected]# grep GRUB_DEFAULT /etc/default/grub     
GRUB_DEFAULT="1>2"
“1” is submenu: 1
“2” is menuentry: 2

Compile iproute2 to support SRv6 uSID

[email protected]:/opt# ip -V
ip utility, iproute2-ss200127
[email protected]:/opt#
[email protected]:/opt# git clone -b srv6-usid-public https://github.com/netgroup/srv6-usid-linux-iproute2.git
[email protected]:/opt# cd srv6-usid-linux-iproute2/
[email protected]:/opt/srv6-usid-linux-iproute2# make
[email protected]:/opt/srv6-usid-linux-iproute2# make install
[email protected]:/opt/srv6-usid-linux-iproute2# ip -V
ip utility, iproute2-ss200330

From iproute2’s “make help”, not have build rpm or deb option, but we can direct tar the folder that includes the compiled file. Then move the tar file to other ubuntu, then extract tar file and direct to “make install”, we do not require a compile environment.

Compile vpp 20.09 on ubuntu 20.04

Compile vpp

Compile guide please follow: Building VPP Commands

Get vpp pacakages

After compiled by “make pkg-deb”, will generate follow packages that can be direct installed at other ubuntu 20.04:

[email protected]:/opt/vpp# find /opt/ -name "*.deb" -print
/opt/vpp/build-root/vpp-plugin-core_20.09-rc0~193-gea7e7087d_amd64.deb
/opt/vpp/build-root/libvppinfra-dev_20.09-rc0~193-gea7e7087d_amd64.deb
/opt/vpp/build-root/vpp-plugin-dpdk_20.09-rc0~193-gea7e7087d_amd64.deb
/opt/vpp/build-root/python3-vpp-api_20.09-rc0~193-gea7e7087d_amd64.deb
/opt/vpp/build-root/libvppinfra_20.09-rc0~193-gea7e7087d_amd64.deb
/opt/vpp/build-root/vpp-dbg_20.09-rc0~193-gea7e7087d_amd64.deb
/opt/vpp/build-root/vpp-dev_20.09-rc0~193-gea7e7087d_amd64.deb
/opt/vpp/build-root/vpp-api-python_20.09-rc0~193-gea7e7087d_amd64.deb
/opt/vpp/build-root/vpp_20.09-rc0~193-gea7e7087d_amd64.deb

Install at other 20.04 Server

[email protected]:/opt/vpp# apt install python3-cffi
[email protected]:/opt/vpp# dpkg -i *
# maybe you will have "Errors were encountered while processing"
# find the miss pacakage, install, will report "run 'apt --fix-broken install' to correct"
[email protected]:/opt/vpp# apt --fix-broken install
# will fix dependence issue, then install again
[email protected]:/opt/vpp# dpkg -i *

DX6 Demo by uSID

DX6 on Linux by uSID

DX4 Demo by uSID

waiting update

本文出自 Frank's Blog

版权声明:


本文链接:Compile SRv6 uSID and VPP on ubuntu 20.04
版权声明:本文为原创文章,仅代表个人观点,版权归 Frank Zhao 所有,转载时请注明本文出处及文章链接
你可以留言,或者trackback 从你的网站

留言哦

blonde teen swallows load.xxx videos