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

root@server-test:/opt# ip addr add dev ens4
# config addr for one port 
root@server-test:/opt# ip addr del dev ens3
# delet addr for one port
root@server-test:/opt# ip addr
# equal with ifconfig
root@server-test:/opt# ip link set ens4 up
# up one port 
root@server-test:/opt# ip -s link ls ens4
# cool cmd, check RX/TX packets, errors, dropped, overrun, mcast
root@server-test:/opt# ip route add default via 
# config default route
root@server-test:/opt# ip route
# check v4 route table
root@server-test:/opt# ip -6 route
# check v6 route table
root@server-test:/opt# echo 'nameserver' > /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:

root@server-test:/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}
            dhcp4: true
                macaddress: 5e:00:00:00:00:00
            set-name: ens3
            dhcp4: no
            addresses: []
                addresses: []
                macaddress: fa:16:3e:47:6c:8a
            set-name: ens4          
    version: 2

After config, update by follow cmd:

root@server-test:/opt# netplan apply

Update Source

root@server-test:/opt# cp /etc/apt/sources.list /etc/apt/sources.list.bak
root@server-test:/opt# nano /etc/apt/sources.list
root@server-test:/opt# more /etc/apt/sources.list
#Ali Source
deb focal main restricted universe multiverse
deb focal-security main restricted universe multiverse
deb focal-updates main restricted universe multiverse
deb focal-proposed main restricted universe multiverse
deb focal-backports main restricted universe multiverse
deb-src focal main restricted universe multiverse

root@server-test:/opt# apt-get update

Compile SRv6 uSID kernel

Get srv6-usid-linux-kernel and Compile

root@server-test:/opt# apt install make
root@server-test:/opt# apt install make-guile
root@server-test:/opt# apt install gcc
root@server-test:/opt# apt install flex
root@server-test:/opt# apt install bison
root@server-test:/opt# apt install libghc-ncurses-dev
root@server-test:/opt# apt install libssl-dev
root@server-test:/opt# apt install libelf-dev
root@server-test:/opt# apt install rpm
root@server-test:/optl# git clone -b srv6-usid-public
# Clone branch kernel from github
root@server-test:/optl# cd srv6-usid-linux-kernel/
root@server-test:/opt/srv6-usid-linux-kernel# make oldconfig
root@server-test:/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 

root@server-test:/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.

root@server-test:/opt/srv6-usid-linux-kernel# make modules_install
# install kernel modules
root@server-test:/opt/srv6-usid-linux-kernel# make install
# install kernel
root@server-test:/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
root@server-test:/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
root@server-test:/opt/srv6-usid-linux-kernel# reboot
# Reboot and choose new kernel

cisco@server-test:~$ 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
cisco@server-test:~$ cat /proc/sys/net/ipv6/seg6_local/usid_block_len
cisco@server-test:~$ cat /proc/sys/net/ipv6/seg6_local/usid_len
# Check whether SRv6 usid kernel work normally

Install/Use new kernel at other 20.04 Server

root@other-server:/home/cisco# apt update
root@other-server:/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
root@other-server:/home/cisco# dpkg -i *
# if everything normal work, will auto update grub and use new kernel

Switch kernel

Check grub:

root@other-server# more /boot/grub/grub.cfg |grep menu
if [ x"${feature_menuentry_id}" = xy ]; then
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

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”:

root@other-server# grep GRUB_DEFAULT /etc/default/grub     
“1” is submenu: 1
“2” is menuentry: 2

Compile iproute2 to support SRv6 uSID

root@server-test:/opt# ip -V
ip utility, iproute2-ss200127
root@server-test:/opt# git clone -b srv6-usid-public
root@server-test:/opt# cd srv6-usid-linux-iproute2/
root@server-test:/opt/srv6-usid-linux-iproute2# make
root@server-test:/opt/srv6-usid-linux-iproute2# make install
root@server-test:/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:

root@server-test:/opt/vpp# find /opt/ -name "*.deb" -print

Install at other 20.04 Server

root@other-server:/opt/vpp# apt install python3-cffi
root@other-server:/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"
root@other-server:/opt/vpp# apt --fix-broken install
# will fix dependence issue, then install again
root@other-server:/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 videos