SLiRP: Support for changing the network.#6783
Merged
Merged
Conversation
Since the default 10.0.2.0/24 (or 10.0.3.0... etc) address can conflict with a LAN (as it does in my case), this feature now adds the ability to set custom network prefixes in the configuration file. I believe this is an “advanced” usage feature (like port forwarding) and should not be exposed in the GUI, therefore no GUI changes have been made. In the `[Network]` section of 86box.cfg, each of the four NICs can be set to have a custom address like such: ``` net_01_addr = 10.80.88.0 net_02_addr = 10.82.86.0 net_03_addr = 10.84.86.0 net_04_addr = 10.85.86.0 ``` The last octet of the address is effectively ignored and always set to 0 again when the configuration file is saved. Only a /24 CIDR (netmask 255.255.255.0) is supported. IPv4 has three local-scope ranges: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0. Finding a network prefix within these that do not conflict with your real LAN should not pose a problem.
Still untested on the OS, but Grok pointed me to the alternative function to use. Hope it works.
This exists on all platforms, no messy #ifdef needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the default 10.0.2.0/24 (or 10.0.3.0... etc) address can conflict with a LAN (as it does in my case), this feature now adds the ability to set custom network prefixes in the configuration file. I believe this is an “advanced” usage feature (like port forwarding) and should not be exposed in the GUI, therefore no GUI changes have been made.
In the
[Network]section of 86box.cfg, each of the four NICs can be set to have a custom address like such:The last octet of the address is effectively ignored and always set to 0 again when the configuration file is saved. Only a /24 CIDR (netmask 255.255.255.0) is supported. IPv4 has three local-scope ranges: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0. Finding a network prefix within these that do not conflict with your real LAN should not pose a problem.
This change has only been tested on Linux. Code review is greatly appreciated, too.
Summary
The feature working with a TinyCore VM with all four NICs set to the above setting:

Checklist
References
Provide links to datasheets or other documentation that helped you implement this pull request.