12 12
发新话题
打印

关于安装时设置网络

关于安装时设置网络

使用LiveCD安装,在设置网络时卡住了
2.4的内核认不出我的网卡,于是改用SMP启动,认出了

首先ping不通
例:#ping -c 3 www.yahoo.com
ping:unknown host www.yahoo.com
于是#net-setup
选了1 USE DHCP to auto-detect my network settings
系统提示Type "ifconfig" to make sure
#ifconfig 《---注意以下与官方手册上显示的有所不同
lo Link encapocal Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:24 errors:0 dropped:0 overruns:0 frame:0
TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1744 (1.7 Kb) TX bytes:1744 (1.7 Kb)

再试#ifconfig eth0 〈〈---以下与官方手册上显示的有所不同
eth0 Link encap:Ethernet HWaddr 00:B0:5C:A0:0F:51
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:3540 (3.4 Kb)
Interrupt:5 Base address:0xe800
#dhcpcd eth0
再#ping -c 3 www.yahoo.com
错误同上,现在该怎么办?

PS:我是通过路由器上网的(NOT hub),路由器开了DHCP服务
详情看这里
http://www.linuxeden.com/forum/s ... amp;threadid=105999      

TOP

先不用网络,用liveCD上的2.6.*的内核源码装上基本系统。      
没有签名

TOP

你说得对,网卡是没激活

我装好了gentoo-2.6.5(stage3),然后按照官方手册上所说的改
# /etc/conf.d/net:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface
#
iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
iface_eth0="dhcp"[/COLOR]
#dhcpcd_eth0="..."

# For adding aliases to a interface
#
#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.
#
# To add a custom netmask/broadcast address to created aliases,
# uncomment and change accordingly.  Leave commented to assign
# defaults for that interface.
#
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"


# For setting the default gateway
#
#gateway="eth0/192.168.0.1"

然后
#rc-update add net.eth0 default
重起后
*Bringing eth0 up...
*Failed to bring eth0 up[/COLOR]
*ERRORroblem starting needed services "netmount" was not started[/COLOR]
这时该怎么办?
:confused:      

TOP

等等,我发现错误了。。。      

TOP

忘了把这行注释掉了
iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

注释掉后重新
#rc-update add net.eth0 default
重起后问题依旧:
*Bringing eth0 up...
*Failed to bring eth0 up
*ERRORroblem starting needed services "netmount" was not started
:confused:
附:我的#rc-update show
            bootmisc | boot                  
             checkfs | boot                  
           checkroot | boot                  
               clock | boot                  
         consolefont | boot                  
         crypto-loop |                        
          domainname |      default           
                 gpm |      default           
              hdparm |                        
            hostname | boot                  
             keymaps | boot                  
               local |      default nonetwork
          localmount | boot                  
             modules | boot                  
            net.eth0 |      default           
              net.lo | boot                  
            netmount |      default           
                nscd |                        
             numlock |                        
           rmnologin | boot                  
              rsyncd |                        
              serial | boot                  
                sshd |                        
           syslog-ng |      default           
             urandom | boot      

TOP

把你的/etc/rc.conf/net
中的,相应的语句改为这样:
iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
#iface_eth0="dhcp"
重新启动网卡#/etc/init.d/net.eth0 restart
(注意回现结果)
再#dhcpcd eth0
(正常的话3秒左右,如果很长时间没有动静,就是你的dhcp服务器配置不正确或者网络连接有问题)
#ifconfig
#ping yahoo.com      
愿吐尽心头烈火 焚却宇宙之索莫

TOP

这个你看了没有
http://www.gentoo.org/doc/tw/han ... ap=3#ifconfig_route      
愿吐尽心头烈火 焚却宇宙之索莫

TOP

按你说的到这步#/etc/init.d/net.eth0 restart
*Unmounting network filesystems...[ok]
*Bringing eth0 down...[ok]
*Bringing eth0 up...[ok]
*Mounting network filesystems...[ok]
再#dhcpcd eth0 《---等了很长时间
#ifconfig
lo        Link encapocal Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1848 (1.8 Kb)  TX bytes:1848 (1.8 Kb)

#ping -c 3 www.yahoo.com
ping:unknown host www.yahoo.com
#ping 192.168.1.1
connect:Network is unreachable

现在是不是按照http://www.gentoo.org/doc/tw/handbo...#ifconfig_route
设路由,IP,网关等?:confused:

路由器设置有错误吗?(我第一次接触路由器:w)

附:(1)路由器运行状态
LAN口状态
  MAC:00-0A-EB-C3-48
  IP地址:192.168.1.1
  子网掩码:255.255.255.0
WAN口状态(PPPoE)
  MAC:00-0A-EB-C3-10-49
  IP地址:10.19.67.3
  子网掩码:255.0.0.0
  网关:10.19.67.3
  DNS服务器:202.96.199.133,10.16.1.24
PPPoE高级设置:
  数据包MTU:1492
  DNS服务器:202.96.199.133
  备用DNS服务器:10.16.1.24
DHCP服务(192.168.1.100~192.168.1.199)
  地址租期120分钟

我的:客户端主机名school-db0d29d0
     客户端MAC地址:00-B0-5C-A0-0F-51
     已分配IP地址:192.168.1.100
IP地址过滤,域名过滤,MAC地址过滤(都已关闭)
静态路由表(没填,空着)

(2)C:\>ipconfig /all

Windows 2000 IP Configuration

        Host Name . . . . . . . . . . . . : school-db0d29d0
        Primary DNS Suffix  . . . . . . . :
        Node Type . . . . . . . . . . . . : Broadcast
        IP Routing Enabled. . . . . . . . : No
        WINS Proxy Enabled. . . . . . . . : No
        DNS Suffix Search List. . . . . . : domain

Ethernet adapter 本地连接:

        Connection-specific DNS Suffix  . : domain
        Description . . . . . . . . . . . : VIA VT6105 Rhine III Fast Ethernet A
dapter
        Physical Address. . . . . . . . . : 00-B0-5C-A0-0F-51
        DHCP Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 192.168.1.100
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1
        DHCP Server . . . . . . . . . . . : 192.168.1.1
        DNS Servers . . . . . . . . . . . : 202.96.128.68
                                            202.96.134.188
                                            202.96.134.133
                                            192.168.1.1
        Lease Obtained. . . . . . . . . . : 2004年9月5日 23:41:45
        Lease Expires . . . . . . . . . . : 2004年9月6日 1:41:45      

TOP

依样画葫芦,我改了一下/etc/conf.d/net

iface_eth0="192.168.1.100 broadcast 192.168.1.255 netmask 255.255.255.0"
gateway="eth0/192.168.1.1"
结果可以ping通192.168.1.1和自己,但是ping不通yahoo之类的外部网站,大概是DNS没设好:confused:

还有如果我把我的IP设成静态的,我同学的为动态的(让路由器自由分配),两者是否能共存?      

TOP

好象是可以共存的,我又试了一下,把我的IP(192.168.1.201)设在DHCP地址池(192.168.1.100~~192.168.1.199)以外,然后在"静态地址分配"里加入我的IP和MAC,2000里也做相应的修改,重起路由器后,我的租期变成了“永久”(看来成功了:w )

然后gentoo下做相应修改
[CODE]iface_eth0="192.168.1.201 broadcast 192.168.1.255 netmask 255.255.255.0"[/CODE]
这时也能ping通自己和192.168.1.1
就是ping不通yahoo,看来问题只剩下DNS还没解决了

我不知道 linux下该用什么命令(或哪个配置文件)设DNS服务器啊?      

TOP

 12 12
发新话题