1. List network interfaces
#nmcli d
DEVICE TYPE STATE CONNECTION
enp0s3 ethernet connected enp0s3
virbr0 bridge connected virbr0
lo loopback unmanaged --
virbr0-nic tun unmanaged --
2. list all infomation of network services
#lshw -c network
WARNING: you should run this program as super-user.
*-network
description: Ethernet interface
product: 82540EM Gigabit Ethernet Controller
vendor: Intel Corporation
physical id: 3
bus info: pci@0000:00:03.0
logical name: enp0s3
version: 02
serial: 08:00:27:91:c0:41
size: 1Gbit/s
capacity: 1Gbit/s
width: 32 bits
clock: 66MHz
capabilities: bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full ip=192.168.2.7 latency=64 link=yes mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:19 memory:f8200000-f821ffff ioport:d020(size=8)
*-network:0 DISABLED
description: Ethernet interface
physical id: 1
logical name: virbr0-nic
serial: 52:54:00:cc:d0:aa
size: 10Mbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=tun driverversion=1.6 duplex=full link=no multicast=yes port=twisted pair speed=10Mbit/s
*-network:1
description: Ethernet interface
physical id: 2
logical name: virbr0
serial: 52:54:00:cc:d0:aa
capabilities: ethernet physical
configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=192.168.122.1 link=no multicast=yes
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
3. To hide a specified interface, you need to find the driver, e.g. enp0s3, which is e1000, then
sudo modprobe -r e1000
4. Verify what happens, and you will find enp0s3 is gone
#nmcli d
DEVICE TYPE STATE CONNECTION
virbr0 bridge connected virbr0
lo loopback unmanaged --
virbr0-nic tun unmanaged --
5. Restore to the orginal status
#sudo modprobe e1000
6. Verify what happens and you will find enp0s3 comes back
#nmcli d
DEVICE TYPE STATE CONNECTION
enp0s3 ethernet connected enp0s3
virbr0 bridge connected virbr0
lo loopback unmanaged --
virbr0-nic tun unmanaged --