LinuxSir.cn,穿越时空的Linuxsir!

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

请教debian下局域网共享上网设置问题

[复制链接]
发表于 2008-2-27 18:55:34 | 显示全部楼层 |阅读模式
主机A通过windows拨号认证连到外网

主机B装的是debian,通过主机A下接的路由器共享上网
ip配置应该是
ip 192.168.0.22
掩码:255.255.255.0
网关:192.168.0.1
DNS:xxx

我知道有一种方法就是修改
这个文件/etc/network/interfaces
但是现在这个文件被我改的乱七八糟的,格式也全混乱了,哪位兄弟可不可以把你的相似配置帖上来我看看呀



还有一个问题就是,我机子上装了双网卡,怎么知道配置/etc/network/interfaces时应该写eth0还是eth1呢?


多谢了哦!!
发表于 2008-2-27 22:59:04 | 显示全部楼层
zy@debian:~$ cat /etc/network/interfaces
#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
auto eth0
iface eth0 inet dhcp        <==局域网共享的设置
#iface eth0 inet static
#      address 10.2.6.6
#      netmask 255.255.255.0
#      gateway 10.2.6.254
#iface eth0 inet static
#       address 219.237.206.110
#       netmask 255.255.255.224
#       gateway 219.237.206.97
#iface eth0 inet static
#      address 10.2.17.202
#      netmask 255.255.255.0
#      gateway 10.2.17.254
#iface eth0 inet static
#      address 10.2.7.206
#      netmask 255.255.255.0
#      gateway 10.2.7.254
#iface eth0 inet static
#      address 10.2.100.202
#      netmask 255.255.255.0
#      gateway 10.2.100.254
回复 支持 反对

使用道具 举报

发表于 2008-2-27 22:59:52 | 显示全部楼层
至于是eth0还是eth1,只能自己测试一下了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-2-28 13:51:13 | 显示全部楼层
Post by yuzheng;1820833
zy@debian:~$ cat /etc/network/interfaces
#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
auto eth0
iface eth0 inet dhcp        <==局域网共享的设置
#iface eth0 inet static
#      address 10.2.6.6
#      netmask 255.255.255.0
#      gateway 10.2.6.254
#iface eth0 inet static
#       address 219.237.206.110
#       netmask 255.255.255.224
#       gateway 219.237.206.97
#iface eth0 inet static
#      address 10.2.17.202
#      netmask 255.255.255.0
#      gateway 10.2.17.254
#iface eth0 inet static
#      address 10.2.7.206
#      netmask 255.255.255.0
#      gateway 10.2.7.254
#iface eth0 inet static
#      address 10.2.100.202
#      netmask 255.255.255.0
#      gateway 10.2.100.254



呵呵,谢谢呀
昨天捣腾了一下,发现之前我已经配置好了,是网线的问题导致没法上网,
我贴下我自己的吧:
auto lo
iface lo inet loopback
mapping eth0
        script grep
        map eth0
allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.0.22
netmask 255.255.255.0
gateway 192.168.0.1


大家看上头这几行如果有无用多余的,还请指正呀
回复 支持 反对

使用道具 举报

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

本版积分规则

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