LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-28-2005, 09:00 PM   #1
b:z
Member
 
Registered: Mar 2005
Posts: 146

Rep: Reputation: 15
Sharing Internet : Please help me


My network diagram :

+++Internet+++--------------+++Modem+++---------++eth0||||eth1++----------+Lan+--

My server has have roles: Linux gateway, DHCP, Squid proxy, DNS.
This is the rc.firewall script:

==============================================
#
# eth0: Localnet
# eth1: Internet
#
# Enable ip masquerading in the kernel
echo > 1 /proc/sys/net/ipv4/ip_forward
#
# Run iptables depend your locations
IPTABLES=/sbin/iptables
#
# prepare module necessary for iptables
/sbin/modprobe ip_tables
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_mangle
/sbin/modprobe iptable_nat
/sbin/modprobe ipt_LOG
/sbin/modprobe ipt_limit
/sbin/modprobe ipt_state
#
# no need at that time
#
#/sbin/mod_probe ipt_owner
#/sbin/mod_probe ipt_REJECT
#/sbin/mod_probe ipt_MASQUERADE
#/sbin/mod-probe ip_contrack-irc
#/sbin/mod_probe ip_nat_ftp
#/sbin/mod_probe ip_nat_irc
#
# Flush all rule in iptables
iptables -F
iptables --delete-chain
iptables -t nat --delete-chain
iptables -t nat --flush
#
iptables -A FORWARD -s 192.168.0.0/16 -j ACCEPT
#
iptables -A FORWARD -d 192.168.0.0/16 -j ACCEPT
#
iptables -t nat -A POSTROUTING -d ! 192.168.0.0/16 -j MASQUERADE
#
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

=========================================================

with the script above, my firewall will allow all trafic in local network. With traffic wants go outside Internet, they will reach SQUID proxy (policy internet applied here). However i get the problems:
- When the rc.firewall script is applied, nothing will work: Client can't access Internet, can't ping linux gateway (DHCP server), however client can ping together (client is assigned IP from DHCP server) .
- In case, i flush all rule in my iptables, exclude the "
=====
iptables -t nat -A POSTROUTING -d ! 192.168.0.0/16 -j MASQUERADE
#
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
======
It still isn't work.

I only want my client can access Internet to check mail POP3, web surfing. All will be drop. And full permission in local network.

Please help me solve the problem.
 
Old 03-29-2005, 01:12 AM   #2
korozion
Member
 
Registered: Apr 2004
Location: Canada
Distribution: Debian
Posts: 124

Rep: Reputation: 15
In cases like that I use QuickTables avail. from qtables.radom.org It's easy and will generate a well documented rc.firewall for you. You can edit it from there if you need. It supports Squid as well. It also has a feature to allow you to temp. or perm. block sites, without any pain at all
 
Old 03-29-2005, 01:42 AM   #3
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
May also want to check on the route command. Somebody told me how to do that once. It was a while ago and I can't recall the exact thing but it was route ******.

Sorry I am no more help than that.

Later

 
Old 03-30-2005, 01:28 AM   #4
b:z
Member
 
Registered: Mar 2005
Posts: 146

Original Poster
Rep: Reputation: 15
noone anwser my question
Please help me.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mandrake 10.1 sharing files and internet sharing xfiles_arram Linux - Networking 0 05-21-2005 02:22 PM
internet sharing LinuxRam Linux - Networking 8 09-09-2004 08:52 AM
internet sharing trace1918 Linux - Networking 3 11-18-2003 02:04 PM
File sharing and internet sharing mullet Linux - Networking 1 10-14-2003 01:30 PM
Internet sharing from OS X to RH 7.3 ZeratulsAvenger Linux - Networking 3 07-22-2003 08:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration