This is a pretty easy fix, however it does require that you uninstall NetworkManager and reinstall it by compiling from source code (with your edits). There are two files that define this.
Code:
[root@vh1 NetworkManager-0.8.1]# grep "10.42.43" src/*
src/nm-device.c: guint32 start = (guint32) ntohl (0x0a2a2b01); /* 10.42.43.1 */
This is the source code that defines the 10.42.43.1 IP address for the shared device, assigning this IP address to the shared device as the default gateway. This definition is not in base10 or base2, but base16 as noted by:
Code:
ntohl (0x0a2a2b01); /* 10.42.43.1 */
You change the code 0a2a2b01 to whatever you wish to change the default gateway's IP address. For easy conversions, use
http://www.kloth.net/services/iplocate.php and convert a "Dotted quad" into "Hex". Should be cakewalk. Make backups of the file first then make sure to save the changes.
A different file defines the actual address space used by DHCP:
Code:
[root@vh1 NetworkManager-0.8.1]# grep -r "dhcp-range" ./
./src/dnsmasq-manager/nm-dnsmasq-manager.c: s = g_string_new ("--dhcp-range=");
Here is the excerpt from the file:
Code:
s = g_string_new ("--dhcp-range=");
/* Add start of address range */
addr.s_addr = nm_ip4_address_get_address (tmp) + htonl (9);
if (!inet_ntop (AF_INET, &addr, &buf[0], INET_ADDRSTRLEN)) {
nm_log_warn (LOGD_SHARING, "error converting IP4 address 0x%X",
ntohl (addr.s_addr));
goto error;
}
g_string_append (s, buf);
g_string_append_c (s, ',');
/* Add end of address range */
addr.s_addr = nm_ip4_address_get_address (tmp) + htonl (99);
if (!inet_ntop (AF_INET, &addr, &buf[0], INET_ADDRSTRLEN)) {
nm_log_warn (LOGD_SHARING, "error converting IP4 address 0x%X",
ntohl (addr.s_addr));
goto error;
}
g_string_append (s, buf);
There are only two lines that need to be changed here:
Code:
/* Add start of address range */
addr.s_addr = nm_ip4_address_get_address (tmp) + htonl (9);
and
Code:
/* Add end of address range */
addr.s_addr = nm_ip4_address_get_address (tmp) + htonl (99);
This code produces an IP address range of 10-100. I know what you're thinking, 9 and 99? Remember that .1 is already taken. So in essence if you want an IP address range of 200 - 254, insert 199 and 253 into the start and end lines respectively. Take the starting IP address and subtract 1, then take the ending IP address and subtract 1.
PLEASE NOTE:
These files are from the NetworkManager source code available from a .src.rpm for EL6 (CentOS). However I am quite sure that all of the file sources are pretty much the same (depending on the version of NetworkManager being used). I hope this helps.
Bookmarks