LinuxSir.cn,穿越时空的Linuxsir!

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

网络问题(会被人歧视么?)

[复制链接]
发表于 2008-5-25 00:55:08 | 显示全部楼层 |阅读模式
好长一段时间,我都是在ubuntu下玩弄,习惯了gnome,我发现我自己忘记了最初记下来的命令行,忘记了在文本界面下配置系统
不久前一朋友问我你这样与在windows下有什么区别我居然回答不了——确实背离初衷太远了

于是某日我决定再次来到archlinux的怀抱,可是习惯了

networkmanager,我居然连网络都不会配置了!!!!
还记得之前发过一个帖子,当时我的网卡不能被0.7的识别,而今发这么一个帖子,不知道会不会被歧视?……
我在校园网下
windows下的端口信息如下

  1. 实际地址: 00-E0-B0-E2-7B-26
  2. IP 地址: 211.66.**.78
  3. 子网掩码: 255.255.255.0
  4. 默认网关: 211.66.**.254
  5. DNS 服务器: 202.112.17.33, 202.38.193.33
  6. WINS 服务器:
复制代码
  1. ping 127.0.0.1
复制代码

没有问题

  1. ping -b 211.66.**.254
复制代码

却始终ping不通

rc.conf如下

  1. #
  2. # /etc/rc.conf - Main Configuration for Arch Linux
  3. #

  4. # -----------------------------------------------------------------------
  5. # LOCALIZATION
  6. # -----------------------------------------------------------------------
  7. #
  8. # LOCALE: available languages can be listed with the 'locale -a' command
  9. # HARDWARECLOCK: set to "UTC" or "localtime"
  10. # USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
  11. # TIMEZONE: timezones are found in /usr/share/zoneinfo
  12. # KEYMAP: keymaps are found in /usr/share/kbd/keymaps
  13. # CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
  14. # CONSOLEMAP: found in /usr/share/kbd/consoletrans
  15. # USECOLOR: use ANSI color sequences in startup messages
  16. #
  17. LOCALE="zh_CN.utf8"
  18. HARDWARECLOCK="localtime"
  19. USEDIRECTISA="yes"
  20. TIMEZONE="Asia/Shanghai"
  21. KEYMAP="us"
  22. CONSOLEFONT=
  23. CONSOLEMAP=
  24. USEcolor="yes"

  25. # -----------------------------------------------------------------------
  26. # HARDWARE
  27. # -----------------------------------------------------------------------
  28. #
  29. # MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
  30. # MOD_BLACKLIST: Prevent udev from loading these modules
  31. # MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
  32. #
  33. # NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
  34. #
  35. MOD_AUTOLOAD="yes"
  36. #MOD_BLACKLIST=() #deprecated
  37. MODULES=(sky2 slhc snd-mixer-oss snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd snd-hda-intel soundcore)

  38. # Scan for LVM volume groups at startup, required if you use LVM
  39. USELVM="no"

  40. # -----------------------------------------------------------------------
  41. # NETWORKING
  42. # -----------------------------------------------------------------------
  43. #
  44. # HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
  45. #
  46. HOSTNAME="leung"

  47. # Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
  48. #
  49. # Interfaces to start at boot-up (in this order)
  50. # Declare each interface then list in INTERFACES
  51. #   - prefix an entry in INTERFACES with a ! to disable it
  52. #   - no hyphens in your interface names - Bash doesn't like it
  53. #
  54. # DHCP:     Set your interface to "dhcp" (eth0="dhcp")
  55. # Wireless: See network profiles below
  56. #
  57. eth0="eth0 211.66.**.78 netmask 255.255.255.0 broadcast 211.66.**.254"
  58. INTERFACES=(eth0)

  59. # Routes to start at boot-up (in this order)
  60. # Declare each route then list in ROUTES
  61. #   - prefix an entry in ROUTES with a ! to disable it
  62. #
  63. gateway="default gw 211.66.**.254"
  64. ROUTES=(gateway)

  65. # Enable these network profiles at boot-up.  These are only useful
  66. # if you happen to need multiple network configurations (ie, laptop users)
  67. #   - set to 'menu' to present a menu during boot-up (dialog package required)
  68. #   - prefix an entry with a ! to disable it
  69. #
  70. # Network profiles are found in /etc/network.d
  71. #
  72. # This now requires the netcfg package
  73. #
  74. #NETWORKS=(main)

  75. # -----------------------------------------------------------------------
  76. # DAEMONS
  77. # -----------------------------------------------------------------------
  78. #
  79. # Daemons to start at boot-up (in this order)
  80. #   - prefix a daemon with a ! to disable it
  81. #   - prefix a daemon with a @ to start it up in the background
  82. #
  83. DAEMONS=(syslog-ng network netfs crond)
