Ubuntu16.04无法有线连接,线缆被拔出。

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
回复
H奇点
帖子: 15
注册时间: 2016-11-09 13:52
系统: ubuntu

Ubuntu16.04无法有线连接,线缆被拔出。

#1

帖子 H奇点 » 2017-06-08 15:23

hui@hui-X455LJ:/etc/init.d$ ifconfig
eth0 Link encap:以太网 硬件地址 30:5a:3a:87:ef:4f
UP BROADCAST MULTICAST MTU:1500 跃点数:1
接收数据包:34245 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:29232 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:13058772 (13.0 MB) 发送字节:4477018 (4.4 MB)

lo Link encap:本地环回
inet 地址:127.0.0.1 掩码:255.0.0.0
inet6 地址: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 跃点数:1
接收数据包:11820 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:11820 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1
接收字节:1301882 (1.3 MB) 发送字节:1301882 (1.3 MB)

hui@hui-X455LJ:~$ sudo vi /etc/init.d/rc.local
#! /bin/sh
### BEGIN INIT INFO
# Provides: rc.local
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Run /etc/rc.local if it exist
### END INIT INFO


PATH=/sbin:/usr/sbin:/bin:/usr/bin

. /lib/init/vars.sh
. /lib/lsb/init-functions

do_start() {
if [ -x /etc/rc.local ]; then
[ "$VERBOSE" != no ] && log_begin_msg "Running local boot scripts (/etc/rc.local)"
/etc/rc.local
ES=$?
[ "$VERBOSE" != no ] && log_end_msg $ES
return $ES
fi
}

case "$1" in
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop|status)
# No-op
exit 0
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
/sbin/ethtool -s eth0 autoneg off speed 100 duplex full


每次开机后运行:
hui@hui-X455LJ:~$ sudo ethtool -s eth0 autoneg off speed 100 duplex full
问题可以解决,每次都得这样做,很麻烦。求大神支招!!
H奇点
帖子: 15
注册时间: 2016-11-09 13:52
系统: ubuntu

Re: Ubuntu16.04无法有线连接,线缆被拔出。

#2

帖子 H奇点 » 2017-06-08 15:25

做了开机自启动脚本,但是在输入sudo update-rc.d 联网.sh defaults 95 后报错:
insserv: warning: script 'K01联网.sh' missing LSB tags and overrides
insserv: warning: script '联网.sh' missing LSB tags and overrides
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Ubuntu16.04无法有线连接,线缆被拔出。

#3

帖子 poloshiao » 2017-06-08 15:31

回复