Skip to content

How to make "ether" value from "bond0" field static across WSL sessions  #5866

Open

Description

@ramees041

Is your feature request related to a problem? Please describe.
I have an application which access the "ether" value from "bond0" field as input parameters to generate a license (Note:- Without this license application cant be opened).
This ether value is found to be dynamic across WSL restarts.
So, on every WSL restart, I will have to generate another new license to continue using it.

Describe the solution you'd like
I want "ether" value under "bond0" to be static across across WSL sessions.

Describe alternatives you've considered

Additional context

Activity

  1. changed the title [-]Require ether value of bond0 field to be Static for licensing purpose[/-] [+]Require ether value of bond0 field to be Static across sessions for licensing purpose[/+] on Sep 7, 2020
  2. changed the title [-]Require ether value of bond0 field to be Static across sessions for licensing purpose[/-] [+]How to make "ether" value from "bond0" field static across WSL sessions [/+] on Sep 9, 2020
  3. therealkenc commented on Sep 10, 2020

    @therealkenc

    This isn't materially very different from #5291 (with a side of #5352).

    It does seem like changing the MAC of bond0 has no ill effects, on first glance anyway:

    image

  4. ramees041 commented on Sep 14, 2020

    @ramees041
    Author

    This isn't materially very different from #5291 (with a side of #5352).

    It does seem like changing the MAC of bond0 has ill effects, on first glance anyway:

    image

    Is there a way automate it rather than typing it manually on every restart?

  5. therealkenc commented on Sep 14, 2020

    @therealkenc

    In .bashrc add a test to see if the MAC has been set to the value you want, and if not, set it. Add /usr/bin/ip to /etc/sudoers.

  6. ramees041 commented on Sep 15, 2020

    @ramees041
    Author

    This isn't materially very different from #5291 (with a side of #5352).

    It does seem like changing the MAC of bond0 has no ill effects, on first glance anyway:

    image

    Will it affect accessing GUI apps, internet browsing or any other service?
    Also I would like to know, if at all it affects anything, are there any irreversible affects?

  7. therealkenc commented on Sep 15, 2020

    @therealkenc

    Will it affect accessing GUI apps, internet browsing or any other service?

    It does not seem to, on the first and only first glance I did, anyway. Can't tell you it won't with any specificity. It appears to be state DOWN so there is no obvious reason why it should. Any ill effects it did have, should they arise, would be reversible.

  8. ramees041 commented on Sep 23, 2020

    @ramees041
    Author

    In .bashrc add a test to see if the MAC has been set to the value you want, and if not, set it. Add /usr/bin/ip to /etc/sudoers.

    Could you please elaborate more on how can I add /usr/bin/ip to /etc/sudoers?I am afraid I might do it wrong.

  9. therealkenc commented on Sep 23, 2020

    @therealkenc

    Sure. Something like this at the end of your /etc/sudoers. You can edit with sudo /etc/sudoers.

    yourusername ALL=(ALL) NOPASSWD: /usr/bin/ip
    

    In your .bashrc you can test and set with something like:

    wantmac=00:15:5d:7d:e1:2b
    mac=$(ip link show bond0 | awk '/ether/ {print $2}')
    if [[ $mac !=  $wantmac ]]; then
        sudo ip link set dev bond0 address $wantmac
    fi
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions