Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ramees041 opened this issue Sep 7, 2020 · 7 comments
Open
Labels

Comments

@ramees041
Copy link

ramees041 commented Sep 7, 2020

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

@ramees041 ramees041 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 Sep 7, 2020
@ramees041 ramees041 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 Sep 9, 2020
@therealkenc
Copy link

therealkenc commented Sep 10, 2020

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

@ramees041
Copy link
Author

ramees041 commented Sep 14, 2020

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?

@therealkenc
Copy link

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.

@ramees041
Copy link
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?

@therealkenc
Copy link

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.

@ramees041
Copy link
Author

ramees041 commented Sep 23, 2020

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.

@ramees041 ramees041 reopened this Sep 23, 2020
@therealkenc
Copy link

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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants