Skip to main content

Questions tagged [iproute]

Questions that include employing tools of the IPROUTE2 Utility Suite, especially ip and tc.

Filter by
Sorted by
Tagged with
108 votes
7 answers
264k views

List ports a process PID is listening on (preferably using iproute2 tools)?

I'm looking to list all ports a PID is currently listening on. How would you recommend I get this kind of data about a process?
ThorSummoner's user avatar
  • 4,512
108 votes
3 answers
285k views

How can I create a virtual ethernet interface on a machine without a physical adapter?

I have a Dell XPS 13 ultrabook which has a wifi nic, but no physical ethernet nic (wlan0, but no eth0). I need to create a virtual adapter for using Vagrant with NFS, but am finding that the typical ...
STW's user avatar
  • 2,311
49 votes
3 answers
85k views

How can I bridge two interfaces with ip/iproute2?

I know how to create a bridge using brctl, but I have been advised not to use this anymore, and to use iproute2 or ip instead(since brctl is deprecated presumably). Assuming this is good advice, how ...
Totem's user avatar
  • 1,111
45 votes
3 answers
75k views

alternative to "netstat -s"

netstat -s prints out a lot of very detailed protocol statistics like number of TCP reset messages received or number of ICMP "echo request" messages sent or number of packets dropped because of a ...
Martin's user avatar
  • 7,686
32 votes
2 answers
91k views

Is it possible to have multiple default gateways for outbound connections?

I would like to have multiple NICs (eth0 and wlan0) in the same subnet and to serve as a backup for the applications on the host if one of the NICs fail. For this reason I have created an additional ...
rosix's user avatar
  • 1,063
30 votes
2 answers
36k views

How to understand (the output of) ifconfig or ip addr show [closed]

The ifconfig command dumps a lot of information at you, especially if you have a lot of interfaces, and you don't know where they come from. I've read through the "Ifconfig Command - Explained in ...
Ari Sweedler's user avatar
25 votes
4 answers
56k views

Can I create a virtual ethernet interface named eth0?

I am running Arch based on the Linux 3.10.5-1 kernel. The system uses the new de-facto naming conventions of ethernet interfaces enp*s* and wlp* etc. This is a problem however, as my educational ...
Steen Schütt's user avatar
18 votes
4 answers
3k views

Where is the official documentation (Debian package iproute-doc)?

Manpage of ss says: FILTER := [ state TCP-STATE ] [ EXPRESSION ] Please take a look at the official documentation (Debian package iproute-doc) for details regarding filters. What does that mean? I ...
Tim's user avatar
  • 104k
18 votes
1 answer
23k views

Linux as router with multiple internet providers

Linux as router: I have 3 Internet providers, each with its own modem. Provider1, which is gateway address 192.168.1.1 Connected to linux router eth1/192.168.1.2 Provider2, gateway address 192.168.2....
Flav's user avatar
  • 183
17 votes
4 answers
16k views

'ip addr' command shows 'UP' even there is no address associated with that interface

