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 06-21-2003, 02:47 PM   #1
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Rep: Reputation: 15
Unhappy ip and MAC address


what i have to do, or where i have to put the mac addresses of the computers on my network, so they can't change their ip's?

i hope i make some sense.
 
Old 06-21-2003, 02:53 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
You can't but you could use DHCP to always allocate the same address to the same mac address. Personnaly though I would stick to fixed addresses.
 
Old 06-21-2003, 03:00 PM   #3
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Original Poster
Rep: Reputation: 15
i am using fixed addresses, but i want the router to check for the mac addresses of the users who want to go "out there". I don't want to let them change their ip addresses and get complains about conflicting ip's.
 
Old 06-21-2003, 03:04 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Out where? If you don't want them to change their IP addresses then don't give them root access to their systems.
 
Old 06-21-2003, 03:14 PM   #5
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Original Poster
Rep: Reputation: 15

so i'm not making any sense...

i try again:

i have a router and behind him some computers (with windoze). The router gives them "the grate outdoors" (read internet). There is some shaping, so some guys are trying to change their ip to catche a bigger bindwith. I want to force them to use the ip i give to them and i understend i can do this taking their mac address and stick it to their ip.

Maybe it's more clear now...
 
Old 06-21-2003, 03:18 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
The only way I know to do this is with DHCP but the user could still change back to a fixed ip address if they had the administrative rights on that computer.
 
Old 06-21-2003, 03:31 PM   #7
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Original Poster
Rep: Reputation: 15
thanks for all your help ross

but i have one more question:
in my campus we have fixed adresses (or i think we have: we must put the ip, mask, dns, gw... on the OS's we use). But when i change my network card i have to go to the admin and tell him the new mac so i can use the new network to access the internet. How do they do it?
 
Old 06-21-2003, 03:42 PM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I can't see how they could stop you getting network access. They could probably block your net access though using iptables and "--mac-source" it's not something I've used though.
 
Old 06-21-2003, 03:45 PM   #9
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Original Poster
Rep: Reputation: 15
thank you. I think this is what i was looking.

i'll go to man iptables
 
Old 06-21-2003, 04:25 PM   #10
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
my campus does the MAC-IP thing. That is done in DHCP. David, the way it works is, if you computer tries to pull an IP, it checks the database against your MAC (or the dhcp config file). If your MAC isnt found, you don't get an IP and hence, no network connection. Cristi you could set up your DHCP server to give IP's based on mac using the "host" option in the dhcpd.conf file. However, if a user hard codes his/her IP address to be the IP of someone else, it will still cause IP conflicts. If you want to block access to the internet from a certain user though, do what david_ross said and use the --mac-source option in iptables to filter their connection to the internet (great out doors).



an example of the host opition in DHCP looks like this:

host haagen {
hardware ethernet 08:00:2b:4c:59:23;
fixed-address 192.168.1.222;
}

what will happen:

when the computer with MAC: 08:00:2B:4C:59:23 requests an IP from the DHCP server, that computer will always get the 192.168.1.222 IP. This is why your campus always needs your MAC, if you MAC isnt in their config file, you get no IP.


i pulled that from the DHCP howto at:
http://www2.educ.umu.se/~bjorn/linux...mini/DHCP.html
 
Old 06-21-2003, 04:28 PM   #11
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Quote:
Originally posted by Robert0380
my campus does the MAC-IP thing. That is done in DHCP. David, the way it works is, if you computer tries to pull an IP, it checks the database against your MAC (or the dhcp config file). If your MAC isnt found, you don't get an IP and hence, no network connection.
I know how DHCP works. But like I said (and yourself)
Quote:
Originally posted by Robert0380
However, if a user hard codes his/her IP address to be the IP of someone else, it will still cause IP conflicts.
If the user has admin rights to the workstation then they can change it to a fised ip.
 
Old 06-21-2003, 04:31 PM   #12
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
yea, so we agreed on that point basically.

that rm -f / is funny everytime i read it BTW.
 
Old 06-21-2003, 04:33 PM   #13
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Quote:
Originally posted by Robert0380
yea, so we agreed on that point basically.
Yeah. Have you ever tried the iptables rules based on MAC before? It's not something I've ever had a need to do.
 
Old 06-21-2003, 04:36 PM   #14
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
never used it either. i just assumes it works because it's there.
 
Old 06-22-2003, 04:38 PM   #15
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Original Poster
Rep: Reputation: 15
i put on the gateway server:
iptables -I INPUT -s #IP -m mac --mac-source ! #mac -p all -j REJECT

but this is only stoping the access to the resources on the server (samba). The net still works.

Anybody knows what's wrong with what i did?
 
  


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
How to find an IP address from the MAC address of a remote machine ? jitz Linux - General 3 01-03-2006 07:55 AM
How to find IP address of a machine if I know their MAC Address dysenteryduke Linux - Networking 13 09-12-2005 10:21 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
How to know MAC address ( Machine address)?? vanhelsing Linux - Networking 3 08-12-2004 09:30 AM

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

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