Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Ipforwarding/masqurading
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Net_Spy
Apprentice
Apprentice


Joined: 29 Dec 2004
Posts: 170

PostPosted: Sun Jul 13, 2008 9:24 pm    Post subject: Ipforwarding/masqurading Reply with quote

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
View user's profile Send private message
Akhouk
Guru
Guru


Joined: 23 May 2003
Posts: 476
Location: The Two Niles, Africa

PostPosted: Mon Jul 14, 2008 7:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Net_Spy
Apprentice
Apprentice


Joined: 29 Dec 2004
Posts: 170

PostPosted: Mon Jul 14, 2008 7:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
Net_Spy
Apprentice
Apprentice


Joined: 29 Dec 2004
Posts: 170

PostPosted: Mon Jul 14, 2008 8:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum