You are not logged in.

#1 2011-07-24 11:00:54

Butcher
Member
Registered: 2009-02-04
Posts: 158

Change MAC for a virtual IP address

I'm able to connect to the same network using several IP addresses using, for example:

ip addr add 192.168.1.88/24 dev wlan0 label wlan0:1

My question is, how do I change that connection's MAC address? I tried with macchanger and it says:

Current MAC: c2:c9:dd:ba:0c:1a (unknown)
ERROR: Can't change MAC: interface up or not permission: Device or resource busy

I know it's possible as VirtualBox does it when setting an interface on "Bridge" mode.

Cheers.

Offline

#2 2011-07-24 11:06:08

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Change MAC for a virtual IP address

Not sure, if this is what you want, but have a look at https://bbs.archlinux.org/viewtopic.php?pid=959531 and https://bbs.archlinux.org/viewtopic.php … 23#p885823

Last edited by karol (2011-07-24 11:09:35)

Offline

#3 2011-07-24 11:19:02

Butcher
Member
Registered: 2009-02-04
Posts: 158

Re: Change MAC for a virtual IP address

Thank you very much, but that's not working, I receive exactly the same error:

# ifconfig wlan0:1 hw ether 13:34:34:34:34:34
SIOCSIFHWADDR: Device or resource busy

Offline

#4 2011-07-24 23:39:10

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Change MAC for a virtual IP address

You can't. You're assigning multiple Layer 3 addresses (IP Addresses) to the same Layer 2 device. MAC Addresses are part of Layer 2 and each NIC can only have 1.

You could try creating another (virtual) NIC using the bonding module and tag it as VLAN 1 (the default VLAN) so you would have wlan0 and wlan0.0 (note the dot instead of the colon).... You could then change the MAC on 1 of the NIC's since you're "aliasing" the NIC, rather than aliasing the address(es). I don't know it that would work though, I have never done it and depends how your other network equipment would handle having frames with 802.1q tags in the headers.

Offline

#5 2011-07-25 11:31:36

Butcher
Member
Registered: 2009-02-04
Posts: 158

Re: Change MAC for a virtual IP address

Thanks for your response, but I have two questions.

1) Do you know how VirtualBox does it?
2) How do I do what you say?

Offline

#6 2011-07-25 23:59:19

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Change MAC for a virtual IP address

Butcher wrote:

1) Do you know how VirtualBox does it?

I assume you're talking about the Bridged option that VBox supports. Bridging is "joining" multiple NIC's together. Internally there are multiple (virtual) NIC's that are "joined" to your physical NIC.
It is the same as kernel NIC bridging, but VBox has just done their own implementation specifically for themselves.
This wiki article describes bridging for QEMU; it's the same concept but VBox is internally: https://wiki.archlinux.org/index.php/QE … _with_QEMU

Butcher wrote:

2) How do I do what you say?

https://wiki.archlinux.org/index.php/VLAN_101

Offline

Board footer

Powered by FluxBB