Questions tagged [iproute]

Program to control policy-based routing tables

59 questions
28
votes
5 answers

Get Subnet mask in Linux using bash

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.
ValeriRangelov
  • 603
  • 2
  • 8
  • 18
12
votes
1 answer

iproute2 commands for MPLS configuration

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…
user2798118
  • 385
  • 1
  • 2
  • 16
9
votes
1 answer

Map sharing between different ebpf program types

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…
user1727270
  • 303
  • 1
  • 3
  • 10
5
votes
0 answers

Use ip route add to add multicast routes to multiple devices

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…
gnac
  • 1,573
  • 15
  • 17
5
votes
1 answer

What could prevent frequently switching default source ip of a machine with several interfaces

The goal was to frequently change default outgoing source ip on a machine with multiple interfaces and live ips. I used ip route replace default as per its documentation and let a script run in loop for some interval. It changes source ip fine for a…
fkl
  • 5,412
  • 4
  • 28
  • 68
4
votes
0 answers

Monitoring network namespaces

Is there a way to monitor netns creation/deletion in the kernel? iproute2 provides means to monitor this but it does by using inotify, looking for creation/deletion of a netns fd in /var/run/netns. Often times a netns is created without an entry in…
NetCubist
  • 61
  • 2
  • 6
2
votes
1 answer

Main difference between ebpf loaders

If I understood well there are different ebpf loaders: bpf_load.c into the kernel source code libbpf bpftool tc ... <-- others? Which are the main differences between them? Are they always interchangeably? Should I always prefer libbpf?
Maicake
  • 1,046
  • 10
  • 34
2
votes
0 answers

NETEM: how to define a Gaussian distribution without specifying standard deviation?

I am using Netem to generate a Gaussian distribution profile for one-way delay. I have read that the command sudo tc qdisc change dev eth2 root netem delay 100ms 20ms distribution normal will make the distribution of delay normal between the range…
ElenaPhys
  • 443
  • 2
  • 5
  • 16
2
votes
0 answers

How to convert policy routing rules using "all" and "iif" to OpenWRT's UCI format?

I would understand if it's possible, and if yes how, to convert the following rules to OpenWRT UCI format using the rule directive: ip rule add to all table 111 pref 4 ip rule add from 10.0.0.1/24 lookup 113 pref 32768 ip rule add iif lo lookup 113…
nemesisdesign
  • 8,159
  • 12
  • 58
  • 97
2
votes
1 answer

Apply NetEM WAN delay on a docker container interface

I want to apply NetEm delay on the egress traffic of a docker container. Usually, I run: # /sbin/tc qdisc add dev $INTERFACE root netem delay ${DELAY}ms The issue is that I have no idea about the interface to which the container is connected…
gaetano
  • 865
  • 1
  • 15
  • 29
1
vote
0 answers

Error: Specified qdisc not found with tc inside docker

I am trying to use tc to emulate network conditions inside docker containers. My linux is an ubuntu 20.04 LTS inside WSL2. For this, I am running the container with docker run -it --cap-add=NET_ADMIN ubuntu:latest Then inside the docker…
N. Rak
  • 132
  • 2
  • 12
1
vote
1 answer

Multiple IPs from ISP with DHCP. (OpenWRT or iproute2, macvlan???)

Problem: I want 2 IPs so that I can run two servers on my LAN. Apparently my ISP doesn't allow static IPs and I need to use DHCP to obtain my second IP. What I have learned so far: In order to get two distinct IP addresses with DHCP, you need two…
Hackerman21
  • 23
  • 1
  • 5
1
vote
1 answer

Enable 'tc' of iproute2 package on YOCTO

We're trying to enable Traffic Control (tc) on YOCTO (warrior dist.), while it seems that tc was indeed built into the YOCTO image, when trying to apply a tc filter command we're getting this error: Error: TC classifier not found This is the full…
Nadav
  • 563
  • 3
  • 17
1
vote
1 answer

How to get XDP program into kernel with iproute2?

I am using "ip link" command to put xdp program into kernel, in my virtual machine(kernel-version:4.18) command like this: ip link set dev ens33 xdp obj xdpsock_kern.o sec .text but after this command, the error said: No ELF library support…
Vector
  • 67
  • 1
  • 5
1
vote
1 answer

How can i pass a macvtap interface to a lxc container with libvirt

I have create a macvtap interface like that : $ ip link add link wlan0 name gitea type macvtap $ ip link set gitea address 68:61:6b:67:69:74 up $ ip link show gitea 10: gitea@wlan0: mtu 1500 qdisc pfifo_fast state…
Aisenp
  • 13
  • 3
1
2 3 4