Plesk

How to add IPv6 address for all subscriptions that have specific IPv4 in Plesk?

Question

It's required to add IPv6 address to all subscriptions that use specific IPv4.

For example, for all subscriptions that use 203.0.113.2 IP it's required to add 2001:db8:f61:a1ff:0:0:0:80 address.  
How to perform this operation?

Answer

For Linux:

  1. Log into the server via SSH.
  2. In case of IPv6 was added to the server execute below command to add it to Plesk:

    # plesk bin ipmanage --reread

    In case of IPv6 was not added to the server execute below command. It will add IPv6 to the server and Plesk:

    # plesk bin ipmanage -c '2001:db8:f61:a1ff:0:0:0:80' -mask 64 -interface eth0 -type shared

  3. Make sure that the required IPv6 address is presented in reseller's IP pool in Plesk > Resellers > John Doe > More Tools (IP addresses) > Add ID Address.
  4. Find all domains that use specific IPv4, in example below it's 203.0.113.2:

    # plesk db -NBe 'select d.name,ip.ip_address from domains d left join dom_param dp on d.id=dp.dom_id left join IP_Addresses ip on dp.val=ip.id where dp.param="ip_addr_id" and ip.ip_address="203.0.113.2";' > domlist.txt

    Note: check that domlist.txt contains correct information.

  5. Execute below command to add IPv6 for the list of subscriptions specified in domlist.txt:

    # cat domlist.txt | while read a b; do echo "$a - $b"; plesk bin subscription -u $a -ip "$b",'2001:db8:f61:a1ff:0:0:0:80' -mail-service-ip "$b",'2001:db8:f61:a1ff:0:0:0:80';done

    Note: it will also add IPv6 for mail service to Subscription DNS settings. Remove option -mail-service-ip "$b",'2001:db8:f61:a1ff:0:0:0:80' if it's not required.

For Windows:

  1. Login to the server via RDP.
  2. In case of IPv6 was added to the server execute below command to add it to Plesk:

    C:> "%plesk_bin%ipmanage" --reread

    In case of IPv6 was not added to the server execute below command. It will add IPv6 to the server and Plesk:

    C:> "%plesk_bin%ipmanage" -c "2002:7b7b:7b:9b::1" -mask 64 -interface "Ethernet" -type shared

  3. Find all domains that use specific IPv4, in example below it's 203.0.113.2:

    C:> plesk db -NBe "select d.name,ip.ip_address from domains d left join dom_param dp on d.id=dp.dom_id left join IP_Addresses ip on dp.val=ip.id where dp.param='ip_addr_id' and ip.ip_address='203.0.113.2';" > C:domlist.txt

    Note: check that C:domlist.txt contains correct information.

  4. Execute below command to add IPv6 for the list of subscriptions specified in C:domlist.txt:

    C:> for /F "tokens=1,2* " %a in (C:domlist.txt) do "%plesk_bin%subscription" -u %a -ip %b,"2001:db8:f61:a1ff:0:0:0:80" -mail-service-ip %b,"2001:db8:f61:a1ff:0:0:0:80"

    Note: it will also add IPv6 for mail service to subscription DNS settings. Remove option -mail-service-ip "%b",'2001:db8:f61:a1ff:0:0:0:80' if it's not required.

 

Exit mobile version