Author Topic: Add additional IP addresses to CWP 7  (Read 21119 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Add additional IP addresses to CWP 7
« on: February 20, 2017, 05:07:43 AM »
For CWP 7 adding additional IP addresses using method in WIKI will give you a headache!

Try this, it worked for me.

Depending on the amount of IPs you’re configuring, it may be easier to just add them manually. Adding a small number of IPs can be completed by adding them to your main network interface configuration file. Let’s cover the permanent method by updating our network interface configuration using the following command (replacing enp3s0 if different with your interface name):

[root@localhost ]# vi /etc/sysconfig/network-scripts/ifcfg-enp3s0

Assuming that you already have at least one IP address configured (eg: 192.168.1.2) from for example your 192.168.1.0/29 range as IPADDR=, you can append the following lines to your configuration file to enable additional usable IP addresses from your /29 CIDR:

IPADDR0=192.168.1.3
IPADDR1=192.168.1.4
IPADDR2=192.168.1.5
IPADDR3=192.168.1.6
PREFIX0=29
PREFIX1=29
PREFIX2=29
PREFIX3=29

Restart the network for the changes to take effect:

[root@localhost]# systemctl restart network

Lastly, check that they’re working as expected:

[root@localhost ]# ping -c 4 192.168.1.3

[root@localhost ]# ping -c 4 192.168.1.4

[root@localhost ]# ping -c 4 192.168.1.5

[root@localhost ]# ping -c 4 192.168.1.6

Make sure to substitute the relevant CIDR for your requirements ie 24 for 253 IPs etc in PREFIXes .

Restart apache ( I did - may not be necessary )

Additional IP address will then be visible in admin panel for new user setup.

Hope this helps somebody....
« Last Edit: February 20, 2017, 05:20:57 AM by indigo »

Offline
*
Re: Add additional IP addresses to CWP 7
« Reply #1 on: February 18, 2018, 01:18:16 PM »
I'm new to Linux. I am trying to use CWP behind a gateway device which will NAT traffic to CWP. I have entered the same local IP address for Default, NATed and Shared.

I want to add more local IP's so I can have different IP's for each domain. Trying to avoid SNI.

I have the following two files but neither one contains the local IP address (192.168.1.10) I have specified:
  • ifcfg-ens192
  • ifcfg-lo

ifcfg-ens192 does not contain "IPADDR=".
ifcfg-lo contains "IPADDR=127.0.0.1".

Which file contains 192.168.1.10 and where do I add the other IP's I want to use?



Offline
**
Re: Add additional IP addresses to CWP 7
« Reply #2 on: February 20, 2018, 10:22:35 AM »
You would have to either add the ip address as a virtual interface to
/etc/sysconfig/network-scripts/ifcfg-eth0 or 1 depending on what you have and how many physical nice

or make a new ifcfg-ethxxx file and add the config there

have a look at this https://www.garron.me/en/linux/add-secondary-ip-linux.html


Offline
*
Re: Add additional IP addresses to CWP 7
« Reply #3 on: February 20, 2018, 08:46:18 PM »
You would have to either add the ip address as a virtual interface to
/etc/sysconfig/network-scripts/ifcfg-eth0 or 1 depending on what you have and how many physical nice

or make a new ifcfg-ethxxx file and add the config there

have a look at this https://www.garron.me/en/linux/add-secondary-ip-linux.html

Thanks but I don't have a ifcfg-eth0 or ifcfg-eth1. I only have ifcfg-ens192 and ifcfg-lo.

The link you provided is for Ubuntu. It appears the file structure is different.

Offline
**
Re: Add additional IP addresses to CWP 7
« Reply #4 on: February 21, 2018, 06:20:12 AM »
Hi there , do you have network on your server ?

Offline
*
Re: Add additional IP addresses to CWP 7
« Reply #5 on: February 21, 2018, 07:51:10 PM »
Thanks for the responses. I'm still dealing with the Linux learning curve.

I now understand that ifcfg-ens192 is the same as ifcfg-eth0, ifcfg-ens33, etc. Only the name is different and it gets it's name from the installer.

My ifcfg-ens192 did not contain an IP address because the CentOS installer defaults to DHCP. I was thinking there must be another file somewhere that contained the IP address but now I know better.

I have successfully added additional IP's by using both methods listed below:

Offline
*
Re: Add additional IP addresses to CWP 7
« Reply #6 on: March 04, 2019, 04:31:50 AM »
Thanks for the responses. I'm still dealing with the Linux learning curve.

I now understand that ifcfg-ens192 is the same as ifcfg-eth0, ifcfg-ens33, etc. Only the name is different and it gets it's name from the installer.

My ifcfg-ens192 did not contain an IP address because the CentOS installer defaults to DHCP. I was thinking there must be another file somewhere that contained the IP address but now I know better.

I have successfully added additional IP's by using both methods listed below:

i add the new ips following your instructions and i see the ips when i add new account, but could be possible convert the ips as shared too.. to add multiple sites to an extra ip?
mainip -> domain1.com
mainip -> domain2.com
mainip -> domain4.com
extraip1 -> domain3.com
extraip1 -> domain5.com
?
thanks


and i have a problem using nginx + apache + php-fpm: when i add a new account using one of the extra ips added, when i try acces via newdomain.com i got an error, isee iin chrome "connection refused", but i can acces via domain.com:8181, it seems like the port is busy or i dont know... :(

Offline
*
Re: Add additional IP addresses to CWP 7
« Reply #7 on: March 04, 2019, 02:03:00 PM »
Did you edit the Apache hosts files and nginx config for each domain so they use the new IP? I don't know why CWP doesn't do this automatically. You would think it would but CWP associates the new IP to the user account(s) only.