How To Add Private IP in OpenVZ VE

How To Add Private IP in OpenVZ VPS

First we need to configure a private IP and its route in VPS Node and ensure that private network is available on Node. Then follow the steps below.

1) Add private IP to VPS.

vzctl set <VEID> --ipadd <private IP> --save

Eg:

vzctl set 100 --ipadd 10.10.11.5 --save

2) Add routing rules as follows.

ip ro add <private network range> via <gateway of private IP>

Eg:

ip ro add 10.10.0.0/16 via 10.10.11.5

Here we are using the VEs own private IP as the gw to work the private IP in VPS, no need to use its original gateway(like 10.10.11.1), it wont work.

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: