OpenVZ Forum


Home » General » Support » Add an private IP address into a CT
Add an private IP address into a CT [message #52423] Tue, 07 June 2016 12:27 Go to previous message
ekx27 is currently offline  ekx27
Messages: 2
Registered: June 2016
Junior Member
Hi,

I recently bought a OpenVZ Container from a hosting company and I would like to add a private IP address.

Here is the default config I had :

Quote:

#ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.2 P-t-P:127.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:34 errors:0 dropped:0 overruns:0 frame:0
TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4401 (4.2 KiB) TX bytes:5688 (5.5 KiB)

venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:xxx.xxx.xxx.xxx P-t-P:xxx.xxx.xxx.xxx Bcast:xxx.xxx.xxx.xxx Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1


This works, I can ping everything :

Quote:

#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.Cool 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=50 time=5.74 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=50 time=5.78 ms


If I add into the /etc/network/interface.tail the following :

Quote:

auto venet0:1
iface venet0:1 inet static
address 172.16.70.1
netmask 255.255.255.255


ifconfig result :

Quote:
~# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.2 P-t-P:127.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:23 errors:0 dropped:0 overruns:0 frame:0
TX packets:24 errors:0 dropped:20 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3352 (3.2 KiB) TX bytes:5067 (4.9 KiB)

venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:xxx.xxx.xxx.xxx P-t-P:xxx.xxx.xxx.xxx Bcast:xxx.xxx.xxx.xxx Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1

venet0:1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:172.16.70.1 P-t-P:172.16.70.1 Bcast:172.16.70.1 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1


Then, nothing ping into the Internet...

Here is the routing table :

Quote:

#route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default * 0.0.0.0 U 0 0 0 venet0


Am I doing something wrong?
 
Read Message
Read Message
Read Message
Previous Topic: Ubuntu 16.04 kernel versions
Next Topic: I need to refresh ARP frequently.
Goto Forum:
  


Current Time: Fri Sep 29 02:53:03 GMT 2023

Total time taken to generate the page: 0.03030 seconds