Jarek Hartman
Saturday, December 10, 2016

Disable and remove the usbecm2 device on Solaris 11

After a fresh Solaris 11 install on a T4‑1 server, I noticed an unexpected network interface: usbecm2.

root@slc:/# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
net0: flags=100001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,PHYSRUNNING> mtu 1500 index 7
        inet 139.156.7.116 netmask ffffff00 broadcast 139.156.7.255
        ether 0:10:e0:9a:2e:6
usbecm2: flags=100001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,PHYSRUNNING> mtu 1500 index 14
        inet 169.254.182.77 netmask ffffff00 broadcast 169.254.182.255
        ether 2:21:28:57:47:17
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128
net0: flags=120002000840<RUNNING,MULTICAST,IPv6,PHYSRUNNING> mtu 1500 index 7
        inet6 ::/0
        ether 0:10:e0:9a:2e:6
usbecm2: flags=120002000840<RUNNING,MULTICAST,IPv6,PHYSRUNNING> mtu 1500 index 14
        inet6 ::/0
        ether 2:21:28:57:47:17

I didn’t need it. How do you disable it? The dladm delete-phys approach doesn’t work:

root@slc:/# dladm delete-phys usbecm2
dladm: cannot delete 'usbecm2': invalid argument

The only solution I found was to prevent the driver from loading by editing /etc/system and rebooting:

root@sms:~# vi /etc/system

# Disable usbecm2 device

exclude: usbecm

root@sms:~# shutdown -y -g0 -i6

After the reboot, success — the interface is gone:

lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
net0: flags=100001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,PHYSRUNNING> mtu 1500 index 7
        inet 139.156.7.15 netmask ffffff00 broadcast 139.156.7.255
        ether 0:10:e0:9a:4a:da
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128
net0: flags=120002000840<RUNNING,MULTICAST,IPv6,PHYSRUNNING> mtu 1500 index 7
        inet6 ::/0
        ether 0:10:e0:9a:4a:da

But it still shows up in the physical links list (in a removed state):

root@sms:~# dladm show-phys -P
LINK              DEVICE       MEDIA                FLAGS
net10             igb10        Ethernet             -----
net3              igb7         Ethernet             -----
net4              igb0         Ethernet             -----
net6              igb2         Ethernet             -----
net7              igb3         Ethernet             -----
net0              igb4         Ethernet             -----
net5              igb1         Ethernet             -----
net8              igb8         Ethernet             -----
net11             igb11        Ethernet             -----
net1              igb5         Ethernet             -----
net9              igb9         Ethernet             -----
net2              igb6         Ethernet             -----
usbecm2           usbecm2      Ethernet             r----

Now it’s time to hit it again by dladm delete-phys:

root@sms:~# dladm delete-phys usbecm2

And finally, the link is gone!

root@sms:~# dladm show-phys -P
LINK              DEVICE       MEDIA                FLAGS
net10             igb10        Ethernet             -----
net3              igb7         Ethernet             -----
net4              igb0         Ethernet             -----
net6              igb2         Ethernet             -----
net7              igb3         Ethernet             -----
net0              igb4         Ethernet             -----
net5              igb1         Ethernet             -----
net8              igb8         Ethernet             -----
net11             igb11        Ethernet             -----
net1              igb5         Ethernet             -----
net9              igb9         Ethernet             -----
net2              igb6         Ethernet             -----

Last reboot for final check and that’s it.