LinuxQuestions.org
Visit Jeremy's Blog.
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 08-23-2003, 08:35 AM   #1
rookieter
LQ Newbie
 
Registered: Aug 2003
Posts: 8

Rep: Reputation: 0
about internet connection sharing


Can i share my internet coonection only for a specific ip address?

i have 4 comp + the server in home and i want to share only 1p add 192.168.0.2 and 4. is it possible to block the ip 192.168.0.3 and 5?

is there any monitoring sftware i can use to monitor who is connected to my ICS? and what they are doing? or can i disconnect them?

thanks a lot in advance!
 
Old 08-30-2003, 11:57 PM   #2
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
You can always add those IPs in the /etc/hosts.deny file.
 
Old 08-31-2003, 01:08 AM   #3
gundelgauk
Member
 
Registered: Jul 2003
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
Let's see...

I don't know how your iptables are configured to handle masquerading (internet connection sharing) at the moment but you could try something like this:

# Set default policy for FORWARD to DROP
iptables -P FORWARD DROP

# Masquerade traffic only from 192.168.0.2 and 192.168.0.4
iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.0.2/32 -j MASQUERADE
iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.0.4/32 -j MASQUERADE

# Drop traffic that isn't related to your established traffic
iptables -A INPUT -i ppp0 -m state --state NEW,INVALID -j DROP
iptables -A FORWARD -i ppp0 -m state --state NEW,INVALID -j DROP

That way you should be able to only let explicitly specified machines be able to access the internet.

This is assuming ppp0 is your external interface (inet). Note that the above is no complete iptables script, it won't work like this but you can use it as a starting point. If you need more information about what is happening up there, i suggest reading the manual pages for iptables. In any case I also suggest
this page, it got me started pretty well .

Good luck!
 
  


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
sharing my internet connection berrance Linux - Networking 1 02-25-2005 11:33 AM
SHaring internet connection bart59 Linux - Networking 1 01-27-2005 07:24 AM
Internet Connection Sharing geekbyday Linux - Networking 9 11-19-2004 10:59 PM
Internet connection sharing mark_booze Linux - Newbie 22 01-02-2004 12:37 AM
Internet Connection Sharing Chijtska Linux - Networking 7 09-02-2002 11:50 AM

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

All times are GMT -5. The time now is 02:31 PM.

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