LinuxSir.cn,穿越时空的Linuxsir!

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

帮看看这样的网络环境该怎么配置网络

[复制链接]
发表于 2008-8-7 22:42:35 | 显示全部楼层 |阅读模式
整栋楼使用有线公用路由器上网.
我需要指定我的IP:192.168.1.37
路由器地址:192.168.1.1
子网掩码:255.255.255.0
DNS:221.7.126.68和221.7.136.68

帮忙看看
/etc/rc.conf和/etc/resolv.conf和/etc/hosts

/etc/resolver.conf和/etc/hosts我会..
但是为了安全起见还是帮忙一起写下来..
发表于 2008-8-7 23:03:07 | 显示全部楼层
rc.conf 网络部分
  1. # interfaces.
  2. #
  3. # Interfaces to start at boot-up (in this order)
  4. # Declare each interface then list in INTERFACES
  5. #   - prefix an entry in INTERFACES with a ! to disable it
  6. #   - no hyphens in your interface names - Bash doesn't like it
  7. #
  8. # Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
  9. #
  10. lo="lo 127.0.0.1"
  11. eth0="eth0 192.168.1.37 netmask 255.255.255.0 broadcast 192.168.1.255"
  12. INTERFACES=(lo eth0)
  13. #
  14. # Routes to start at boot-up (in this order)
  15. # Declare each route then list in ROUTES
  16. #   - prefix an entry in ROUTES with a ! to disable it
  17. #
  18. gateway="default gw 192.168.1.1"
  19. ROUTES=(gateway)
  20. #
  21. # Enable these network profiles at boot-up.  These are only useful
  22. # if you happen to need multiple network configurations (ie, laptop users)
  23. #   - set to 'menu' to present a menu during boot-up (dialog package required)
  24. #   - prefix an entry with a ! to disable it
  25. #
  26. # Network profiles are found in /etc/network-profiles
复制代码


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

  4. #search <yourdomain.tld>
  5. #nameserver <ip>
  6. nameserver 221.7.126.68
  7. nameserver 221.7.136.68
  8. # End of file
复制代码
回复 支持 反对

使用道具 举报

发表于 2008-8-7 23:06:27 | 显示全部楼层
lo不用写了,在/etc/rc.sysinit里已经有了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-8-7 23:10:05 | 显示全部楼层
那就怪了..我是这样设置的但是不行啊..
hostname那里我写TonyMikero
然后/etc/hosts里我写
192.168.1.37 Tony's PC TonyMikero
有错么
回复 支持 反对

使用道具 举报

发表于 2008-8-8 09:21:59 | 显示全部楼层
Post by TonyMikero;1883776
那就怪了..我是这样设置的但是不行啊..
hostname那里我写TonyMikero
然后/etc/hosts里我写
192.168.1.37 Tony's PC TonyMikero
有错么


/etc/rc.conf
  1. # -----------------------------------------------------------------------
  2. # NETWORKING
  3. # -----------------------------------------------------------------------
  4. #
  5. # HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
  6. #
  7. HOSTNAME="[color="Red"]TonyMikero[/color]"
复制代码


/etc/hosts
  1. #
  2. # /etc/hosts: static lookup table for host names
  3. #

  4. #<ip-address> <hostname.domain.org>        <hostname>
  5. 127.0.0.1      localhost.localdomain         localhost
  6. 192.168.1.37   [color="Red"]TonyMikero.localdomain[/color]         [color="Red"]TonyMikero[/color]
  7. # End of file
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-8-8 11:39:50 | 显示全部楼层
已经解决。谢谢
回复 支持 反对

使用道具 举报

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

本版积分规则

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