由 bitpapa 在 07-16-2003 15:13 发表:
老大们,帮帮忙吧!我快苦死了!!!关于共享上网的问题!急急!!!!!!!!在线等待!
我的linux 7.3 服务器已经能用adsl拨号上网了,rc.local里添加了这些:
#!/bin/sh
This script will be executed after all the other init scripts.
You can put your own initialization stuff in here if you don't
want to do the full Sys V style init stuff.
echo 1> /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.1.2/30 -o ppp0 -j MASQUERADE
touch /var/lock/subsys/local
网也通了,web server也ok了,可是LAN里机器就是上不了网,为什么???
急急!!!!!!!!急死了!
由 stanlogin 在 07-16-2003 16:03 发表:
你确认LAN机器在“192.168.1.2/30 ”里面?
把“-s 192.168.1.2/30 ”去掉试试~
LAN机器的GATEWAY是否已经设定为SERVER的内部IP?
还有,PING 一下SERVER对外的那个IP,是否通?
_____>小刀
由 bitpapa 在 07-16-2003 18:23 发表:
都试了还是不行!对了pppoe和linux自带的有什么区别么?
由 stanlogin 在 07-16-2003 22:01 发表:
PING 外部的IP能PING 通吗?
_____>小刀
由 bitpapa 在 07-17-2003 01:48 发表:
局域网是通的,和外部没有通!
由 ntbxm 在 07-19-2003 11:11 发表:
lsmod |grep ip_tables 看iptables载入否
否则modprobe ip_tables载入
我也碰到过同样问题
若还不行,发邮件给我:[email protected]
由 空心菜 在 07-19-2003 12:30 发表:
我的也是这样,
我的设置:
R9.0通过eth0上网,eth1接hub
eth0:192.168.0.1 255.255.255.0
eth1:192.168.0.2 255.255.255.0
内网机子均为XP
:ip 192.168.0.X 255.255.255.0
网关 192.168.0.1
DNS 192.168.0.1(不行)
isp没给 我DNS
内网机子192.168.0.X能ping通192.168.0.1但ping不通外网
R9.0也能ping通内网机子
R9.0能上网,
#!/bin/sh
This script will be executed after all the other init scripts.
You can put your own initialization stuff in here if you don't
want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth1 -j MASQUERADE
~
~
[root@localhost root]# lsmod | grep ip_tables
ip_tables 14648 6 [ipt_REJECT iptable_filter ipt_MASQUERADE iptable_nat]
还望高手解答爱
雪中兜售空心菜
只为过个快乐年
由 空心菜 在 07-19-2003 12:32 发表:
后来,我用adsl-connect
把DNS添加了,
可还是不行,
雪中兜售空心菜
只为过个快乐年
由 ntbxm 在 07-22-2003 09:09 发表:
其实网上很多文章都写的不错的。但以我的看来,有些细节在局域网中可能有所不同。
你的配置大致没问题,我的建议如下(以客户端能出去为目的,详细的防火墙规则参考网上文章)
1.eth0接hub,建议netmask 不要和eth1相同网段,如199.10.10.1/255.255.255.0->199.10.0.1/255.255.0.0
2.dns ->202.96.134.133
3.R9.0能拨号后,你逐步执行如下指令:
a. vi /etc/sysctl.conf
改 net.ipv4.ip_forwd=1
b. 执行 sysctl -w net.ipv4.ip_forward=1
c. lsmod |grep ip_tables 确认ip_tables 已载入,若没,执行 modprobe ip_tables
d. iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o ppp0 -j MASQUERADE
e. route 确认默认网关为ppp0
f. iptables -t nat -L -n 查看d步结果,若有"POSTROUTING",恭喜,你差不多了
g. 客户端改: 网关:192.168.0.1 DNS 202.96.134.133
简单吧!以上指令建议一条一条的执行,先不要用文档方式执行,以免不知道出什么问题,祝好运!
由 oyzjin 在 07-22-2003 09:18 发表:
> quote:
>
> * * *
>
> 最初由 osoftware 发表
>
> **我的也是这样,
>
> 我的设置:
>
> R9.0通过eth0上网,eth1接hub
>
> eth0:192.168.0.1 255.255.255.0
>
> eth1:192.168.0.2 255.255.255.0
>
> 内网机子均为XP
>
> :ip 192.168.0.X 255.255.255.0
>
> 网关 192.168.0.1
>
> DNS 192.168.0.1(不行)
>
> isp没给 我DNS
>
> 内网机子192.168.0.X能ping通192.168.0.1但ping不通外网
>
> R9.0也能ping通内网机子
>
> R9.0能上网,
>
> #!/bin/sh
>
> #
>
> # This script will be executed after all the other init scripts.
>
> # You can put your own initialization stuff in here if you don't
>
> # want to do the full Sys V style init stuff.
>
>
>
> touch /var/lock/subsys/local
>
>
>
>
>
> echo 1 > /proc/sys/net/ipv4/ip_forward
>
> iptables -t nat -A **