[Others] 200m带宽只发挥出8m/S下载速度,root修改ifcfg-eth0说没权限保存
Tofloor
poster avatar
jiutian123
deepin
2021-01-12 21:12
Author

200m带宽只发挥出8m/S下载速度,root修改ifcfg-eth0为啥说没权限保存?谢谢

/etc/sysconfig/network-scripts/ifcfg-eth0
ETHTOOL_OPTS="speed 1000 duplex full autoneg on"

设置网卡双工 速率 去自适应:
ethtool设置可通过/etc/sysconfig/network-scripts/ifcfg-eth0文件保存
从而在设备下次启动时激活选项,添加如下一行:  
ETHTOOL_OPTS="speed 100 duplex full autoneg off"

 

若命令行下则: 
ethtool -s eth0 speed 100 duplex full autoneg off 

=====

 

配置千兆全双工

ethtool -s eth0 speed 1000 duplex full autoneg on
/etc/sysconfig/network-scripts/ifcfg-eth0
ETHTOOL_OPTS="speed 1000 duplex full autoneg on"

 

sar -n DEV 1 100 看网卡流量

Reply Favorite View the author
All Replies
jiutian123
deepin
2021-01-12 21:14
#1

root@nsz-PC:/home/nsz# ethtool -s eth0 speed 1000 duplex full autoneg on

Cannot get current device settings: No such device

  not setting speed

  not setting duplex

  not setting autoneg

root@nsz-PC:/home/nsz# 

 

Reply View the author
老咸鱼
deepin
2021-01-12 22:24
#2
It has been deleted!
fishalone
deepin
2021-01-12 23:43
#3

deepin 20.1 社区版,应该是这个文件:/etc/network/if-up.d/ethtool 

Reply View the author
deepinuser17
deepin
2021-01-13 08:52
#4

网卡名不一定是eth0.

 

用"ifconfig"或"ip addr"命令查看.

Reply View the author
jiutian123
deepin
2021-01-13 18:56
#5
deepinuser17

网卡名不一定是eth0.

 

用"ifconfig"或"ip addr"命令查看.

nsz@nsz-PC:~$ ifconfig

enp2s0f1: flags=4099  mtu 1500

        ether 80:fa:5b:25:46:3e  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

lo: flags=73  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        inet6 ::1  prefixlen 128  scopeid 0x10

        loop  txqueuelen 1000  (Local Loopback)

        RX packets 793  bytes 65318 (63.7 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 793  bytes 65318 (63.7 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

wlp3s0: flags=4163  mtu 1500

        inet 192.168.1.8  netmask 255.255.255.0  broadcast 192.168.1.255

        inet6 fe80::73f8:865f:2169:7361  prefixlen 64  scopeid 0x20

        ether e0:94:67:72:64:dd  txqueuelen 1000  (Ethernet)

        RX packets 30522  bytes 39165960 (37.3 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 15839  bytes 2234918 (2.1 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

Reply View the author
jiutian123
deepin
2021-01-13 18:58
#6
deepinuser17

网卡名不一定是eth0.

 

用"ifconfig"或"ip addr"命令查看.

nsz@nsz-PC:~$ ip addr

1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

       valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host 

       valid_lft forever preferred_lft forever

2: enp2s0f1: mtu 1500 qdisc fq state DOWN group default qlen 1000

    link/ether 80:fa:5b:25:46:3e brd ff:ff:ff:ff:ff:ff

3: wlp3s0: mtu 1500 qdisc noqueue state UP group default qlen 1000

    link/ether e0:94:67:72:64:dd brd ff:ff:ff:ff:ff:ff

    inet 192.168.1.8/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp3s0

       valid_lft 258223sec preferred_lft 258223sec

    inet6 fe80::73f8:865f:2169:7361/64 scope link noprefixroute 

       valid_lft forever preferred_lft forever

 

enp2s0f1  是这个

 

 

 

 

 

 

Reply View the author
jiutian123
deepin
2021-01-13 19:07
#7
fishalone

deepin 20.1 社区版,应该是这个文件:/etc/network/if-up.d/ethtool 

直接放前面了 不知道对不对

#!/bin/sh

ETHTOOL=/sbin/ethtool

ETHTOOL_OPTS="speed 1000 duplex full autoneg on"

test -x $ETHTOOL || exit 0

 

[ "$IFACE" != "lo" ] || exit 0

 

# Find settings with a given prefix and print them as they appeared in

# /etc/network/interfaces, only with the prefix removed.

# This actually prints each name and value on a separate line, but that

# doesn't matter to the shell.

gather_settings () {

    set | sed -n "

/^IF_$1[A-Za-z0-9_]*=/ {

    h;                             # hold line

    s/^IF_$1//; s/=.*//; s/_/-/g;  # get name without prefix

    y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;  # lower-case

    p;

    g;                             # restore line

    s/^[^=]*=//; s/^'\(.*\)'/\1/;  # get value

    p;

}"

}

 

# Gather together the mixed bag of settings applied with -s/--change

SETTINGS="\

${IF_LINK_SPEED:+ speed $IF_LINK_SPEED}\

${IF_LINK_DUPLEX:+ duplex $IF_LINK_DUPLEX}\

"

 

# WOL has an optional pass-key

set -- $IF_ETHERNET_WOL

SETTINGS="$SETTINGS${1:+ wol $1}${2:+ sopass $2}"

 

# Autonegotiation can be on|off or an advertising mask

case "$IF_ETHERNET_AUTONEG" in

'') ;;

on|off) SETTINGS="$SETTINGS autoneg $IF_ETHERNET_AUTONEG" ;;

*) SETTINGS="$SETTINGS autoneg on advertise $IF_ETHERNET_AUTONEG" ;;

esac

 

[ -z "$SETTINGS" ] || $ETHTOOL --change "$IFACE" $SETTINGS

 

SETTINGS="$(gather_settings ETHERNET_PAUSE_)"

[ -z "$SETTINGS" ] || $ETHTOOL --pause "$IFACE" $SETTINGS

 

SETTINGS="$(gather_settings HARDWARE_IRQ_COALESCE_)"

[ -z "$SETTINGS" ] || $ETHTOOL --coalesce "$IFACE" $SETTINGS

 

SETTINGS="$(gather_settings HARDWARE_DMA_RING_)"

[ -z "$SETTINGS" ] || $ETHTOOL --set-ring "$IFACE" $SETTINGS

 

SETTINGS="$(gather_settings OFFLOAD_)"

[ -z "$SETTINGS" ] || $ETHTOOL --offload "$IFACE" $SETTINGS

 

Reply View the author
deepinuser17
deepin
2021-01-19 08:28
#8

你可以测试一下你的ISP网络速度

 

访问https://www.speedtest.net/.    如果这个网站上不去, 用百度搜索国内可用的网站.

 

下载速度受很多因素影响. 远端服务器是否繁忙, 是否有下载速率限制, 延迟等等.  一般以下载文件速度来衡量, 都不可靠.

Reply View the author
deepinuser17
deepin
2021-01-19 08:28
#9

1 Mbps = 0.125 MB/s

 

你说的200是Mbps, 机器上的下载速度是用MB来显示的.

Reply View the author