+ -
当前位置:首页 → 问答吧 → 开机能检测到网卡,但是上不了网

开机能检测到网卡,但是上不了网

时间:2007-10-17

来源:互联网

原来主板集成的坏了
添加了一块pci卡网卡 rtl8139的
lsmod可以看到
ifconfig 只能看到lo
ifconfig eth1 up 后可以看到eth1的信息
但是正确设置IP后无法上网,也ping不通网关

作者: qifenglun   发布时间: 2007-10-17

route add default gw <ip> ;设置网关

作者: 心之语   发布时间: 2007-10-17

既然集成的网卡坏了,就进CMOS把它屏蔽!
屏蔽后新加的PCI网卡就是eth0了,进入系统后以root身份运行netconfig重新配置,
或者编辑/etc/rc.d/rc.inet1.conf进行配置,再/etc/rc.d/rc.inet1 restart看看行不行!
运行netstat -rn看看有没有缺省路由,比如:
代码:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.168.23.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 10.168.23.1 0.0.0.0 UG 0 0 0 eth0
最后一行就是缺省路由

作者: leidan   发布时间: 2007-10-17

非常感谢楼上两位
已解决!

原来netconfig默认是改eth0
可能是要用netconfig eht1。没试过
我是手动改的vi /etc/rc.d/rc.inet1.conf
/etc/rc.d/rc.inet1 restart
这样就可以了。

作者: qifenglun   发布时间: 2007-10-17