File:  [NetBSD Developer Wiki] / wikisrc / tutorials / faking_a_mac_address.mdwn
Revision 1.4: download - view: text, annotated - select for diffs
Wed Sep 9 14:28:56 2020 UTC (4 months, 2 weeks ago) by kim
Branches: MAIN
CVS tags: HEAD
Use man template

Since 5.0 NetBSD supports changing the MAC address. 

Add a link-layer address to an Ethernet: 
    
    # ifconfig sip0 link 00:11:22:33:44:55
    

Add and activate a link-layer address: 
    
    # ifconfig sip0 link 00:11:22:33:44:55 active
    

  
This should give some idea: 
    
    
    ifconfig bridge0 create
    ifconfig bridge0 up
    ifconfig vr0 up
    brconfig bridge0 add vr0
    ifconfig tap0 create
    sysctl -w net.link.tap.tap0=00:00:de:ad:be:ef
    ifconfig tap0 up
    brconfig bridge0 add tap0
    

Now you can get an ip if from dhcp with the fake MAC: 
    
    dhclient tap0
    

##  See also 

  * [[!template id=man name="ifconfig" section="8"]]

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb