找回密码
 注册
查看: 611|回复: 4

还是这个FC3共享ADSL上网的问题,搞不定啊,求救!!!

[复制链接]
发表于 2005-4-20 19:09:42 | 显示全部楼层 |阅读模式
原贴在此:http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=114098

我现将问题集中的提一下,望高人指点迷津。

机器是Dell的PowerEdge服务器,装有两块网卡,外网卡是eth1,IP地址设为192.168.0.1,通过它连接ADSL,内网卡是eth0,IP地址是192.168.2.254。系统是Fedora Core3,在KDE下作业。两块网卡均未设置网关,这在图形化的“网络配置”窗口中可以看出。接下来按照http://blog.csdn.net/shanyou/archive/2003/03/07/10038.aspx所叙述的步骤进行网络接入设置,当然只用到NAT方式,未用其所提及的”透明代理“方式。我所改动的配置文件是:

[sysctl.conf〕:
###################
# Controls IP packet forwarding
net.ipv4.ip_forward = 1

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

##################
[rc.local]:

# echo l > /proc/sys/net/ipv4/icmp_echo_ignore_all
echo "1" > /proc/sys/net/ipv4/ip_forward
/sbin/modprobe iptable_filter
/sbin/modprobe ip_tables
/sbin/modprobe iptable_nat
/sbin/iptables -F -t nat
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o ppp0 -j MMASQUERADE
###################

Windows客户端均采用固定IP,网关为内网的IP,DNS设为电信给的IP。
重启Linux后,Windows和Linux可以互相ping通。拨号连线,FC3上已经可以浏览网页了。这时打开Windows上的FireFox,却怎么也不能向文章所介绍的那样登录到Internet。我不知道问题究竟出在哪里,有人说要试试DNS转发,我不知道该怎样设置。已经好几天了,一点进展也没有,是否还要动到其它的配置文件?请高人帮忙出具一份完整的解决方案,我不想现在用到Squid那样的复杂东西,只是求简单的ADSL共享。谢谢了。
 楼主| 发表于 2005-4-20 19:38:51 | 显示全部楼层
补充一点信息:
ADSL拨通后,用ifconfig查看得到的信息如下:

eth0      Link encap:Ethernet  HWaddr 00:0A:EB:6F:EC:F2
          inet addr:192.168.2.254  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::20a:ebff:fe6f:ecf2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:464 errors:0 dropped:0 overruns:0 frame:0
          TX packets:486 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:40616 (39.6 KiB)  TX bytes:77669 (75.8 KiB)
          Interrupt:177 Base address:0xdc00

eth1      Link encap:Ethernet  HWaddr 00:13:20:2D:B9:80
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::213:20ff:fe2d:b980/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1167 errors:0 dropped:0 overruns:0 frame:0
          TX packets:996 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:442659 (432.2 KiB)  TX bytes:124437 (121.5 KiB)
          Interrupt:169

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1715 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1715 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1514164 (1.4 MiB)  TX bytes:1514164 (1.4 MiB)

ppp0      Link encapoint-to-Point Protocol
          inet addr:222.95.18.223  P-t-P:24.24.24.24  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:777 errors:0 dropped:0 overruns:0 frame:0
          TX packets:524 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:397287 (387.9 KiB)  TX bytes:71129 (69.4 KiB)

再执行route,得到的信息如下:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
cpe-24-24-24-24 *               255.255.255.255 UH    0      0        0 ppp0
192.168.2.0     *               255.255.255.0   U     0      0        0 eth0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth1
169.254.0.0     *               255.255.0.0     U     0      0        0 eth1
default         cpe-24-24-24-24 0.0.0.0         UG    0      0        0 ppp0

我猜想问题可能出在路由出口上,不知对不对?另外,在用adsl-setup时,对DNS设置段也是使用电信给的IP.
回复

使用道具 举报

发表于 2005-4-20 22:16:54 | 显示全部楼层
回复

使用道具 举报

发表于 2005-4-21 11:18:12 | 显示全部楼层
“iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o ppp0 -j MMASQUERADE“
你的这句话写错了
MASQUERADE不是MMASQUERADE
好好检查一下啊
回复

使用道具 举报

 楼主| 发表于 2005-4-22 09:25:41 | 显示全部楼层
:D ,谢谢,我再看看。
回复

使用道具 举报

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

本版积分规则

GMT+8, 2025-2-22 17:25 , Processed in 0.077737 second(s), 15 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

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