Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Support wildcard matching on MAC addresses #2707

Closed
niusmallnan opened this issue Mar 12, 2019 · 3 comments
Closed

Support wildcard matching on MAC addresses #2707

niusmallnan opened this issue Mar 12, 2019 · 3 comments

Comments

@niusmallnan
Copy link
Contributor

From @mmriis :

It would be a nice feature to be able to wildcard match on mac adresses for interfaces. This is eg. useful for bonding where you would like all nics of a certain make or model to be added to the bond.

Using this feature you could do the following:

#cloud-config
rancher:
  network:
    interfaces:
      bond0:
        dhcp: true
        bond_opts:
          mode: 802.3ad
          lacp_rate: fast
          miimon: 100
        post_up:
          - ip route add 0.0.0.0/0 via 1.2.3.4
      # Add all Mellanox adapters to bond
      "mac=98:03:9b*":
        bond: bond0
@niusmallnan
Copy link
Contributor Author

@kingsd041 Can you add automated tests for this feature? Please add to your to-do list. 😄

@kingsd041
Copy link
Contributor

@mmriis has added a go test for this, so there is no need to add it to the automated test.

@rootwuj
Copy link

rootwuj commented May 24, 2019

Tested with rancher/os:v1.5.2-rc1 from May 24 with VirtualBox

Test:

  • Create VM and set up multiple NICs
  • Execute ros install -d /dev/sda -c cloud-config.yml
$ vi cloud-config.yml
#cloud-config
rancher:
  network:
    interfaces:
      bond0:
        dhcp: true
        bond_opts:
          downdelay: "200"
          lacp_rate: "1"
          miimon: "100"
          mode: "2"
          updelay: "200"
          xmit_hash_policy: layer3+4
      mac=08:00:27*:
        bond: bond0
        dhcp: false

Result:

  • All NICs are added to bond0.
  • All NICs have the same mac address and are in the UP state.
  • Can connect to VM via ssh.

Verified fixed.

@rootwuj rootwuj closed this as completed May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants