Setup with IPv6 and IPv4 addresses in dual stack - Subnetting

  • I'd like to setup my system with IPv4 and IPv6 addresses for every Domain hosted. I played a bit around with single IPv4, single IPv6 and dual stack via listener.


    I plan the following setup:
    Every domain should get its own IPv6 address and all domains the same IPv4 (via apache2 listener).


    Do I need to add every single IPv6 address manually (or via script to the DB) or is there a possibility to do this via the net mask?
    Do I need to use the Bind9 listener, too?

  • Every domain should get its own IPv6 address and all domains the same IPv4 (via apache2 listener).

    There is two listeners for dualstack:


    For Apache2: https://github.com/i-MSCP/imsc…2/10_apache2_dualstack.pl
    For Bind9: https://github.com/i-MSCP/imsc…med/20_named_dualstack.pl


    Unfortunately, those listener files are not able to pull data from a datastore, nor pull IP addresses from a subnet.


    Right now, you must add each IPv6 manually. I could add support for pulling IPv6 addresses from a subnet easily, using the Net::IP module. See http://search.cpan.org/dist/Net-IP/IP.pm#ip_prefix_to_range and http://search.cpan.org/~manu/Net-IP-1.26/IP.pm#looping . However, we need figure out how to re-assign the same IP on each run (on full reconfiguration/update), even if a domain has been added or deleted (This is the hard part of such a feature)


    Do I need to use the Bind9 listener, too?

    Of course ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @Starlight


    Following your idea, I think that we could improve i-MSCP as follow


    (IP management (review) + dualstack support)


    Administrator side

    • Administrator should be able to register many subnets or many IP addresses
    • Administrator should be able to create new subnets (virtual subnets)* using registered subnets (divided subnets)
    • Administrator should be able to assign many subnets to resellers or many IP addresses

    Reseller side

    • Reseller should be able to assign many subnets or many IP addresses to customers

    Customer side

    • Customer should be able to choose the IP addresses (one IPv4 and optionally one IPv6 (if available)) to use for a given domain or subdomain

    * I say virtual subnets here because the new subnets would be only informational. The server would be aware of the full subnet.


    For instance, let say that the administrator registers the 192.168.1.0/27 subnet. That subnet could be divided into two virtual subnets:


    • First virtual subnet: 192.168.1.0/28 (Total IP available for end user 14)
    • Second virtual subnet: 192.168.1.16/28 (Total IP available for end user 14)

    See also: http://www.davidc.net/sites/default/subnets/subnets.html

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Your second proposal sounds good. Especially, the the easy way for customers to add IPv4 and / or IPv6 addresses to their domains / sub domains as resellers via virtual IP ranges.


    Current status - How to


    Currently, I added 1000 IPv6 Addresses via a mysql procedure:

    SQL
    1. DELIMITER $$
    2. CREATE PROCEDURE addips(p1 INT, p2 INT)
    3. BEGIN
    4. SET @x = p1;
    5. REPEAT
    6. INSERT INTO `server_ips` (`ip_id`, `ip_number`, `ip_netmask`, `ip_card`, `ip_config_mode`, `ip_status`) VALUES (NULL, CONCAT('2001:dead:beef:3::', HEX(@x)), '124', 'eth0', 'auto', 'toadd');
    7. SET @x = @x + 1;
    8. UNTIL @x > p2 END REPEAT;
    9. END$$
    10. DELIMITER ;

    I assigned the resellers a bunch of IPv6 addresses via the front end.
    Added IPv6 addresses for every Domain, Subdomain and Alias Domain via database.


    Then I downloaded and configured the listeners for apache2 and bind9 (added one IPv4 address for all Domains).


    Last, I re-run the i-mscp setup.


    works