help to gain net access for clients on linux server

Taking care of your Linux box.

help to gain net access for clients on linux server

Postby imtiazahmad_khan » Sat May 31, 2003 4:19 pm

asalamo alaikum
dear all members,
i have a problem on my linux server. (7.2 red hat)

i have apply a command for giving access for each pc connected to my network

iptables -A INPUT -s 192.168.x.x -j ACCEPT (FOR GIVING NET ACCESS)
iptables -A INPUT -s 192.168.x.x -j DROP (FOR RISTECTING NET ACCESS)

now when i have run my second command , no a single client (192.168.x.x) conected with my server can access net but when i give 1st command it will also do nothing and no that client can use net.

so tell me now how can i enable net for that specific client.

thankx in advance.

Imtiaz
Imtiaz
imtiazahmad_khan
Cadet
 
Posts: 6
Joined: Fri May 30, 2003 11:27 pm
WLM: linux_pakistan@hotmail.com

Postby zaeemarshad » Wed Jun 25, 2003 2:06 pm

Dear Imtiaz,
firstly what is the gateway machine. is it windows or linux. if windows just enable internet connection sharing and gave its ip as the gateway ip to all clients. if it is a linux machine then

echo "1">/proc/sys/net/ipv4/ip_forward
put it in your rc.local. then for the gateway give

iptables -A input -s 192.168.x.x -j ACCEPT

also u may have to configure NAT at the linux machine. use the post routing chain. May be others can help better.

Regards
Zaeem
zaeemarshad
Lieutenant Colonel
 
Posts: 660
Joined: Sat Jul 06, 2002 12:35 pm
Website: http://zaeem.no-ip.org
WLM: zarshadvirk@hotmail.com
Yahoo Messenger: negativecreep61@yahoo.com
AOL: zarshadvirk
Location: Islamabad

Postby gh4z4nf4r » Wed Jun 25, 2003 7:28 pm

salam,

To make your linux machine a gateway do following.

#this will flush any entries
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain

#now this will masquerade and enable forwarding
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT

echo 1 > /proc/sys/net/ipv4/ip_forward

#you can put all of above in rc.local
after this i hope that your clients can access the net..
i used above when my server was a linux and was connected to outside with eth0 and local net was on eth1.one problem i faced was clients could ping everywhere on net but was unable to browse.so in clients browser i set the proxy to use of the same as the one my linux server was using(203.135.0.66 paknet's).if same happens to you try to set the proxy settings of your clients to one your server is using.
gh4z4nf4r
Naik
 
Posts: 65
Joined: Mon Oct 14, 2002 3:51 pm
WLM: gh4z4nf4r@hotmail.com
Yahoo Messenger: gh4z4nf4r@yahoo.com
Location: Wah Cantt

Postby imtiazahmad_khan » Thu Jun 26, 2003 6:53 pm

Dear Lance Naik
Wao,
Thank u very much for solving my problem.
Thankx a lot.
Imtiaz
imtiazahmad_khan
Cadet
 
Posts: 6
Joined: Fri May 30, 2003 11:27 pm
WLM: linux_pakistan@hotmail.com


Return to “%s” Administration

Who is online

Users browsing this forum: No registered users and 2 guests

cron