iproute

Get Subnet mask in Linux using bash

风格不统一 提交于 2021-02-18 09:28:09
问题 I am using bash to get the IP address of my machine with that script: _MyGW="$( ip route get 8.8.8.8 | awk 'N=3 {print $N}' )" And now I am trying to get the Subnet Mask in this type: 192.168.1.0/24 But I have no idea how can I do that. 回答1: there are couple of ways to achieve this: first: to print the mask in format 255.255.255.0, you can use this: /sbin/ifconfig wlan0 | awk '/Mask:/{ print $4;} ' second: we can use ip command to get the mask in format 192.168.1.1/24 ip -o -f inet addr show

How to enable tc command when building a kernel using Yocto recipes

三世轮回 提交于 2021-02-10 14:56:19
问题 I want to enable tc command that comes in iproute2 on my linux kernel. My kernel is built using yocto and bitbake. So, I copied the iproute recipes and whole directory from the following link to try -- https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-connectivity/iproute2 And included in my yocto build. That picked up recipe and built it all well. But I tc command is still not available on the built kernel. Question: What am I missing and how to enable tc in the kernel of a linux

How to enable tc command when building a kernel using Yocto recipes

a 夏天 提交于 2021-02-10 14:54:19
问题 I want to enable tc command that comes in iproute2 on my linux kernel. My kernel is built using yocto and bitbake. So, I copied the iproute recipes and whole directory from the following link to try -- https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-connectivity/iproute2 And included in my yocto build. That picked up recipe and built it all well. But I tc command is still not available on the built kernel. Question: What am I missing and how to enable tc in the kernel of a linux

Map sharing between different ebpf program types

China☆狼群 提交于 2021-01-04 08:58:38
问题 Is it possible to share ebpf maps between different program types. I need to share a map between a tc-bpf program and a cgroup bpf program. This should be possible if the map is pinned to file system that act as global namespace. But, I haven't got this working. The map is created by tc-bpf program and pinned to global namespace. Since it is tc-bpf program, the map is of type struct bpf_elf_map. This bpf program is loaded via iproute2. Now, I have a cgroup bpf program that should be accessing

Use ip route add to add multicast routes to multiple devices

两盒软妹~` 提交于 2020-01-03 13:34:21
问题 TLDR: Is there a way to use "ip route" to add multicast routes for multiple NICs? We have software that joins two sockets bound to different ip addresses on separate NICS to two separate multicast groups, eg socket 1 is bound to 192.168.0.2 and joined to multicast group 233.255.10.1 while socket 2 is bound to 10.57.31.2 and joined to multicast group 239.255.100.1. We are currently using a bash script (Linux kernel 3.14.39) to set multicast routes on the two network interfaces using route, eg

iproute2 commands for MPLS configuration

偶尔善良 提交于 2019-12-03 04:32:54
问题 Trying to figure out how one can use iproute2 to manage static label-switched MPLS routes in Linux kernel 4.1. I am aware iproute2 support for MPLS might be incomplete right now [2]. Can anyone please shed some light on what iproute2-4.1.1 is currently able to do? This is what I have found so far: Documentation/networking/mpls-sysctl.txt /proc/sys/net/mpls/platform_labels /proc/sys/net/mpls/conf//input Load mpls module sudo modprobe mpls_router Find sysctl support sysctl -a --pattern mpls net

iproute2 commands for MPLS configuration

血红的双手。 提交于 2019-12-02 18:51:08
Trying to figure out how one can use iproute2 to manage static label-switched MPLS routes in Linux kernel 4.1. I am aware iproute2 support for MPLS might be incomplete right now [2]. Can anyone please shed some light on what iproute2-4.1.1 is currently able to do? This is what I have found so far: Documentation/networking/mpls-sysctl.txt /proc/sys/net/mpls/platform_labels /proc/sys/net/mpls/conf//input Load mpls module sudo modprobe mpls_router Find sysctl support sysctl -a --pattern mpls net.mpls.conf.eth0.input = 0 net.mpls.conf.eth1.input = 0 net.mpls.conf.lo.input = 0 net.mpls.platform