LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2578|回复: 17

高手帮帮忙啊,校园网怎么配置才能上网阿

[复制链接]
发表于 2006-4-8 18:36:36 | 显示全部楼层 |阅读模式
在windows下能上的,同样的设置到linux下不能上网了
ping 网关都不通
下面是windows 下的设置
有一个兄弟我的ip或者其他的东西写错了,但是我查了,没有错啊
ip 211.83.26.11

子网掩码255.255.255.224

网关

211.83.23.225

dns

202.202.96.33
 楼主| 发表于 2006-4-8 18:39:25 | 显示全部楼层
ip固定的不能自动获取。
回复 支持 反对

使用道具 举报

发表于 2006-4-8 19:05:53 | 显示全部楼层
我的/etc/network/interface文件类似:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 222.12.222.32 #我的IP
        netmask 255.255.255.0
        network 222.12.222.0
        broadcast 222.12.222.255
        gateway 222.12.222.254
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 202.18.66.6
        dns-search ideawu.net
回复 支持 反对

使用道具 举报

发表于 2006-4-8 20:05:57 | 显示全部楼层
在windows下,进入命令行,用cmd命令

然后,运行ipconfig /all
route print
tracert www.linuxsir.cn

将结果贴出来看看!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-8 22:08:39 | 显示全部楼层
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\wql>ipconfig /all

Windows IP Configuration

        Host Name . . . . . . . . . . . . : LUCYDAVID
        Primary Dns Suffix  . . . . . . . :
        Node Type . . . . . . . . . . . . : Unknown
        IP Routing Enabled. . . . . . . . : Yes
        WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter 本地连接外:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Eth
ernet NIC
        Physical Address. . . . . . . . . : 00-01-6C-2A-26-91
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : 211.83.26.11
        Subnet Mask . . . . . . . . . . . : 255.255.255.224
        IP Address. . . . . . . . . . . . : fe80::201:6cff:fe2a:2691%4
        Default Gateway . . . . . . . . . : 211.83.23.225
        DNS Servers . . . . . . . . . . . : 202.202.96.33
                                            61.128.128.68
                                            fec0:0:0:ffff::1%3
                                            fec0:0:0:ffff::2%3
                                            fec0:0:0:ffff::3%3

Ethernet adapter 本地连接内:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Eth
ernet NIC
        Physical Address. . . . . . . . . : 00-E0-4C-EB-22-AB
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : 192.168.0.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        IP Address. . . . . . . . . . . . : fe80::2e0:4cff:feeb:22ab%5
        Default Gateway . . . . . . . . . :
        DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                            fec0:0:0:ffff::2%1
                                            fec0:0:0:ffff::3%1

Ethernet adapter {E6E350B3-FEC6-4DF6-9906-91D130990D1A}:

        Media State . . . . . . . . . . . : Media disconnected
        Description . . . . . . . . . . . : VCD VNC Adapter - 数据包计划程序微型
端口
        Physical Address. . . . . . . . . : 02-50-F2-3D-00-01

Tunnel adapter Teredo Tunneling Pseudo-Interface:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
        Physical Address. . . . . . . . . : FF-FF-FF-FF-FF-FF-FF-FF
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : fe80::5445:5245:444f%7
        Default Gateway . . . . . . . . . :
        NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter 6to4 Tunneling Pseudo-Interface:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : 6to4 Tunneling Pseudo-Interface
        Physical Address. . . . . . . . . : D3-53-1A-0B
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : 2002:d353:1a0b::d353:1a0b
        Default Gateway . . . . . . . . . : 2002:836b:213c::836b:213c
                                            2002:c058:6301::c058:6301
        DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%3
                                            fec0:0:0:ffff::2%3
                                            fec0:0:0:ffff::3%3
        NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter Automatic Tunneling Pseudo-Interface:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Automatic Tunneling Pseudo-Interface

        Physical Address. . . . . . . . . : D3-53-1A-0B
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : fe80::5efe:211.83.26.11%2
        Default Gateway . . . . . . . . . :
        DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%3
                                            fec0:0:0:ffff::2%3
                                            fec0:0:0:ffff::3%3
        NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter Automatic Tunneling Pseudo-Interface:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Automatic Tunneling Pseudo-Interface

        Physical Address. . . . . . . . . : C0-A8-00-01
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : fe80::5efe:192.168.0.1%2
        Default Gateway . . . . . . . . . :
        DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                            fec0:0:0:ffff::2%1
                                            fec0:0:0:ffff::3%1
        NetBIOS over Tcpip. . . . . . . . : Disabled

C:\Documents and Settings\wql>







Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\wql>ipconfig /all

