2007/5/13, Fabio A Correa <[EMAIL PROTECTED]>:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Wu,

Instead of the commands you posted, you should use

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --table nat -A POSTROUTING -s 192.168.8.0/24 -j MASQUERADE

I have tried.But still not work.
Here is the information after execute your advice:
-------------------------------------------------------------------------------------------------
[EMAIL PROTECTED] ~]# echo 1 > /proc/sys/net/ipv4/ip_forward
[EMAIL PROTECTED] ~]# iptables --table nat -A POSTROUTING -s
192.168.1.0/24 -j MASQUERADE
[EMAIL PROTECTED] ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
[EMAIL PROTECTED] ~]# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  --  192.168.1.0/24       anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

------------------------------------------------------------------------------
Then in my other PCs,I still can't ping the website outside.
Why?


Long explanation:

The first command enables the kernel to _forward_ packets from eth0 to eth1 and 
vice versa. To
do the actual forwarding, the second command is used:

- --table nat : Network address translation table.
- -A POSTROUTING for altering packets as they are about to go out, after it is 
determined that
they are to be forwarded by means of the first instruction.
- -j MASQUERADE Masquerade the addresses of computer in the subnet with the 
address of the routing
computer.

The kernel takes care of the subtle details on masquerading.

I hope this helps!!!

- --
Fabio A. Correa D.

Physics Dept, Universidad Nacional, Bogota, Colombia
[EMAIL PROTECTED]
[EMAIL PROTECTED]         [EMAIL PROTECTED]
My webpage and OpenPGP key at http://facorread.150m.com
[EMAIL PROTECTED] is not working anymore!!!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGRyjPYOZCB4zf2uQRAp2eAJwIYrXAQqldgZjRN0u+uDOW8t/aTgCeOQOb
RTmVGHOHQQWUzVxkZomHhHo=
=xvIZ
-----END PGP SIGNATURE-----
--
[EMAIL PROTECTED] mailing list


Thank you for your details!!!

--
wcw
--
[EMAIL PROTECTED] mailing list

Reply via email to