Switching wlan hotspot to custom IP address range
-
These are the steps I did to use 192.168.7.0/24 instead of the default 10.42.0.0/16 address range.
IMPORTANT NOTES:
-
The IP range is hardcoded in network-manager-1.2.x branch, which is used in UBports 16.04 (xenial). Therefore one have to rebuild the package! A good tool is to perform the rebuild on an x86 or x86_64 PC under Ubuntu is sbuild. Setup an environment for xenial-armhf, login there, and perform a normal debuild for the package.
-
The latest version of network-manager in Xenial is network-manager-1.2.6. This is compatible with the original 1.2.2.
SETTING THE CUSTOM IP RANGE:
- Open the file src/devices/nm-device.c
Somewhere at the line 4834 (nm version 1.2.6) find the line like this:
guint32 start = (guint32) ntohl (0x0a2a0001); /* 10.42.0.1 */The hex value is just calculated from the gateway's dotted decimal IP address of the desired network.
See this:0a = 10 2a = 42 00 = 0 01 = 1Calculate your desired IP. Use 1, as the gateway, or read the code further how to adjust the netmask if you want another gw address. Mine is now 192.168.7.1:
192 = c0 168 = 80 7 = 07 1 = 01My modified line is like this now:
guint32 start = (guint32) ntohl (0xc0a80701); /* 192.168.7.1 */Now locate debian/rules file, and remove everything under override_dh_auto_test: line. Tests break in a chrooted environment. So it should look like this:
override_dh_auto_test:You can also modify the configure part to avoid building any tests. Change the line:
--with-tests \into:
--without-tests \Simple enough, ready!
Now rebuild your package. You will get several deb files after a successful build, but you need only network-manager-1.2.x.deb. Deploy it on the phone. Reboot, and enjoy the new hotspot network!
-
-
Does this also apply to RNDIS? I assume yes since hotspot and RNDIS share the same IP range at the moment.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login