Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-03-2005, 06:50 PM   #1
LQ Newbie
Registered: Dec 2004
Distribution: Slackware 10
Posts: 16

Rep: Reputation: 0
Angry Problem spoofing mac address

I'm trying to register my router's mac address with the campus network so that I don't have to use it in bridge mode... and so I'm trying to spoof the mac address of the router
Problem is that after I bring the netcard down 'ifconfig eth0 down' , then try and bring it back up 'ifconfig eth0 up' it won't connect to the internet 'lynx' won't find anything until I reboot the system -and then the original mac address loads and I'm back at square 1 - even when I don't change the mac address I can't bring the card down then back up successfully without restarting am I missing a command? I'm very new to linux and running slack 10.0

Thanks for any help
Old 02-05-2005, 09:27 PM   #2
Registered: Jul 2003
Distribution: Slackware
Posts: 392

Rep: Reputation: 55
The sequence for changing the ethernet device's apparent MAC address is:

ifconfig eth0 down
ifconfig eth0 hw ether 00:11:22:33:44:55
ifconfig eth0 111.222.333.444 broadcast 555.666.777.888 netmask 999.000.111.222

Make sure to change the MAC and network numbers accordingly.

If eth0 is configured by DHCP, you'd replace the last line in the above triplet of commands with:

dhcpcd -t 10 -d eth0

One way to make this persist across reboots is to add:

if [ "$1" = 0 ]
ifconfig eth0 hw ether 00:11:22:33:44:55

at line 72 in /etc/rc.d/rc.inet1, just before the line reading:
if [ "${USE_DHCP[$1]}" = "yes" ]; then # use DHCP to bring interface up

Make a backup copy of /etc/rc.d/rc.inet1 before you start in case it gets screwed up.

This isn't the prettiest way to do it, but it should work. The proper way is to make it so /etc/rc.d/rc.inet1 picks up the desired apparent MAC address from /etc/rc.d/rc.inet1.conf, but that's a bit more work.

I haven't really tested any of this, but it should get you going.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Basic IP and MAC spoofing Iptable rules? stjoan1 Linux - Security 3 11-13-2005 06:17 PM
MAC Address spoofing on alias/secondary interface tara Linux - Networking 3 08-31-2005 10:22 PM
MAC Destination Spoofing outspoken Linux - Networking 4 04-06-2005 11:47 AM
detect mac address spoofing bensky Linux - Security 1 03-13-2005 01:23 AM
Need help spoofing MAC address, ifconfig down seems to remove wireless card sicc Linux - Wireless Networking 0 11-30-2004 03:42 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:14 AM.

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