LinuxSir.cn,穿越时空的Linuxsir!

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

为什么会出现网络配置文件无效?

[复制链接]
发表于 2008-3-25 10:31:03 | 显示全部楼层 |阅读模式
为什么我配置的 resolve.conf,interfaces文件都不起作用那?配置好后也尝试过重启,还是不起作用。另外,使用ifconfig 配置后,可以ping通网关,但是提示无法解析域名,dns 配置正确,也可以正常工作(我现在就在win下上网,相同的dns)。
谢谢!下面是相关配置文件,及ifconfig -a 的显示结果。

/etc/resolve.conf 如下:

  1. nameserver 202.118.176.4
  2. nameserver 202.118.176.2
复制代码


/etc/network/interfaces 如下:

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

  3. # The loopback network interface
  4. auto lo
  5. iface lo inet loopback

  6. # The primary network interface
  7. allow lo  eth0
  8. iface eth0 inet static
  9.         hwaddress  ether 00:E0:4C:43:B2:8B
  10.         address 58.155.108.130
  11.         netmask 255.255.255.0
  12.         network 58.155.0.0
  13.         broadcast 255.255.255.255
  14.         gateway 58.155.0.1
  15.         # dns-* options are implemented by the resolvconf package, if installed
  16.         dns-nameservers 202.118.176.4 202.118.176.2

  17. allow lo eth1
  18. iface eth1 inet static
  19.         address 192.168.0.1
  20.         network 192.168.0.0
  21.         broadcast 255.255.255.255
  22. #        gateway 192.168.0.1
  23.         dns-nameservers 202.118.176.4 202.118.176.2
复制代码


ifconfig -a 显示如下:
  1. eth0      Link encap:Ethernet  HWaddr 00:11:11:33:a6:dd  
  2.           BROADCAST MULTICAST  MTU:1500  Metric:1
  3.           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  4.           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  5.           collisions:0 txqueuelen:1000
  6.           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

  7. eth1      Link encap:Ethernet  HWaddr 00:e0:4c:b1:d5:14  
  8.           BROADCAST MULTICAST  MTU:1500  Metric:1
  9.           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  10.           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  11.           collisions:0 txqueuelen:1000
  12.           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
  13.           Interrupt:201 Base address:0xd800

  14. lo        Link encap:Local Loopback  
  15.           inet addr:127.0.0.1  Mask:255.0.0.0
  16.           inet6 addr: ::1/128 Scope:Host
  17.           UP LOOPBACK RUNNING  MTU:16436  Metric:1
  18.           RX packets:16 errors:0 dropped:0 overruns:0 frame:0
  19.           TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
  20.           collisions:0 txqueuelen:0
  21.           RX bytes:800 (800.0 B)  TX bytes:800 (800.0 B)

  22. sit0      Link encap:IPv6-in-IPv4  
  23.           NOARP  MTU:1480  Metric:1
  24.           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  25.           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  26.           collisions:0 txqueuelen:0
  27.           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
复制代码
 楼主| 发表于 2008-3-27 15:05:58 | 显示全部楼层
现在工作正常了。interfaces文件如下:
# We always want the loopback interface.
#
auto lo
iface lo inet loopback

# An example ethernet card setup: (broadcast and gateway are optional)
#
auto eth0
iface eth0 inet static
     hwaddress ether 00:E2:4C:43:B2:8B
     address 58.155.108.130
     network 58.155.0.0
     netmask 255.255.255.0
     broadcast 255.255.255.0
     gateway 58.155.108.1
auto eth1
iface eth1 inet static
     address 192.168.0.1
     network 192.168.0.0
     netmask 255.255.255.0
     broadcast 255.255.255.0
回复 支持 反对

使用道具 举报

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

本版积分规则

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