Auto-Generate MAC Address on new interface.

Discussion in 'Proxmox VE: Networking and Firewall' started by Jim Surles, Nov 2, 2018.

Tags:
  1. Jim Surles

    Jim Surles New Member
    Proxmox VE Subscriber

    Joined:
    May 29, 2018
    Messages:
    3
    Likes Received:
    0
    Hello.

    I am trying to determine a way to add a new network interface from the command line. After looking around, I found that I can add one using qm set:

    qm set 600 -net2 virtio=00:00:00:00:00:00,bridge=vmbr4,tag=104

    But the challenge I'm experiencing, is that if I leave the MAC address out, it fails because "net2.macaddr: value does not match the regex pattern". I know when creating via the GUI, it autogenerates a random one.

    Is there a way to have it autogenerate a random MAC while using qm set?
     
  2. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    16,245
    Likes Received:
    276
    qm set 600 -net2 virtio,bridge=vmbr4,tag=104
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Jim Surles likes this.
  3. Jim Surles

    Jim Surles New Member
    Proxmox VE Subscriber

    Joined:
    May 29, 2018
    Messages:
    3
    Likes Received:
    0
    Perfect! I had just left the virtio part out when trying to make it create, I didn't think of specifying but not giving value.

    Thanks!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice