mpls routing on linux

MPLS Multiprotocol Label Switching is a routing protocol, which works in layer 2.5. It insert a lable between IP layer and protocol layer. This looks like VLAN, which works in layer 1.5 and in subnet. But MPLS works in global internet. Enable MPLS Routing Some distribution may build mpls route as a module, so before start, please check if you have /proc/sys/net/mpls/, if not, then load the module first: 1 2 3 4 5 6 7 # modprobe mpls_router # modprobe mpls_iptunnel # lsmod | grep mpls mpls_iptunnel 16384 0 mpls_router 36864 1 mpls_iptunnel ip_tunnel 28672 1 mpls_router If failed, then we need to enable CONFIG_MPLS, CONFIG_MPLS_ROUTING, CONFIG_MPLS_IPTUNNEL when compile the kernel.

tc/BPF and XDP/BPF

What is eBPF Reference: bpf The extended Berkeley Packet Filter (eBPF) has first appeared in Kernel 3.18. The original version is being referred to “classic” BPF (cBPF) . cBPF is known to many as being the packet filter language used by tcpdump. Nowadays, the Linux kernel runs eBPF only and loaded cBPF bytecode is transparently translated into an eBPF representation in the kernel before program execution. The eBPF networking specific use including loading BPF programs with tc (traffic control) and XDP (eXpress Data Path).

common problems

Python in RHEL8 Use alternatives --set python /usr/bin/python3 to set a specific version Reference Python in RHEL8 and the reason

grub

Apart from edit /boot/grub2/grub.cfg or /etc/grub2.cfg. We’d better use grubby to config grub. Here is the example of how to select default grub. 1 2 3 4 5 6 7 8 9 10 11 12 13 # grubby --default-kernel /boot/vmlinuz-4.20.0 # grubby --default-index 1 # grubby --set-default-index 0 # grubby --default-index 0 # grubby --default-kernel /boot/vmlinuz-4.20.0+ Grub missing If grub missing due to anyreason, and you are fall back to grub menu, you can try

linux tc usage

TC, means traffic control, can be achieved by using queuing disciplines(qdisc). Here is an example picture Classes There are two kinds of qdiscs, classless and classfull. Classless qciscs can only have a single scheduler assigned, can’t contain more classes Pfifo: limits the size of a queue by packtets Bfifo: limits the size of a queue by bytes Pfifo_fast: contains 3 fifo queues, from 0 to 2. 0 get the packets