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 - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-09-2007, 12:46 PM   #1
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Rep: Reputation: 30
Securing a network by only allowing traffic from certain ip addy's or maybe mac addy


Hey all,

I am trying to secure my home network and I have been wondering something. Say I want to set up something where I only allow the ip addresses I set up to access anything. IE: Gateway/firewall is 192.168.1.2, My PC is 192.168.1.200 and I want to be able to access the network and do everything a normal person would, now some person comes over to my house, plugs his laptop into my network and gives himself an ip address of 192.168.1.240 and I don't want him to be able to access anything at all on the network. How could I go about making this happen?

If there is a way to only allow certain ip addresses or even mac addresses to connect through the gateway, this would be great.

As always, any help would be greatly appreciated and I welcome all comments or suggestions.

Thanks
 
Old 08-09-2007, 01:11 PM   #2
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
You can definitely limit the network users by MAC address. Look at your router settings. The default is to allow everyone. Change that to "Limit access to these MAC addresses" or something similar to this.
 
Old 08-09-2007, 01:38 PM   #3
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Original Poster
Rep: Reputation: 30
I don't have a router, I just have a Slackware box with 2 nics attached to a hub on one end and attached to my modem on the other. If I would have known a router could do that I would have gotten one. Well I am trying to learn Slackware better then I already do so this can help me learn something new.

Thanks
 
Old 08-09-2007, 07:36 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
You can use iptables to specify that you only want your IP and MAC to get routed. Keep in mind that MACs are easily spoofed, so if you want something truly secure, you need to setup some type of authentication. Either that, or limit access to the ethernet ports which these people that come to your house currently have access to.
Code:
iptables -I FORWARD -i $LAN_IFACE -s ! 192.168.1.200 \
-m mac --mac-source ! xx:xx:xx:xx:xx:xx -j DROP
The above example would make it so any outgoing packets which don't have a source IP of 192.168.1.200 and a source MAC of xx:xx:xx:xx:xx:xx would get filtered. Replace $LAN_IFACE with the actual name of your LAN interface, and xx:xx:xx:xx:xx:xx with the actual MAC of your PC's NIC.

Last edited by win32sux; 08-09-2007 at 07:38 PM.
 
Old 08-14-2007, 08:27 AM   #5
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Original Poster
Rep: Reputation: 30
Hey there,

Sorry for such the delay for my reply but I have been busy. Thats the kind of information I was looking for. Allowing only a certain ip with a certain mac address is also a great idea. If I was able to set up some type of authentication to get an ip address, that would be even better.

I have found bits of info and am working on currently implementing it and shall post here how it went.

Thanks
 
Old 08-15-2007, 01:42 PM   #6
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Original Poster
Rep: Reputation: 30
Well I have been looked into this for a day or so now and I am wondering if the same type of filtering is possible with ipchains.

Thanks
 
Old 08-15-2007, 01:57 PM   #7
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by cereal83 View Post
Well I have been looked into this for a day or so now and I am wondering if the same type of filtering is possible with ipchains.
Not sure, when I started using GNU/Linux several years ago ipchains was already obsolete, so I've never really used it.
 
  


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
allowing traffic in some ports igordonin Linux - Networking 10 12-11-2006 08:46 AM
understand Mac Addy geeyathink Linux - Hardware 3 07-07-2006 11:39 PM
Incorrect destination addy on subnet traffic af_dave Linux - Security 5 08-29-2004 02:43 AM
Securing network by manually mapping mac to ip cmisip Linux - Security 3 11-04-2003 10:26 AM
allowing IP traffic on firewall - unsafe? complus Linux - Security 4 09-04-2003 03:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:49 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