User Tools

Site Tools


exclude_virtual_interfaces_in_ip_command

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
exclude_virtual_interfaces_in_ip_command [2023/04/03 14:55] walkeradminexclude_virtual_interfaces_in_ip_command [2023/04/07 17:01] walkeradmin
Line 62: Line 62:
 veth2199c7d1@if2 UP             fe80::f4c1:e4ff:fefa:465c/64 veth2199c7d1@if2 UP             fe80::f4c1:e4ff:fefa:465c/64
 </file> </file>
 +Unfortunately, the vethxxxxxx interfaces will cause the physical interface details at the top of the list out of the view of the console, so what we really need is a way to filter this result. This can be done using grep and a filter to format our output.
 +    ip -br -c a |grep -v veth
 +\\ 
 +This will hide anything containing the letters veth.
 +<file>
 +lo               UNKNOWN        127.0.0.1/8 ::1/128
 +eth2             UP             11.0.200.2/16 fe80::76fe:48ff:fe45:e65e/64
 +eth3             DOWN
 +eth4             UP             12.0.200.4/16 fe80::76fe:48ff:fe45:e660/64
 +eth5             DOWN
 +eth0             UP             10.43.30.200/24 fe80::76fe:48ff:fe45:1eee/64
 +eth1             DOWN
 +internalk3s0     UNKNOWN        192.168.255.1/24
 +kube-ipvs0       DOWN           10.1.0.1/32 10.1.58.55/32 10.1.139.197/32 10.1.224.155/32 10.1.15.231/32 10.1.234.150/32 10.1.224.182/32 10.1.82.169/32 10.1.88.39/32 10.1.113.246/32 10.1.0.10/32 10.1.92.105/32 10.1.242.227/32 10.1.136.136/32 10.1.147.213/32 10.1.105.61/32 10.1.14.221/32 10.1.62.150/32 192.168.255.1/32 10.1.142.50/32 10.1.227.44/32 10.1.178.20/32 10.1.37.6/32 10.1.220.215/32 10.1.46.190/32 10.1.188.12/32 10.1.27.143/32 10.1.75.75/32 10.1.45.171/32 10.1.242.58/32 10.1.146.97/32 10.1.119.162/32 10.1.133.120/32 10.1.193.167/32 10.1.44.38/32 10.1.226.76/32 10.1.60.158/32
 +flannel.1        UNKNOWN        10.0.0.0/32 fe80::c426:bfff:fe61:77b7/64
 +cni0             UP             10.0.0.1/24 fe80::98df:c5ff:fe4f:e664/64
 +</file>
 +No our list is much more readable.
 +\\ 
 +\\ 
 +We could refine this output with multiple exclusions using the -e switch:
 +    ip -br -c a |grep -v -e "veth" -e "cni0" -e "flannel" -e "kube" -e "internal" -e"lo"
 +This give the following output.
 +<file>
 +eth2             UP             11.0.200.2/16 fe80::76fe:48ff:fe45:e65e/64
 +eth3             DOWN
 +eth4             UP             12.0.200.4/16 fe80::76fe:48ff:fe45:e660/64
 +eth5             DOWN
 +eth0             UP             10.43.30.200/24 fe80::76fe:48ff:fe45:1eee/64
 +eth1             DOWN
 +</file>
 +This is a lot to type/remember, but you could make a script out of it.
 +\\ 
 +\\ 
 +{{:dokuwiki.png?direct&600|}}
  
  
exclude_virtual_interfaces_in_ip_command.txt · Last modified: 2023/04/07 17:01 by walkeradmin