Windows IP Configuration

        Host Name . . . . . . . . . . . . : LUCYDAVID
        Primary Dns Suffix  . . . . . . . :
        Node Type . . . . . . . . . . . . : Unknown
        IP Routing Enabled. . . . . . . . : Yes
        WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter 本地连接外:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Eth
ernet NIC
        Physical Address. . . . . . . . . : 00-01-6C-2A-26-91
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : 211.83.26.11
        Subnet Mask . . . . . . . . . . . : 255.255.255.224
        IP Address. . . . . . . . . . . . : fe80::201:6cff:fe2a:2691%4
        Default Gateway . . . . . . . . . : 211.83.23.225
        DNS Servers . . . . . . . . . . . : 202.202.96.33
                                            61.128.128.68
                                            fec0:0:0:ffff::1%3
                                            fec0:0:0:ffff::2%3
                                            fec0:0:0:ffff::3%3

Ethernet adapter 本地连接内:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Eth
ernet NIC
        Physical Address. . . . . . . . . : 00-E0-4C-EB-22-AB
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : 192.168.0.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        IP Address. . . . . . . . . . . . : fe80::2e0:4cff:feeb:22ab%5
        Default Gateway . . . . . . . . . :
        DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                            fec0:0:0:ffff::2%1
                                            fec0:0:0:ffff::3%1

Ethernet adapter {E6E350B3-FEC6-4DF6-9906-91D130990D1A}:

        Media State . . . . . . . . . . . : Media disconnected
        Description . . . . . . . . . . . : VCD VNC Adapter - 数据包计划程序微型
端口
        Physical Address. . . . . . . . . : 02-50-F2-3D-00-01

Tunnel adapter Teredo Tunneling Pseudo-Interface:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
        Physical Address. . . . . . . . . : FF-FF-FF-FF-FF-FF-FF-FF
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : fe80::5445:5245:444f%7
        Default Gateway . . . . . . . . . :
        NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter 6to4 Tunneling Pseudo-Interface:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : 6to4 Tunneling Pseudo-Interface
        Physical Address. . . . . . . . . : D3-53-1A-0B
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : 2002:d353:1a0b::d353:1a0b
        Default Gateway . . . . . . . . . : 2002:836b:213c::836b:213c
                                            2002:c058:6301::c058:6301
        DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%3
                                            fec0:0:0:ffff::2%3
                                            fec0:0:0:ffff::3%3
        NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter Automatic Tunneling Pseudo-Interface:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Automatic Tunneling Pseudo-Interface

        Physical Address. . . . . . . . . : D3-53-1A-0B
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : fe80::5efe:211.83.26.11%2
        Default Gateway . . . . . . . . . :
        DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%3
                                            fec0:0:0:ffff::2%3
                                            fec0:0:0:ffff::3%3
        NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter Automatic Tunneling Pseudo-Interface:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Automatic Tunneling Pseudo-Interface

        Physical Address. . . . . . . . . : C0-A8-00-01
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : fe80::5efe:192.168.0.1%2
        Default Gateway . . . . . . . . . :
        DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                            fec0:0:0:ffff::2%1
                                            fec0:0:0:ffff::3%1
        NetBIOS over Tcpip. . . . . . . . : Disabled

C:\Documents and Settings\wql>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 01 6c 2a 26 91 ...... Realtek RTL8139/810x Family Fast Ethernet NIC -
数据包计划程序微型端口
0x3 ...00 e0 4c eb 22 ab ...... Realtek RTL8139/810x Family Fast Ethernet NIC -
数据包计划程序微型端口
0x4 ...02 50 f2 3d 00 01 ...... VCD VNC Adapter - 数据包计划程序微型端口
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    211.83.23.225    211.83.26.11       20
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      192.168.0.0    255.255.255.0      192.168.0.1     192.168.0.1       20
      192.168.0.1  255.255.255.255        127.0.0.1       127.0.0.1       20
    192.168.0.255  255.255.255.255      192.168.0.1     192.168.0.1       20
      211.83.26.0  255.255.255.224     211.83.26.11    211.83.26.11       20
     211.83.26.11  255.255.255.255        127.0.0.1       127.0.0.1       20
    211.83.26.255  255.255.255.255     211.83.26.11    211.83.26.11       20
        224.0.0.0        240.0.0.0      192.168.0.1     192.168.0.1       20
        224.0.0.0        240.0.0.0     211.83.26.11    211.83.26.11       20
  255.255.255.255  255.255.255.255      192.168.0.1               4       1
  255.255.255.255  255.255.255.255      192.168.0.1     192.168.0.1       1
  255.255.255.255  255.255.255.255     211.83.26.11    211.83.26.11       1
