← KKK

KKK on kirjutatud inglise ja hollandi keeles; seda kuvatakse inglise keeles.

KKK

Network adapters and USB ports on or off

FAQ › EUZOS Server › Ports · Nederlands

What is it?

A server can switch off its network adapters (for example the second port of the Broadcom BCM5720) and its USB ports, one by one, and whole USB classes such as storage (no USB sticks or disks, while keyboard and mouse keep working). What is off is kept in \EOS\FW\PORTS.TXT on the boot volume and applies from boot, before the drivers start. On EUZOS Server it is managed only with Server Admin (tab Ports); the console shows it. The full design: docs/PORTS.md.

How do I…?

How do I see what is on and off?

In Server Admin: the server › tab Ports: the network adapters, the USB ports and the USB classes, each with a switch and notes (carries the admin connection, driver not started, boot stick, keyboard, powered off, …).

On the console of the server: ports. ip shows a switched-off adapter as disabled, network as switched off, and usb ends with a line Disabled : ….

How do I switch a network adapter off?

Server Admin › Ports › the switch of the adapter › confirm. Or with the CLI on the PC:

serveradmin <server-id> ports-set net pci:02:00.1 off

The adapter stops at once: no address, no traffic in or out. From the next boot its driver does not start at all (no link). An adapter is named by its PCI address (pci:02:00.1, shown by ports), its MAC address (mac:98:f2:…) or its name (bcm1).

How do I switch it on again?

The same switch, or ports-set net pci:02:00.1 on. An adapter that was switched off while running gets its link and address back within seconds. One whose driver did not start at boot is started now ("driver starting"), for the wired adapters (Broadcom, Intel, Realtek, virtio); if that fails ("start failed"), or for the PCI Wi-Fi chip ("starts only at boot"), it starts at the next boot.

How do I switch a USB port off?

Server Admin › Ports › the switch of the port, or ports-set usb c1:3 off. The port loses its power if the controller can do that (otherwise the device on it is ignored), and everything behind it (a hub) is off too. Positions: 3, c2:3 (with more controllers), 3.2 (port 2 of a hub on port 3), E1 (the EHCI ports of the Gen10).

A USB connector has a USB 2 and a USB 3 port number. When ACPI describes the connectors (_PLD), both ports are one connector ("same connector as …") and are switched together; otherwise switch both off (usbports shows the version per port).

How do I block USB sticks but keep the keyboard?

Switch the class off: Server Admin › Ports › USB device classes › Storage (sticks, disks), or ports-set usb-class storage off. Every USB storage device is then refused; the boot stick keeps working, and keyboard and mouse are not affected.

Why is my change refused or asked twice?

Safety rules:

  • the adapter that carries your admin connection can never be switched off (you would lock yourself out); use another adapter for Server Admin first;
  • the port of the boot stick cannot be switched off while the server runs from that stick;
  • the last adapter that is on, the port with the only keyboard, and the class hid without another keyboard need a second confirmation (Server Admin asks again; on the CLI add confirm).

Can I change it on the console of the server?

Only in a test build: ports net|usb|usb-class <what> on|off [confirm]. On a production server the console only shows it; changing is only possible with Server Admin, like the firewall.

Can I set it in the installer?

Yes: the server installer has an optional step Network adapters and USB ports after the packages: everything found is on, and you switch off the adapters, USB ports and USB storage the server does not use, with the same safety rules (the adapter used for the installation and the port of the installation stick stay on). The choice is written to the new disk as PORTS.TXT. See Server installer.

Reference

ItemValue
Config file\EOS\FW\PORTS.TXT: network-off=pci:…|mac:…, usb-off=<position>, usb-class-off=storage|hid|network|video
Admin actionsports (view), ports-set <argument>
Consoleports (change: test build only)
Codelibs/ports, kernel/src/ports.rs

See also