LinuxSir.cn,穿越时空的Linuxsir!

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

能否用DHCP实现下面图示的功能?怎么实现?

[复制链接]
发表于 2005-11-5 02:37:37 | 显示全部楼层 |阅读模式
贴图如下:
怎么共享PC1的eth0网络,让其他(PC2----PCx)都可以通过PC1的eth0上网?

本帖子中包含更多资源

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

x
发表于 2005-11-5 04:42:13 | 显示全部楼层
eth1:dhcp+squid
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-11-5 10:31:18 | 显示全部楼层
兄弟能详细说一下么?具体怎么设置,我是菜鸟
回复 支持 反对

使用道具 举报

发表于 2005-11-5 12:20:49 | 显示全部楼层
最简单的办法是自己做个路由器;用m0n0 来架,机器最低配就行。150块一台,我在二手市场就弄了一台。

http://m0n0.ch/wall

DHCP 和各种上网方式,一个m0n0就打尽了。。。

简单、高效、最容易用,我现在就在用着。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-11-5 12:30:36 | 显示全部楼层
我贴几个配置文件吧
wxd@Gentoo ~ $ cat /etc/dhcp/dhcpd.conf
authoritative;
ddns-update-style interim;
subnet 192.168.0.0 netmask 255.255.255.0 {
    range 192.168.0.100 192.168.0.250;
    default-lease-time 259200;
    max-lease-time 518400;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.0.255;
    option routers 192.168.0.1;
    option domain-name-servers 192.168.0.1;
}
subnet 218.193.29.0 netmask 255.255.255.0 {
}
wxd@Gentoo ~ $ cat /etc/conf.d/dhc
dhcp      dhcrelay
wxd@Gentoo ~ $ cat /etc/conf.d/dhcp
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcp.conf,v 1.7 2004/12/20 18:54:23 max Exp $

# Configure which interface or interfaces to for dhcp to listen on
# list all interfaces space separated.
IFACE="eth1"

# Insert any other options needed
DHCPD_OPTS="-q"

# If you wish to run dhcp in a chroot, run:
# ebuild /var/db/pkg/net-misc/<dhcp version>/<dhcp-version>.ebuild config
# and un-comment the following line.
# You can specify a different chroot directory but MAKE SURE it's empty.
#CHROOT="/chroot/dhcp"

# If you need name resolution under a chroot, uncomment the following:
#export LD_PRELOAD="/usr/lib/libresolv.so /usr/lib/libnss_dns.so"


eth0怎么共享上网呢?
一直没搞明白. :help
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-11-6 09:11:02 | 显示全部楼层
已经搞定,呵呵,用DHCP+IPtables实现了
回复 支持 反对

使用道具 举报

发表于 2005-11-6 10:19:10 | 显示全部楼层
DHCP+IPTABLES的NAT CHAIN就可以了 什么都不用设置
打开pc1的ip_forward 做条路由
PC1就是DHCP服务器+路由器。。
南北说的是 可以把PC1都省了。。150自己做一个路由吧。。
回复 支持 反对

使用道具 举报

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

本版积分规则

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