FreeBSD
Что бы узнать какие режимы поддерживаются данной карточкой, используем такую команду:
# ifconfig -m nfe0 nfe0: flags=8943metric 0 mtu 1500 options=8210b capabilities=8210b ether fa:d5:5e:f7:db:ff inet 192.168.1.40 netmask 0xffffff00 broadcast 192.168.1.255 inet6 fe80::f8d5:5eff:fef7:dbff%nfe0 prefixlen 64 scopeid 0x4 inet 192.168.0.11 netmask 0xffffff00 broadcast 192.168.0.255 inet 10.11.11.2 netmask 0xffffff00 broadcast 10.11.11.255 nd6 options=29 media: Ethernet autoselect (100baseTX ) status: active supported media: media autoselect mediaopt flowcontrol media autoselect media 100baseTX mediaopt full-duplex media 100baseTX media 10baseT/UTP mediaopt full-duplex media 10baseT/UTP
Установим нужное значение:
# ifconfig nfe0 media 10baseT/UTP mediaopt full-duplex
В /etc/rc.conf это будет выглядеть так:
ifconfig_nfe0="inet 192.168.0.1 netmask 255.255.255.0 media 10baseT/UTP mediaopt full-duplex"
OpenBSD
Всё тоже самое, за исключением определения поддерживаемых скоростей
# ifconfig rl0 media rl0: flags=8843 mtu 1500 lladdr 00:50:ba:c0:eb:60 priority: 0 media: Ethernet autoselect (100baseTX full-duplex) status: active supported media: media 10baseT media 10baseT mediaopt full-duplex media 100baseTX media 100baseTX mediaopt full-duplex media autoselect inet 10.25.1.46 netmask 0xfffffffc broadcast 10.25.1.47
Для постоянного закрепления в /etc/hostname.rl0 просто дописываем нужную скорость.
Linux
Встроенных средств для этого нет, зато есть сторонние утилиты ethtool, mii-diag(mii-tool). Вот как это выглядит:
# mii-tool -v eth0
eth0: no autonegotiation, 1000baseT-FD flow-control, link ok
product info: Yukon 88E1011 rev 4
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
#mii-tool -F 10baseT-FD eth0
# ethtool eth0 Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 0 Transceiver: internal Auto-negotiation: on MDI-X: Unknown Supports Wake-on: umbg Wake-on: d Current message level: 0x00000007 (7) Link detected: yes #ethtool -s eth0 speed 10 duplex full autoneg off
Ошибок не выдало, но скорость изменить не получилось (может проблема с сетевой). Если 2-м разным утилитам не удалось это сделать, значит дело скорее всего в сетевой карте.
Solaris 10
Узнаем поддерживаемые режимы:
# ndd /dev/hme \? | grep '(read and write)' adv_autoneg_cap (read and write) adv_1000fdx_cap (read and write) adv_1000hdx_cap (read and write) adv_100fdx_cap (read and write) adv_100hdx_cap (read and write) adv_10fdx_cap (read and write) adv_10hdx_cap (read and write) tx_bcopy_threshold (read and write) tx_interrupt_enable (read and write) tx_intr_delay (read and write) tx_intr_abs_delay (read and write) rx_bcopy_threshold (read and write) max_num_rcv_packets (read and write) rx_intr_delay (read and write) rx_intr_abs_delay (read and write) intr_throttling_rate (read and write) intr_adaptive (read and write)
Если через ndd нельзя получить информацию:
#ndd -get /dev/bge ?
operation failed, Invalid argument
то можно получить информацию через kstat:
$ kstat -p | grep bge | grep adv_cap_10 bge:0:mac:adv_cap_1000fdx 1 bge:0:mac:adv_cap_1000hdx 1 bge:0:mac:adv_cap_100fdx 1 bge:0:mac:adv_cap_100hdx 1 bge:0:mac:adv_cap_10fdx 1 bge:0:mac:adv_cap_10hdx 1 bge:0:mii:adv_cap_1000fdx 1 bge:0:mii:adv_cap_1000hdx 1 bge:0:mii:adv_cap_100fdx 1 bge:0:mii:adv_cap_100hdx 1 bge:0:mii:adv_cap_10fdx 1 bge:0:mii:adv_cap_10hdx 1
Проверка:
ndd /dev/hme link_mode
0 = half duplex, 1 = full duplex
Установка full duplex:
ndd -sec /dev/hme adv_100fdx_cap
ndd -set /dev/hme adv_autoneg_cap 0
Установка half duplex:
ndd -sec /dev/hme adv_100hdx_cap
ndd -set /dev/hme adv_autoneg_cap 0
А вот ещё пример использования
# ndd /dev/bge0 link_duplex
2
# ndd /dev/bge0 link_autoneg
1
# ndd /dev/bge0 link_status
1
# ndd /dev/bge0 link_speed
1000
Solaris 11
Проверка
# dladm show-phys LINK MEDIA STATE SPEED DUPLEX DEVICE net0 Ethernet up 1000 full e1000g0
Узнаем поддерживаемые режимы:
# ndd /dev/e1000g0 \? | grep '(read and write)' adv_autoneg_cap (read and write) adv_1000fdx_cap (read and write) adv_1000hdx_cap (read and write) adv_100fdx_cap (read and write) adv_100hdx_cap (read and write) adv_10fdx_cap (read and write) adv_10hdx_cap (read and write) tx_bcopy_threshold (read and write) tx_interrupt_enable (read and write) tx_intr_delay (read and write) tx_intr_abs_delay (read and write) rx_bcopy_threshold (read and write) max_num_rcv_packets (read and write) rx_intr_delay (read and write) rx_intr_abs_delay (read and write) intr_throttling_rate (read and write) intr_adaptive (read and write)
Установка
# ndd -set /dev/e1000g0 adv_autoneg_cap 0
# ndd -set /dev/e1000g0 adv_100fdx_cap 1
а так же установить 0 для всех остальных режимов:
# ndd -set /dev/e1000g0 adv_1000fdx_cap 0
# ndd -set /dev/e1000g0 adv_100hdx_cap 0
# ndd -set /dev/e1000g0 adv_10fdx_cap 0
# ndd -set /dev/e1000g0 adv_10hdx_cap 0
Для постоянного изменения, добавим такой код в /etc/system
set e1000g:adv_autoneg_cap=0
set e1000g:adv_100fdx_cap=1
set e1000g:adv_1000fdx_cap=0
set e1000g:adv_100hdx_cap=0
set e1000g:adv_10fdx_cap=0
set e1000g:adv_10hdx_cap=0
Источник http://skeletor.org.ua/?p=2932