OpenVZ Forum


Home » General » Support » Adding external (eth0:0) IP to VE - missunderstanding of networking modes
Adding external (eth0:0) IP to VE - missunderstanding of networking modes [message #47031] Thu, 28 June 2012 02:23 Go to next message
Rex_GER is currently offline  Rex_GER
Messages: 6
Registered: February 2010
Junior Member
Hello,

i have an dedicated server (here are quotes from my test-instance which has nearly same architecture), the one and only ip is an external and that is assigned to eth0:
(let's assume the locale IPs are externals)

[root@cent64openvz1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
BROADCAST="172.16.255.255"
DNS1="172.16.250.11"
GATEWAY="172.16.250.10"
HWADDR="00:15:5D:B2:64:18"
IPADDR="172.16.253.1"
NETMASK="255.255.0.0"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"

Now the hoster provides IP-Aliases, which have to be assigned that way (they told me on the phone):
[root@cent64openvz1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0:1
DEVICE="eth0:1"
ONBOOT="yes"
BOOTPROTO="none"
IPADDR=172.16.253.200
NETMASK="255.255.0.0"

----
If i ping 172.16.253.200 from other Clients, they get an answer. My existing container got their ip-adress via vzctl set ve_id --ipadd .... (i noticed inside the ve via ifconfig the ip is assigned to venet..

if i tracert to an container-ip, i see to entries - 1st the hwnode, 2nd the ve-ip
if i tracert to the "ip alias" (eth0:1) i see only that ip... seems to work...
----

On which way do i have to assign this ip (172.16.253.200) to a Container i created recently but i haven't assigned an IP so far? And which settings do i have to set that my container can ping outside, resolve hostnames and so on? I have some understanding problems where to set what settings... (where DNS and/or Gateway? what about the 'route' entries?)

Thanks in Advance for your Replies!

Regards
Dennis


edit:

[root@cent64openvz1 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.253.35 * 255.255.255.255 UH 0 0 0 venet0
172.16.253.20 * 255.255.255.255 UH 0 0 0 venet0
172.16.253.10 * 255.255.255.255 UH 0 0 0 venet0
172.16.253.40 * 255.255.255.255 UH 0 0 0 venet0
172.16.253.200 * 255.255.255.255 UH 0 0 0 venet0
172.16.253.30 * 255.255.255.255 UH 0 0 0 venet0
link-local * 255.255.0.0 U 1002 0 0 eth0
172.16.0.0 * 255.255.0.0 U 0 0 0 eth0
default svr08r2router1. 0.0.0.0 UG 0 0 0 eth0

[Updated on: Thu, 28 June 2012 02:25]

Report message to a moderator

Re: Adding external (eth0:0) IP to VE - missunderstanding of networking modes [message #47033 is a reply to message #47031] Thu, 28 June 2012 16:05 Go to previous messageGo to next message
Ales is currently offline  Ales
Messages: 330
Registered: May 2009
Senior Member
Basic usage example, ie. you have 3 public IPs from the same subnet available to your server:

- assign 1st IP to eth0 as you normally would
- do *not* assign 2nd and 3rd IP to eth0
- assign 2nd IP to one VM, using vzctl
- assign 3rd IP to another VM, using vzctl.

If you're in doubts which DNS etc. to use for your VMs, use same as you do for eth0.

That's it. Nothing else to do.
Re: Adding external (eth0:0) IP to VE - missunderstanding of networking modes [message #47037 is a reply to message #47031] Thu, 28 June 2012 18:45 Go to previous message
Rex_GER is currently offline  Rex_GER
Messages: 6
Registered: February 2010
Junior Member
Ah thank you for your replay. I understood the way if all IPs are on the same subnet.

But how to deal with external IPs which are "routed to" the main external ip of the server (the hoster specified other IPs for DNS and for Gateway).

Edit: And in this case, do I have to define some routes via route add ?

[Updated on: Thu, 28 June 2012 21:34]

Report message to a moderator

Previous Topic: OPENVZ call of duty 4
Next Topic: vzfirewall and vzctl
Goto Forum:
  


Current Time: Fri Aug 02 19:19:40 GMT 2024

Total time taken to generate the page: 0.02966 seconds