View previous topic :: View next topic |
Author |
Message |
Net_Spy Apprentice
Joined: 29 Dec 2004 Posts: 170
|
Posted: Sun Jul 13, 2008 9:24 pm Post subject: Ipforwarding/masqurading |
|
|
Greetings to All,
I want to developt a small nework for my two laptops. here is my config for wan eth0:10.x.x.x and for lan eth1:192.1680.1 and I stoped the iptables rule. and run this customiz script to get internet access on my laptops having static ip address 192.168.1.2 and 192.168.1.3. Ping going fine between laptop and pc having 192.168.0.1
here is the scripts blow
Code: |
#! /bin/sh
#
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
|
I dont know what is wrong looking forward for your kind response.
Regards
Net_Spy |
|
Back to top |
|
|
Akhouk Guru
Joined: 23 May 2003 Posts: 476 Location: The Two Niles, Africa
|
Posted: Mon Jul 14, 2008 7:48 am Post subject: |
|
|
Do you have the default policy as DROP?
You have added a rule to accept the outbound traffic coming from you local LAN which is good but you also need to allow the return packets. Iptables uses the ESTABLISHED and RELATED keywords for this using the state engine. Something like...
Code: |
iptables --append FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
|
_________________ AMD 64 3500+, 2Gb RAM DDR400, 2 x 180Gb SATA, 256Mb Nvidia |
|
Back to top |
|
|
Net_Spy Apprentice
Joined: 29 Dec 2004 Posts: 170
|
Posted: Mon Jul 14, 2008 7:50 pm Post subject: |
|
|
here is the out put
Code: |
iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
|
but still no use ,when i run nslookup from client it is timed out.
Regards
Net_Spy[/code] |
|
Back to top |
|
|
Net_Spy Apprentice
Joined: 29 Dec 2004 Posts: 170
|
Posted: Mon Jul 14, 2008 8:01 pm Post subject: |
|
|
Thanks it works
but the problem is that im using static ip address i use 192.168.1.1 in dns and it deos not work so i put wan dns on my client end and it works . does any one know why my 192.168.1.1 ip deosnt works on dns??
Regards
Net_Spy |
|
Back to top |
|
|
|