复制代码


resolv.conf

  1. #
  2. # /etc/resolv.conf
  3. #

  4. #search <yourdomain.tld>
  5. #nameserver <ip>
  6. nameserver 202.112.17.33
  7. nameserver 202.38.193.33
  8. # End of file
复制代码


反复看了很久wiki,也google了很久,但是ping 网关211.66.**.254还是不行,ping学校的主页地址www.scut.edu.cn返回是未知主机……
难道是gateway的设置?(其实gateway实在搞不懂是什么东西……)
那位大侠帮忙?万分感谢?
发表于 2008-5-25 03:44:45 | 显示全部楼层
写了这么多都没说到点上!是固定IP还是DHCP?网卡驱动上了吗?lspci看一下
回复 支持 反对

使用道具 举报

发表于 2008-5-25 09:18:54 | 显示全部楼层
eth0="eth0 211.66.**.78 netmask 255.255.255.0 broadcast 211.66.**.254"
INTERFACES=(eth0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 211.66.**.254"
ROUTES=(gateway)

是真的写的 ** 还是贴出来的时候改了?

贴一下 sudo ifconfig, sudo route -n
回复 支持 反对

使用道具 举报

发表于 2008-5-25 11:03:43 | 显示全部楼层
楼主的配置很奇怪。
我用的也是静态IP,gateway都是xxx.xxx.xxx.1,而 broadcast则为 xxx.xxx.xxx.255
希望对你有帮助。

至于 ping 网关211.66.**.254 不通 可能是网关不允许ping。我的就是这样,但是能正常使用网络。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-5-25 11:33:39 | 显示全部楼层
Post by qiang_liu8183;1854630
写了这么多都没说到点上!是固定IP还是DHCP?网卡驱动上了吗?lspci看一下

谢谢,如果是dhcp那我就不用管那个配置了……另外关于网卡驱动我记得之前在网上看见某人说ping 127.0.0.1 正常的话就是网卡正常使用了
引用:
eth0="eth0 211.66.**.78 netmask 255.255.255.0 broadcast 211.66.**.254"
INTERFACES=(eth0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
# - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 211.66.**.254"
ROUTES=(gateway)
是真的写的 ** 还是贴出来的时候改了?

贴一下 sudo ifconfig, sudo route -n

这个明显是我贴出来的时候改的……

楼主的配置很奇怪。
我用的也是静态IP,gateway都是xxx.xxx.xxx.1,而 broadcast则为 xxx.xxx.xxx.255
希望对你有帮助。

至于 ping 网关211.66.**.254 不通 可能是网关不允许ping。我的就是这样,但是能正常使用网络。

关于ping 网关
我对比过在视窗下,ok的
而且我也记得之前在ubuntu下也没有问题
回复 支持 反对

使用道具 举报

发表于 2008-5-25 12:28:06 | 显示全部楼层
Post by liangfaxiang;1854709

另外关于网卡驱动我记得之前在网上看见某人说ping 127.0.0.1 正常的话就是网卡正常使用了


咳..127.0.0.1是本机IP啊..和网卡有什么关系?..你没网卡也能ping这个的吧?
怎么你没有这行的 lo="lo 127.0.0.1" ...- -..!!


broadcast 211.66.**.254 把254改成255看看.

还有你确定你的网卡工作正常了?
回复 支持 反对

使用道具 举报

发表于 2008-7-3 16:11:31 | 显示全部楼层
我想问下,“USEDIRECTISA"这个选项有什么用?
回复 支持 反对

使用道具 举报

发表于 2008-7-3 17:55:49 | 显示全部楼层
broadcast是不能和网关一个地址的,不要想当然。我以前也是这样。

至于USEDIRECTISA这个,新的rc.conf是关闭的,原来是yes。。
回复 支持 反对

使用道具 举报

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

本版积分规则

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