I would like to understand what is meant by an network interface up? Because ip addr or ifconfig command shows an interface as up even when there is no IP associated with it. for example on RHEL7 : [...
Srikanth Ganesan's user avatar
16 votes
5 answers
7k views

Pretty display of "ip route"

I'd like to use more of the iproute2 (ip command) utility instead of the deprecated net-tools (ifconfig, route, ...). The main reason I keep going back to net-tools is the output of ip route which in ...
Gohu's user avatar
  • 2,174
15 votes
1 answer
21k views

Understanding ip route output

I am learning about Linux routing, routing tables, IP routing, etc... The following is the output from ip route followed by the output of route: default via 192.168.1.1 dev wlp0s20f3 proto dhcp ...
RhythmInk's user avatar
  • 531
13 votes
1 answer
2k views

What's the exact behaviour of the command: ip address change?

I have been fiddling with IPv6 and address lifetimes. I found out that the valid_lft attribute will make a v6-address disappear automagically, if used correctly. To extend an address' lifetime I would ...
Bananguin's user avatar
  • 8,040
12 votes
1 answer
25k views

what do the numbers mean in ip rule show command

If I type ip rule show command in my machine, I get the output as, 0: from all lookup local 32766: from all lookup main 32767: from all lookup default What do the numbers 0,32766 and 32767 mean?...
Ramesh's user avatar
  • 39.7k
12 votes
2 answers
19k views

The difference between ip link down and physical link absence

In Linux, is there any difference between after-ip link down-condition and real link absence (e.g. the switch's port burned down, or someone tripped over a wire). By difference I mean some signs in ...
red0ct's user avatar
  • 655
11 votes
0 answers
1k views

Why is the default output of ss so strange? [duplicate]

When I run ss -tnlp to display all programs listening for tcp connections (something I do rather often) I get something like this: Despite the terminal being wide enough, ss chooses to split some ...
Patrick's user avatar
  • 359
10 votes
3 answers
46k views

route traffic out different gateway by destination network

I have several gateways and would like to route some traffic out of different gateways based on its destination. I'm guessing I'd need to use a combination of iproute2 and iptables rules, but am not ...
Walter's user avatar
  • 1,234
10 votes
1 answer
4k views

ss not showing all ports being listened on

After doing a ssh -fND 1080 localhost, ssh will listen on port 1080 to provide the SOCKS service: box:~$ netstat -ln|grep 1080 tcp 0 0 127.0.0.1:1080 0.0.0.0:* ...
Evgeniy Berezovsky's user avatar
9 votes
2 answers
11k views

What is the difference between `/sbin/ip route` and `/sbin/route`?

Linux comes with two utilities /sbin/route /sbin/ip route What is the difference between the two and what is the rule of thumb to use when you decide which one of the two you should use? I know they'...
Evan Carroll's user avatar
  • 32.3k
9 votes
2 answers
3k views

iproute2: How to display the TYPE of a network devices?

With iproute2 userspace tools one can display the network devices using the ip commands verb link show( sometimes shortened to l sh ). The output generate does not display the TYPE of link/interface ...
fraleone's user avatar
  • 837
8 votes
2 answers
39k views

ip route add fails with next hop invalid although next hop on directly connected network

When I check the routing table I get following information: root@vmi24:/home/user# ip route default via 194.104.212.225 dev eth0 onlink 194.104.212.224/27 via 194.104.212.225 dev eth0 When i want to ...
Patrick De Groote's user avatar
8 votes
2 answers
10k views

iproute2 command to enable a IPv4 address

I am investigating how to have iproute2 commands replace the old ifconfig and ifup ifdown command, and I found out something interesting. My NIC setup is: [16:07:41 root@vm network-scripts ]# cat /...
sylye's user avatar
  • 656
8 votes
2 answers
5k views

How do I find all interfaces that have been configured in Linux, including those of containers?

I know that you can display interfaces by doing ip a show. That only displays the interfaces that the host can see, but virtual interfaces configured by containers don't appear in this list. I've ...
munchkin's user avatar
  • 123
8 votes
1 answer
11k views

How can I get the ipv4 address from `ip link` like I used to see with ifconfig?

When I run ip to get the ip address, I'm getting $ ip link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:...
Evan Carroll's user avatar
  • 32.3k
8 votes
2 answers
4k views

What is the relation between iproute and iproute2?

I'm little confused about the two packages in linux. Which one should I use? Does iproute2 obsolete iproute? Do they have different linux kernel dependency? Why change the package name, instead of ...
cizixs's user avatar
  • 181
8 votes
2 answers
1k views

Simulate ethernet cable unplugged on a remote machine while staying connected

I am working from home on remote embedded Linux machine "X" via ssh. It has one physical network card. I need to simulate Ethernet cable unplugged condition on the same remote machine "X" , while ...
Reuelit Bat Patish's user avatar
8 votes
1 answer
4k views

What do I need to add a virtual IPsec adapter?

I'm trying to set up an IPsec connection manually from the console with iproute2. What I need is a virtual interface (at best, a virtual IP address could also be sufficient) that IPsec-transforms ...
Marste's user avatar
  • 193
7 votes
2 answers
5k views

What exactly does these ip lines do?

I found these lines awhile ago reading forums, that allow me to access ssh from inside my VPN when it's turned on. Can someone explain what they do so I may tweak it to allow other traffic from ...
rathel's user avatar
  • 71
7 votes
2 answers
18k views

How can I bring up a non-boot (ONBOOT=no) network interface with iproute2?

Have a network interface that does not come up on boot-up: [belminf@tito ~]$ grep ONBOOT /etc/sysconfig/network-scripts/ifcfg-enp0s3 ONBOOT=no I know I could do the following for DHCP: [belminf@...
Belmin Fernandez's user avatar
7 votes
2 answers
8k views

iptables: what the difference between filter and mangle

I am using iptables to to mark the package and want to route based on the marks. First I added the ip rule: sudo ip rule add fwmark 1 prohibit (The "prohibit" is just for test, I will change it to ...
platinor's user avatar
  • 245
7 votes
2 answers
11k views

Where is this IPv6 address coming from?

TL;DR: Is there a command to display why each IPv6 address has been assigned to a given NIC? e.g. to show which router advertised that prefix. Details I have set up my network to use IPv6 addresses ...
Malvineous's user avatar
  • 7,083
7 votes
1 answer
7k views

add route in Linux if sub-net, where gateway is situated, is not configured

I have a PC which has 192.168.1.1/24 configured to eth0 interface. Now if I try to add routes via 10.10.10.254, the ip utility reports that No such process: root@PC:~# ip neigh add 10.10.10.254 ...
Martin's user avatar
  • 7,686
7 votes
3 answers
19k views

Delete IP address alias by label name

I would like to delete an alias I created using: ip addr add 192.168.1.1 dev eth0 label eth0:100 without having to know the IP address. Basically, I would like to do ip addr del dev eth0 label eth0....
bcolpron's user avatar
7 votes
0 answers
4k views

Using ip, what does M-DOWN mean?

When using the terminal tool ip, there is a number of flags for every interface. Example: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue What is the meaning of M-DOWN? ...
R_SS's user avatar
  • 181
6 votes
3 answers
21k views

Is there a way to save current state of network configuration in linux into a datafile or set of ip commands like iptables-save?

Let's say I ran quite a few ip commands and ended up with a required network configuration, but I didn't save the command history. Instead of rewriting commands in a file or script again, is there a ...
GP92's user avatar
  • 855
6 votes
1 answer
10k views

Connecting two network namespaces via a veth interface pair where each endpoint has the same name

Is there a single (simple) command that will create a veth interface pair and assign each interface to a different network namespace? For example, suppose that I have two namespaces: mynamespace-1 ...
igal's user avatar
  • 10k
6 votes
1 answer
1k views

What constraints (if any) are there on network interface names on linux

In https://stackoverflow.com/questions/24932172/what-length-can-a-network-interface-name-have, it was asked how long a network interface name could be (apparently 16 bytes). However, the answers to ...
James Tocknell's user avatar
6 votes
1 answer
2k views

Why does `systemd-nspawn -n` network namespace not show in `ip netns list`?

tl;dr Linux has namespaces, in particular, network namespaces. It seems the namespace supposedly created via the -n flag when running systemd-nspwawn does not show up when employing ip netns list (...
humanityANDpeace's user avatar
6 votes
2 answers
3k views

How to get `ip addr show` to only show links of a specific type

How does one get ip addr show to only show links of a specific type, without using a secondary process like grep to do filtering? According to man 8 ip-address, this should be possible using the ...
Gary van der Merwe's user avatar
6 votes
1 answer
7k views

ip link add gives me an error that it's not supported

I would like to set up a bridge with iproute2 like this: Adding bridge : ip link add name br0 type bridge Bringing bridge UP : ip link set dev br0 up Adding interface to bridge : ip link set dev eth1 ...
apuboard's user avatar
  • 187
6 votes
0 answers
977 views

Why does a network interface lose its IP address when moved to a different network namespace?

Suppose I use ip-link(8) to create an interface, test-macvlan, and assign it the address 10.11.12.13: # ip link add link eno1 name test-macvlan type macvlan # ip address add 10.11.12.13 dev test-...
sjy's user avatar
  • 906
5 votes
1 answer
2k views

How to get numerical output in `ip route` command

When using route command, -n switch does the trick. How to get numerical output using ip route command? It's man page does not mention anything similar. Specifically I need 0.0.0.0 instead of default.
zaadeh's user avatar
  • 1,203
5 votes
1 answer
2k views

What's ndisc_cache?

Suppose I want to use : $ ip ntable show dev eth0 inet arp_cache dev eth0 refcnt 4 reachable 20744 base_reachable 30000 retrans 1000 gc_stale 60000 delay_probe 5000 queue 31 ...
PersianGulf's user avatar
5 votes
1 answer
8k views

Translating this `ip` command to `route` command in `post-up` hook

I am having trouble getting a static routing ip command to become permanent by way of the post-up hook in /etc/network/interfaces. Here are the relevant details: /etc/network/interfaces # The loopback ...
111---'s user avatar
  • 4,596
5 votes
1 answer
1k views

what does the wildcard expression mean in command ss?

ss -lnt State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 127.0.0.53%lo:53 0.0.0.0:* LISTEN 0 128 0....
zzzgoo's user avatar
  • 223
5 votes
2 answers
3k views

iproute2 Inherit or Copy Table

I've setup source policy routing on a Linux "router" using : ip rule add from 192.168.1.0/24 table FOO ip route add default dev eth0 table FOO Packets forwarded from that subnet reach Internet ...
robut's user avatar
  • 433
5 votes
2 answers
2k views

what's the format spec for `ss -D `?

Background of the question: I am trying to sum up the total bandwidth, but ss -i cleverly converted numbers to more readable format like Kbps/s or Mbps/s, which is not accurate. So does ss -o with ...
est's user avatar
  • 205
5 votes
3 answers
6k views

Debian ignores static IPv6 configuration

Original post I'm trying to configure a static IPv6 address for my Debian container (running on LXD) but the system keeps ignoring my configuration. Currently my /etc/network/interfaces looks like ...
Daniel's user avatar
  • 153
5 votes
2 answers
7k views

Not permitted to add eth0 to bond0

I'm trying to add an interface to my bond0 but I always get the error. sudo ip link set dev eth0 master bond0 RTNETLINK answers: Operation not permitted I already tried it with sudo and with ...
apuboard's user avatar
  • 187
4 votes
2 answers
10k views

Direct connection w/ ethernet cable

This is for "research" not pragmatic purposes -- I want to know how this is supposed to work, since my guess below does not. In other words, I do not want an answer that involves /etc/network/...
goldilocks's user avatar
  • 88.4k

1
2 3 4 5
7