去掉eth0
❶ Ubuntu局域网网络连接显示设备未托管怎么办
方法/步骤
Ubuntu
的笔记本来到一个局域网里,有点认生。插上网线,网线指示灯亮,但是连不上网,点击网络连接图标,显示“网络未托管”。突然想起这台笔记本前阵子设置过
PPPOE(有线宽带虚拟拨号),怀疑是它的原因。
按
Ctrl
+
Alt
+
t,调出终端。
键入命令:
cd
/etc/network
转入
/etc/network
这个目录,它里面有个文件叫
interfaces。
然后键入命令:
sudo
gedit
interfaces
意思是调用
gedit
文本编辑器,并打开
interfaces
这个文件。
这个文件的最后一行是:
iface
eth0
inet
manual
意思是,eth0
这个网络界面(个人电脑上,eth0
一般指的就是唯一的一个网线接口),需要手动设置网络。
但是,当前的这个局域网,明显是
DHCP
网络,也就是接入的电脑需要“自动获取网络”地址。
我们在这行字符前面加个英文的“#”,“注释”掉这一行,意思是不要手动设置网络了,而是转为自动设置。注意一定是英文的“#”,否则输入中文的话,就起不到“注释”的作用了。
6
保存文件、关闭
gedit
文本编辑器,回到终端,键入命令:
sudo
service
network-manager
restart
意思是重新启动网络管理服务。
按下回车,网络立刻连接。
以后离开这个局域网,需要重新使用虚拟拨号时,只要按照第
4、5
步骤的方法,把加上的那个“#”去掉,然后再重启网络管理服务,就行了。
❷ 如何清除LINUX中的IP地址
你好,你说的删除IP是指去掉ip地址吧。如果是去掉IP地址,各个Linux系统去掉IP是可以用不同的管理工具去除掉的。不过每个版本的linux都可以通过修改文件来去掉IP地址的。redhat版本的linux可以用netconfig命令来打开配置IP窗口,suselinux可以用yast工具去掉IP。修改网卡配置文件来去点IP,suse一般网卡配置文件在/etc/sysconfig/network/ifcfg-eth0将图中的IPADDR去掉即可。
redhat一般网卡配置文件在/etc/sysconfig/network-script/ifcfg-eth0将图中的IPADDR去掉即可。
❸ Linux系统\Centos没有网卡eth0配置文件怎么办
1.大家都知道linux下面设置ip是 ifconfig 命令
通过下面命令即可临时设置IP地址。
ifconfig 设备名 IP 地址 (ifconfig eth0 192.168.1.117)
2. 设置好之后马上生效,不需要重启网卡服务(千万别重启网卡服务,不然刚刚设置的又没有了)ifconfig即可查看当前网卡的IP地址。
以上介绍的是临时解决办法,如果要彻底解决需要生成一个网卡配置文件才行
复制设置配置文件
一般来说如果没有网卡eth0配置文件,你到网卡配置目/etc/sysconfig/network-scripts/下面都会有一个 ifcfg-lo 回环接口配置文件,拷贝一份
拷贝了一个lo配置文件之后,把文件IP地址和参数改一下改成eth0保存即可啦.
编写配置文件
通过上述方法复制的文件不完整,可以通过vi编辑输入补全。或者直接手动输入设置,
特别提醒一下
如要设置mac地址,可以先ifconfig查看一下,可以看到mac地址的喔
重启网络服务
设置好网卡配置之后,需要把网络服务重启一下。输入如下命令
service network restart
如果没有提示任何错误则表示设置格式基本没有问题哈
如果MAC地址设置错误的话,会提示下面信息。
可以先ifconfig查看一下,可以查看正确的MAC地址,当然你也可以直接把mac地址设置那一栏去掉可以。
❹ linux打开网卡eth0的arp解析
ifconfig eht0 arp 把“-” 去掉! 看一下man ifconfig 的一段# man ifconfig [-]arp Enable or disable the use of the ARP protocol on this interface.
❺ linux eth0网络问题
1、vi /etc/sysconfig/network-scripts/ifcfg-eth0
ifcfg-eth0的配置文件里保存了以前的MAC地址,
2、把ifcfg-eth0的NETMASK=192.168.116.0GATEWAY=192.168.116.2子网掩码是255.255.255.0删除
3、把/etc/udev/rules.d/70-persistent-net.rules 删除后重启机器就可以了重启
❻ 安装了centos之后网卡没有ifcfg-eth0没有
临时解决办法1 大家都知道linux下面设置ip是 ifconfig 命令 通过下面命令即可临时设置IP地址。 ifconfig 设备名 IP 地址 (ifconfig eth0 192.168.1.117) 2 设置好之后马上生效,不需要重启网卡服务(千万别重启网卡服务,不然刚刚设置的又没有了)ifconfig即可查看当前网卡的IP地址。 END 永久解决办法方法/步骤2 以上介绍的是临时解决办法,如果要彻底解决需要生成一个网卡配置文件才行 复制设置配置文件 一般来说如果没有网卡eth0配置文件,你到网卡配置目/etc/sysconfig/network-scripts/下面都会有一个 ifcfg-lo 回环接口配置文件,拷贝一份 拷贝了一个lo配置文件之后,把文件IP地址和参数改一下改成eth0保存即可啦 编写配置文件 通过上述方法复制的文件不完整,可以通过vi编辑输入补全。或者直接手动输入设置,具体详细参数参考如下图列表 特别提醒一下 如要设置mac地址,可以先ifconfig查看一下,可以看到mac地址的喔 重启网络服务 设置好网卡配置之后,需要把网络服务重启一下。输入如下命令 service network restart 如果没有提示任何错误则表示设置格式基本没有问题哈 5 如果MAC地址设置错误的话,会提示下面信息。 可以先ifconfig查看一下,可以查看正确的MAC地址,当然你也可以直接把mac地址设置那一栏去掉可以。
❼ linux 一个网关绑定多个ip后,能再恢复到一个ip吗
进入相关目录找到ifcfg-eth0:1这个文件,不知道你什么版本的linux。
我的是/etc/sysconfig/network-script下。
#rm -rf ifcfg-eth0:1
#mv ifcfg-eth0:0 ifcfg-eth0
#service network restart
❽ linux有gprs也有线怎么选择
默
认情况在/etc/ppp/目录下建立文件gprs-connect-chat,内容如下(每个参数解释在ppp-howto中有详细解释。它是在ppp
底层会话的时候给chat进程的参数每行是一个“期望/发送”的组合序列。当出现一些经典的错误如: "LCP: timeout sending
Config-Requests" ,"serial line is not 8 bit clean...",“serial line is
looped
back”等,去参看方式2提到的两个文档,或者google。注意,为什么不能确切地给出解决的方式,原因是打印出来的同一个错误信息,我称之为现象,
同一现象可能是由很多种原因造成的,需要自己实地排查。)
#/etc/ppp/gprs-connect-chat
TIMEOUT 15
ABORT '\nBUSY\r'
ABORT '\nNO ANSWER\r'
ABORT '\nRINGING\r\n\r\nRINGING\r'
#'' AT
#'OK-+++\c-OK' ATH0
TIMEOUT 40
'' \rAT
OK ATS0=0 #这些都是标准的at命令,建议查看随模块的at命令手册
OK ATE0V1
OK AT+CGDCONT=1,"IP","CMNET" #设置isp接入网关为中国移动的cmnet,如果你想 获得更多访问资源的话
OK ATDT*99***1# #中国移动gprs的接入号吗
CONNECT ''
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
建立文件/etc/ppp/peers/gprs,它的作用是给pppd进程提供配置参数(详见man 8 pppd的输出内容,如果出现问题这个将是非常重要的参考页),内容如下:
#/etc/ppp/peers/gprs
# Usage: root>pppd call gprs
/dev/s3c2410_serial1 #改成自己的端口名
115200 #改成自己串口波特率
nocrtscts
#可能你的串口是需要crtscts,硬件流控的,这是由你的串口决定的,一般嵌入式系统的串口没有带硬件流控,也不需要就加nocrtscts
modem #这个参数使得pppd进程将等待模块发回的CD (Carrier Detect)信号,与local真好相反
#noauth
debug #把调试信息输出到/var/log/messages,在调试成功后去掉它,以减少垃圾的产生。
nodetach
#hide-password
usepeerdns #以下的3个参数一般不可少
noipdefault
defaultroute
user smsong #设置接入的用户名,在chap-secrets或者pap-secets中使用
0.0.0.0:0.0.0.0 #本地和远端的ip都设为0使得接入的isp分配本地的ip地址
ipcp-accept-local #要求peer也就是isp给自己非配动态的IP地址
#ipcp-accept-remote
#lcp-echo-failure 12
#lcp-echo-interval 3
noccp #不需要压缩控制协议,有可能对端不需要,根据自己的isp的情况
#novj
#novjccomp
persist #保证在连接断开的情况下不退出,并尝试重新打开连接
connect '/usr/sbin/chat -s -v -f /etc/ppp/gprs-connect-chat'
#pppd调用chat会话进程接入对端isp,启动对端的pppd,然后本地pppd与对端的pppd一起进行协
#商网络参数和chap/pap认证,成功后,再进行ncp层的ip的分配。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#/etc/ppp/chap-secets
# Secrets for authentication using CHAP
# client server secret IP addresses
####### redhat-config-network will overwrite this part!!! (begin) ##########
####### redhat-config-network will overwrite this part!!! (end) ############
smsong * 123456 *
有点地区的GPRS可能使用pap方式认证接入用户,所以在同一级目录下,创建pap-secets文件,内容与chap-secets类似有4项的内容第2和第4项一般不限制就用*(星号)代表。反正要你在/etc/ppp/下放着这两个文件就好。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
在建立了ppp0连接以后可以使用ctrl+c或者下面的脚本程序ppp-off断开ppp连接
#/etc/ppp/ppp-off
#!/bin/sh
######################################################################
#
# Determine the device to be terminated.
#
if [ "$1" = "" ]; then
DEVICE=ppp0
else
DEVICE=$1
fi
######################################################################
#
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
kill -INT `cat /var/run/$DEVICE.pid`
#
# If the kill did not work then there is no process running for this
# pid. It may also mean that the lock file will be left. You may wish
# to delete the lock file at the same time.
if [ ! "$?" = "0" ]; then
rm -f /var/run/$DEVICE.pid
echo "ERROR: Removed stale pid file"
exit 1
fi
#
# Success. Let pppd clean up its own junk.
echo "PPP link to $DEVICE terminated."
exit 0
fi
#
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on $DEVICE"
exit 1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
做好上面的配置以后,输入pppd call gprs命令,注意如果你的gprs这个文件不在/etc/ppp/peers/目录下,在给出标注路径给pppd
[root@localhost ppp_scripts]# pppd call gprs
timeout set to 15 seconds
abort on (\nBUSY\r)
abort on (\nNO ANSWER\r)
abort on (\nRINGING\r\n\r\nRINGING\r)
timeout set to 40 seconds
send (^MAT^M^M)
expect (OK)
^M^M
OK
-- got it
send (ATS0=0^M^M)
expect (OK)
^M
AT^M
OK
-- got it
send (ATE0V1^M^M)
expect (OK)
^M
^M^M
OK
-- got it
send (AT+CGDCONT=1,"IP","CMNET"^M^M)
expect (OK)
^M
ATS0=0^M^M
OK
-- got it
send (ATDT*99***1#^M^M)
expect (CONNECT)
^M
^M^M
OK^M
ATE0V1^M^M
OK^M
^M
OK^M
^M
OK^M
^M
OK^M
^M
CONNECT
-- got it
send (^M)
Serial connection established.
using channel 20
Using interface ppp0
Connect: ppp0 /dev/ttyS0
Warning - secret file /etc/ppp/pap-secrets has world and/or group access
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfRej id=0x1 ]
sent [LCP ConfReq id=0x2 ]
rcvd [LCP ConfAck id=0x2 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [CHAP Challenge id=0x1 , name = ""]
Warning - secret file /etc/ppp/chap-secrets has world and/or group access
sent [CHAP Response id=0x1 , name = "smsong"]
rcvd [CHAP Success id=0x1 ""]
CHAP authentication succeeded
CHAP authentication succeeded
sent [CCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
rcvd [LCP ProtRej id=0x1 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [IPCP ConfReq id=0x1]
sent [IPCP ConfNak id=0x1 ]
rcvd [IPCP ConfRej id=0x1 ]
sent [IPCP ConfReq id=0x2 ]
rcvd [IPCP ConfReq id=0x2]
sent [IPCP ConfAck id=0x2]
rcvd [IPCP ConfNak id=0x2 ]
sent [IPCP ConfReq id=0x3 ]
rcvd [IPCP ConfAck id=0x3 ]
Could not determine remote IP address: defaulting to 10.64.64.64
local IP address 10.144.202.159
remote IP address 10.64.64.64
primary DNS address 211.138.200.69
secondary DNS address 211.103.13.101
Script /etc/ppp/ip-up started (pid 4578)
Script /etc/ppp/ip-up finished (pid 4578), status = 0x0
使用ctrl+c可以断开连接,这样一般不太好测试是不是连接上了(遇有开发不上的控制台只有一个的原因),可以去掉/etc/ppp
/peers/gprs文件中的nodetach参数,要用ping,你需要将eth0即网口给禁用掉,这样ping才会通过ppp0端口寻找路由连接外
网。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
可以用命令tail -f /var/log/messages看到日志:
Mar 20 20:55:55 localhost pppd[4557]: pppd 2.4.4 started by root, uid 0
Mar 20 20:55:56 localhost chat[4558]: timeout set to 15 seconds
Mar 20 20:55:56 localhost chat[4558]: abort on (\nBUSY\r)
Mar 20 20:55:56 localhost chat[4558]: abort on (\nNO ANSWER\r)
Mar 20 20:55:56 localhost chat[4558]: abort on (\nRINGING\r\n\r\nRINGING\r)
Mar 20 20:55:56 localhost chat[4558]: timeout set to 40 seconds
Mar 20 20:55:56 localhost chat[4558]: send (^MAT^M^M)
Mar 20 20:55:56 localhost chat[4558]: expect (OK)
Mar 20 20:55:56 localhost chat[4558]: ^M^M
Mar 20 20:55:56 localhost chat[4558]: OK
Mar 20 20:55:56 localhost chat[4558]: -- got it
Mar 20 20:55:56 localhost chat[4558]: send (ATS0=0^M^M)
Mar 20 20:55:56 localhost chat[4558]: expect (OK)
Mar 20 20:55:56 localhost chat[4558]: ^M
Mar 20 20:55:56 localhost chat[4558]: AT^M
Mar 20 20:55:56 localhost chat[4558]: OK
Mar 20 20:55:56 localhost chat[4558]: -- got it
Mar 20 20:55:56 localhost chat[4558]: send (ATE0V1^M^M)
Mar 20 20:55:56 localhost chat[4558]: expect (OK)
Mar 20 20:55:56 localhost chat[4558]: ^M
Mar 20 20:55:56 localhost chat[4558]: ^M^M
Mar 20 20:55:56 localhost chat[4558]: OK
Mar 20 20:55:56 localhost chat[4558]: -- got it
Mar 20 20:55:56 localhost chat[4558]: send (AT+CGDCONT=1,"IP","CMNET"^M^M)
Mar 20 20:55:57 localhost chat[4558]: expect (OK)
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: ATS0=0^M^M
Mar 20 20:55:57 localhost chat[4558]: OK
Mar 20 20:55:57 localhost chat[4558]: -- got it
Mar 20 20:55:57 localhost chat[4558]: send (ATDT*99***1#^M^M)
Mar 20 20:55:57 localhost chat[4558]: expect (CONNECT)
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: ^M^M
Mar 20 20:55:57 localhost chat[4558]: OK^M
Mar 20 20:55:57 localhost chat[4558]: ATE0V1^M^M
Mar 20 20:55:57 localhost chat[4558]: OK^M
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: OK^M
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: OK^M
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: OK^M
Mar 20 20:55:57 localhost chat[4558]: ^M
Mar 20 20:55:57 localhost chat[4558]: CONNECT
Mar 20 20:55:57 localhost chat[4558]: -- got it
Mar 20 20:55:57 localhost chat[4558]: send (^M)
Mar 20 20:55:57 localhost pppd[4557]: Serial connection established.
Mar 20 20:55:57 localhost pppd[4557]: Using interface ppp0
Mar 20 20:55:57 localhost pppd[4557]: Connect: ppp0 /dev/ttyS0
Mar 20 20:55:58 localhost pppd[4557]: Warning - secret file /etc/ppp/pap-secrets has world and/or group access
Mar 20 20:56:00 localhost pppd[4557]: Warning - secret file /etc/ppp/chap-secrets has world and/or group access
Mar 20 20:56:00 localhost pppd[4557]: CHAP authentication succeeded
Mar 20 20:56:00 localhost pppd[4557]: CHAP authentication succeeded
Mar 20 20:56:01 localhost kernel: PPP Deflate Compression mole registered
Mar 20 20:56:02 localhost pppd[4557]: Could not determine remote IP address: defaulting to 10.64.64.64
Mar 20 20:56:02 localhost pppd[4557]: local IP address 10.144.202.159
Mar 20 20:56:02 localhost pppd[4557]: remote IP address 10.64.64.64
Mar 20 20:56:02 localhost pppd[4557]: primary DNS address 211.138.200.69
Mar 20 20:56:02 localhost pppd[4557]: secondary DNS address 211.103.13.101
❾ linux 重启网卡 Device eth0 has different MAC address than expected, ignoring 如何解决
这个提示是指网口的mac地址已经变化,但是设备名称没有变化,导致设备名称和mac地址无法匹配,linux无法挂载该网口。换种说法就是该网口的配置文件里的mac地址和该网口实际的mac地址不符合。
这种情况一般发生在虚拟机迁移,或者更换网卡的时候,解决方案如下:
1:记录网口的实际地址,执行ifconfig eth0
其中HWaddr后面就是网口实际的mac地址
2:更改配置文件中的mac地址
打开eth0的网口配置文件: /etc/sysconfig/network-scripts/ifcfg-eth0
(该地址可能随着不同的操作系统有所不同)
在文件中寻找 HWADDR= 这行,如果没有就新加一行。把这行后面的值改成第一步看到的mac地址值,例如 HWADDR="00:0C:29:2D:2D:CF",然后保存退出
3:通过service network restart重启网卡,或者通过ifup eth0启动网卡(该命令会检查配置文件)