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 05-17-2020, 03:03 PM   #1
islandBilly
LQ Newbie
 
Registered: Dec 2007
Location: Bahamas
Distribution: Mint 19.3 Tricia
Posts: 19

Rep: Reputation: 0
Need to spoof MAC of ethernet-connected wifi adapter


I got a directional wifi adapter at a little beach cottage in order to make a better connection to the router in the main house. Even though the handshake works well, I am not getting the router to give me an IP address, because I'm using MAC filtering for security. I can just barely make the connection without the directional adapter, but the signal is weak and keeps dropping.

So does anybody know how to send the ifconfig command or whatever would work to the ethernet connected device to change its MAC for the handshake?
 
Old 05-17-2020, 09:15 PM   #2
TheOuterLinux
LQ Newbie
 
Registered: Apr 2020
Location: ~/
Distribution: PsychOS
Posts: 10
Blog Entries: 14

Rep: Reputation: Disabled
Are you using a graphical desktop environment or the command-line? If you are using NetworkManager, you should be able to spoof MAC addresses by:

1. Right-clicking the nm-applet (icon in the panel)
2. Select "Edit Connections..."
3. Click the connection type you are using, such as "Ethernet connection 1," for example.
4. Select "Edit"
5. Under the "Ethernet" tab, where it says "Cloned MAC address," select "Random."
6. You may or may not need to edit or double-check what "Device" is listed just above the option.

You should now get a random MAC address each time you connect to the Internet.

If you are using the command-line, you can still do the same as listed above but would run 'nmtui' to get a dialog-based interface. Navigate using tab, arrows, and toggle items with Spacebar.

If you need much more advanced help than this, I really can't be much more help other than maybe you could also try installing 'macchanger' and do some sort of BASH scripting "Kung-Fu" with it.
 
Old 05-17-2020, 10:05 PM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Code:
ip link set dev INTERFACENAME address aa:bb:cc:01:02:03
More info: https://askubuntu.com/questions/1065...ing-ip-command.
 
Old 05-17-2020, 10:24 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,820

Rep: Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960
I am using MAC filtering for security implies you have access to the router's configuration so why not add the new adapter to the list?

With MAC filtering random setting will not work because the router is configured to only allow specific addresses. However, with the Network Manager applet you should be able to configure the new adapter with the same address as the built in adapter.

And MAC filtering does not really improve security.
 
1 members found this post helpful.
Old 05-18-2020, 03:17 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,023

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
I guess it might work if your router always assigns DHCP to a mac address. Different routers use different words. Otherwise you can still use static ip/subnet/gateway settings.

Yes, MAC filter does almost nothing. Making it hidden and filter may slow down the feeble.
 
Old 05-18-2020, 03:52 PM   #6
islandBilly
LQ Newbie
 
Registered: Dec 2007
Location: Bahamas
Distribution: Mint 19.3 Tricia
Posts: 19

Original Poster
Rep: Reputation: 0
Both the ip command and the more gui connection editing can only affect the actual ethernet port MAC, the one that connects my laptop to the adapter, not the mac of the device at the other end. I suspect that what I want can't be done, and I will just have to fix this at the router end. Thanks.
 
Old 05-18-2020, 04:33 PM   #7
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
There is no general tool that changes the configuration of a remote device. Usually, there are device specific tools; for example, many devices run a web server that has configuration options, or some routers run Linux-based software like DD-WRT or OpenWRT that include the ip command.
 
Old 05-18-2020, 05:58 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,820

Rep: Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960
Quote:
Originally Posted by islandBilly View Post
Both the ip command and the more gui connection editing can only affect the actual ethernet port MAC, the one that connects my laptop to the adapter, not the mac of the device at the other end. I suspect that what I want can't be done, and I will just have to fix this at the router end. Thanks.
If I understand the post correctly the new network adapter is connected to the router and not your laptop? If the router is a generic SOHO unit like a Netgear or Linksys then a USB adapter isn't going to work unless the router OS is specifically designed for an external device or like posted running a special linux version. Asus routers run linux but never have played with them but probably not.

MAC filtering is all about the address on the client not the other end.

More information about your hardware is required.

Last edited by michaelk; 05-18-2020 at 06:16 PM.
 
  


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
network manager shows connected to wifi but ifconfig show connected to ethernet mia_tech Linux - General 10 12-16-2015 10:23 AM
Want to share my wifi by creating a wifi hotspot ( While staying connected to wifi)? shadyXV Linux - Desktop 4 07-20-2015 05:37 PM
Built-in USB Ethernet adapter vs. (standard) Ethernet adapter bgs@pt Linux - Networking 1 01-06-2013 08:05 PM
How to spoof wifi NIC mac on WIND U100 Aleks` Linux - Laptop and Netbook 4 08-23-2009 08:48 AM

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

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