1 |
Hi,guys! |
2 |
I use iptables to let the PCs in the subnet to connect the internet outside. |
3 |
|
4 |
And i write a simple script,but it doesn't work: |
5 |
|
6 |
#!/bin/sh |
7 |
iptables -F |
8 |
#Define packets from Internet server to Intranet |
9 |
iptables -A FORWARD -d 198.168.1.0/24 -i eth0 -j ACCEPT |
10 |
#Define packets from Intranet to Internet |
11 |
iptables -A FORWARD -s 198.168.1.0/24 -i eth1 -j ACCEPT |
12 |
|
13 |
|
14 |
Here is the result of iptables -L: |
15 |
|
16 |
# iptables -L |
17 |
Chain INPUT (policy ACCEPT) |
18 |
target prot opt source destination |
19 |
|
20 |
Chain FORWARD (policy DROP) |
21 |
target prot opt source destination |
22 |
ACCEPT all -- anywhere 198.168.1.0/24 |
23 |
ACCEPT all -- 198.168.1.0/24 anywhere |
24 |
|
25 |
Chain OUTPUT (policy ACCEPT) |
26 |
target prot opt source destination |
27 |
|
28 |
|
29 |
The eth0 here has the real ip,and the eth1 have a subnet ip:192.168.1.21. |
30 |
How to fix this problem?All I need now is just to let my office |
31 |
machine to use the internet! |
32 |
Thanks in advanced!! |
33 |
-- |
34 |
wcw |
35 |
-- |
36 |
gentoo-user@g.o mailing list |