网络时断时续,ping返回如下,高人教我
-
- 帖子: 541
- 注册时间: 2007-05-19 16:36
网络时断时续,ping返回如下,高人教我
ubuntu@GNU:~$ ping -c2 192.168.18.1
connect: Network is unreachable
ubuntu@GNU:~$ ping -c2 192.168.18.1
PING 192.168.18.1 (192.168.18.1) 56(84) bytes of data.
From 169.254.7.1 icmp_seq=1 Destination Host Unreachable
From 169.254.7.1 icmp_seq=2 Destination Host Unreachable
--- 192.168.18.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1002ms
, pipe 2
ubuntu@GNU:~$ ping -c2 192.168.18.1
PING 192.168.18.1 (192.168.18.1) 56(84) bytes of data.
From 169.254.7.1 icmp_seq=1 Destination Host Unreachable
From 169.254.7.1 icmp_seq=2 Destination Host Unreachable
三台电脑共享一个路由上网
connect: Network is unreachable
ubuntu@GNU:~$ ping -c2 192.168.18.1
PING 192.168.18.1 (192.168.18.1) 56(84) bytes of data.
From 169.254.7.1 icmp_seq=1 Destination Host Unreachable
From 169.254.7.1 icmp_seq=2 Destination Host Unreachable
--- 192.168.18.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1002ms
, pipe 2
ubuntu@GNU:~$ ping -c2 192.168.18.1
PING 192.168.18.1 (192.168.18.1) 56(84) bytes of data.
From 169.254.7.1 icmp_seq=1 Destination Host Unreachable
From 169.254.7.1 icmp_seq=2 Destination Host Unreachable
三台电脑共享一个路由上网
-
- 帖子: 13
- 注册时间: 2007-10-10 23:42
- 联系:
-
- 帖子: 354
- 注册时间: 2007-06-21 1:30
- 来自: Shanghai
- 联系:
-
- 帖子: 541
- 注册时间: 2007-05-19 16:36
- xiehuipiaofeng
- 帖子: 85
- 注册时间: 2007-07-31 23:04
是你没有给网卡分配IP地址。不过你要首先看你的机器有没有识别网卡。
$ lspci | grep Ethernet
如果出现如下的现实,则说明你的网卡系统已经识别了。否则就要去找驱动了。不过一般情况下,只要你的网卡别太有个性了,ubuntu都能识别出来。
00:13.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5705M Gigabit Ethernet (rev 03)
也可以用这个命令ethtool eth0查看你的网卡具体的信息。
sudo vim /etc/network/interfaces
网卡通过DHCP自动获取IP地址
# The primary network interface (配置主网络接口)
#开机自动激活eth0接口
auto eth0
#配置eth0接口为DHCP自动获取
iface eth0 inet dhcp
获取IP地址
sudo dhclient eth0
网卡静态分配IP地址
#开机自动激活eth0接口
auto eth0
#配置eth0接口为静态设置IP地址
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
激活以上设置
sudo /etc/init.d/networking restart
DNS 设置
sudo /etc/resolv.conf
加入
nameserver DNSServer IP ADDRSS
$ lspci | grep Ethernet
如果出现如下的现实,则说明你的网卡系统已经识别了。否则就要去找驱动了。不过一般情况下,只要你的网卡别太有个性了,ubuntu都能识别出来。
00:13.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5705M Gigabit Ethernet (rev 03)
也可以用这个命令ethtool eth0查看你的网卡具体的信息。
sudo vim /etc/network/interfaces
网卡通过DHCP自动获取IP地址
# The primary network interface (配置主网络接口)
#开机自动激活eth0接口
auto eth0
#配置eth0接口为DHCP自动获取
iface eth0 inet dhcp
获取IP地址
sudo dhclient eth0
网卡静态分配IP地址
#开机自动激活eth0接口
auto eth0
#配置eth0接口为静态设置IP地址
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
激活以上设置
sudo /etc/init.d/networking restart
DNS 设置
sudo /etc/resolv.conf
加入
nameserver DNSServer IP ADDRSS
- xiehuipiaofeng
- 帖子: 85
- 注册时间: 2007-07-31 23:04
-
- 帖子: 66
- 注册时间: 2006-12-05 10:53
我也有这个问题
我的也出现这样的问题,重启下网卡就好了,隔几分钟就不行了,需要再重启网卡。请奇怪的问题。
iterfaces配置如下
auto lo
iface lo inet loopback
auto eth2
#iface eth2 inet dhcp
auto ath0
#iface ath0 inet dhcp
auto wlan0
#iface wlan0 inet dhcp
配置了iterfaces 就会出现下面的情况。
auto lo
iface lo inet loopback
auto eth2
#iface eth2 inet dhcp
auto ath0
#iface ath0 inet dhcp
iface eth0 inet static
address 192.168.104.118
netmask 255.255.255.0
network 192.168.104.0
broadcast 192.168.104.255
gateway 192.168.104.1
auto wlan0
#iface wlan0 inet dhcp
shoto@shoto-laptop:~$ sudo /etc/init.d/networking restart
* Reconfiguring network interfaces... /etc/network/interfaces:98: duplicate interface
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:98: duplicate interface
ifup: couldn't read interfaces file "/etc/network/interfaces"
[fail]
iterfaces配置如下
auto lo
iface lo inet loopback
auto eth2
#iface eth2 inet dhcp
auto ath0
#iface ath0 inet dhcp
auto wlan0
#iface wlan0 inet dhcp
配置了iterfaces 就会出现下面的情况。
auto lo
iface lo inet loopback
auto eth2
#iface eth2 inet dhcp
auto ath0
#iface ath0 inet dhcp
iface eth0 inet static
address 192.168.104.118
netmask 255.255.255.0
network 192.168.104.0
broadcast 192.168.104.255
gateway 192.168.104.1
auto wlan0
#iface wlan0 inet dhcp
shoto@shoto-laptop:~$ sudo /etc/init.d/networking restart
* Reconfiguring network interfaces... /etc/network/interfaces:98: duplicate interface
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:98: duplicate interface
ifup: couldn't read interfaces file "/etc/network/interfaces"
[fail]
-
- 帖子: 66
- 注册时间: 2006-12-05 10:53
我也有这个问题
好象这个问题有的人挺多的,我是升了7.10以后才成这样的。
viewtopic.php?t=83143
viewtopic.php?t=83143