Default Gateway:     211.83.23.225
===========================================================================
Persistent Routes:
  None

C:\Documents and Settings\wql>tracert www.linuxsir.cn

Tracing route to www.linuxsir.cn [218.61.34.138]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  211.83.26.1
  2    <1 ms    <1 ms    <1 ms  10.1.1.1
  3     *        *        *     Request timed out.
  4     1 ms     1 ms     1 ms  10.1.72.254
  5     6 ms     6 ms     6 ms  221.5.154.33
  6    13 ms     4 ms     6 ms  221.5.254.141
  7    10 ms     8 ms     4 ms  221.5.254.41
  8     5 ms     3 ms     3 ms  219.158.15.2
  9    57 ms    57 ms    56 ms  219.158.6.49
10    58 ms    55 ms    55 ms  219.158.5.30
11    71 ms    71 ms    70 ms  219.158.7.118
12    76 ms    70 ms    68 ms  cncln.online.ln.cn [218.61.255.194]
13    71 ms    68 ms    70 ms  cncln.online.ln.cn [218.61.255.182]
14    72 ms    75 ms    72 ms  218.25.138.218
15    76 ms    77 ms    76 ms  cncln.online.ln.cn [218.61.34.138]

Trace complete.

C:\Documents and Settings\wql>
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-8 22:12:26 | 显示全部楼层
先谢谢这位兄弟了,我把附件贴上,刚才发的似乎有点乱,附件就是 ipconfig /all等的结果

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2006-4-9 00:55:31 | 显示全部楼层
在linux下:
ipconfig
route -n
ping 211.83.23.225

贴出结果看看
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-9 09:02:38 | 显示全部楼层
Post by vectorspace
先谢谢这位兄弟了,我把附件贴上,刚才发的似乎有点乱,附件就是 ipconfig /all等的结果

[root@localhost ~]# /etc/rc.d/init.d/network restart
正在关闭接口 eth1:                                        [确定]
关闭环回接口:                                             [确定]
弹出环回接口:                                             [确定]
弹出界面 eth1: RTNETLINK answers: Invalid argument
localhost
                                                           [确定]
[root@localhost ~]# ifconfig
eth1      Link encap:Ethernet  HWaddr 00:01:6C:2A:26:91
          inet addr:211.83.26.11  Bcast:211.83.26.31  Mask:255.255.255.224
          inet6 addr: fe80::201:6cff:fe2a:2691/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1077 errors:0 dropped:0 overruns:0 frame:0
          TX packets:176 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:84805 (82.8 KiB)  TX bytes:19459 (19.0 KiB)
          Interrupt:18 Base address:0x6000

lo        Link encapocal Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3142 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3142 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2449218 (2.3 MiB)  TX bytes:2449218 (2.3 MiB)

[root@localhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
211.83.26.0     0.0.0.0         255.255.255.224 U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
[root@localhost ~]# ping 211.83.23.225
connect: Network is unreachable
[root@localhost ~]#
回复 支持 反对

使用道具 举报

发表于 2006-4-9 10:39:24 | 显示全部楼层
你试试:
ifconfig eth1 211.83.26.11 netmask 255.255.255.224 broadcast 255.255.255.255 up
route add default gw 211.83.23.225

然后再贴出下面操作的结果
ifconfig
route -n
ping 211.83.23.225

还有,你用的是什么发布版?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-9 11:45:42 | 显示全部楼层

还是不可以!

[root@localhost ~]# ifconfig eth1 211.83.26.11  netmask 255.255.255.224 broadcast 255.255.255.255 up
[root@localhost ~]# route add default gw 211.83.23.225
SIOCADDRT: 网络不可达
[root@localhost ~]# ifconfig
eth1      Link encap:Ethernet  HWaddr 00:01:6C:2A:26:91
          inet addr:211.83.26.11  Bcast:255.255.255.255  Mask:255.255.255.224
          inet6 addr: fe80::201:6cff:fe2a:2691/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4791 errors:0 dropped:0 overruns:0 frame:0
          TX packets:200 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:302630 (295.5 KiB)  TX bytes:30822 (30.0 KiB)
          Interrupt:18

lo        Link encapocal Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2052 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2052 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2357806 (2.2 MiB)  TX bytes:2357806 (2.2 MiB)

[root@localhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
211.83.26.0     0.0.0.0         255.255.255.224 U     0      0        0 eth1
[root@localhost ~]# ping 211.83.23.225
connect: Network is unreachable
[root@localhost ~]# uname -a
Linux localhost 2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 i686 i386 GNU/Linux
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表