Jump to content
SolusVM Community
Sign in to follow this  
basic

Networking: Virtual Ethernet device - Cobbler on bridged VPS

Recommended Posts

Hello All:

Here is my (very technical) question:

We use "Cobbler" as an installer server in our racks (to install an OS on dedicated servers). Cobbler itself has always been installed on an OpenVZ server as a VPS, on a physical server (the node) running CentOS 5. We now moved everything to new hardware, and that runs CentOS 6.8. In order to have that Cobbler VPS work, it needs its own MAC address. And so we use a "Virtual Ethernet device" setup with "bridge" as described here:
https://wiki.openvz.org/Virtual_Ethernet_device
and here:
https://wiki.openvz.org/VEs_and_HNs_in_same_subnets

P r o b l e m after moving to new hardware:
Played with this for many hours, but just cannot get the VPS to show the assigned MAC address. The 'bridge' setup otherwise works, all existing VPS servers are online -- they connect, BUT they all use venet and not veth.
If I "arp" the VPS IP on the OLD server the output is like this (I edit the actual IP here):

arp -a 210.72.155.105
s38.bacnet.net (210.72.155.105) at 00:18:52:8C:E5:15 [ether] on vzbr0
s38.bacnet.net (210.72.155.105) at * PERM PUP on vzbr0

So, it does show the MAC address of the VPS. But on the NEW server it it looks like this:

arp -a 210.72.155.105
s38.bacnet.net (210.72.155.105) at * PERM PUP on vzbr0
s38.bacnet.net (210.72.155.105) at * PERM PUP on eth1

The output for 'ifconfig' also shows me that the Cobbler VPS uses the node server's MAC address.

The config fine for the VPS ....
/etc/vz/conf/112.conf
... does have this line for the bridge setup (MAC address edited):
NETIF="ifname=eth1,bridge=vzbr0,mac=0C:C3:7A:7D:6F:0D,host_ifname=veth112.0,host_mac=0C:C5:7A:7D:2F:1C"

The node (physical server) used "eth1" to connect -- not "eth0" -- so, this is why it says "eth1" above.


P O S S I B L E solution (or cause of problem):
On above mentioned website ....
https://wiki.openvz.org/Virtual_Ethernet_device
... under sub-header "Configure device in CT" I see this:
---------
[host-node]# vzctl enter 101
[ve-101]# /sbin/ifconfig eth0 0
[ve-101]# /sbin/ip addr add 192.168.0.101 dev eth0
[ve-101]# /sbin/ip route add default dev eth0
---------

I followed this .... WITHOUT *really* knowing what I am doing at this point (ouch!), but got stopped out at the last step:

vzctl enter 112
entered into CT 112
[root@cobbler /]# /sbin/ifconfig eth1 0
[root@cobbler /]# /sbin/ip addr add 210.72.155.105 dev eth1
[root@cobbler /]# /sbin/ip route add default dev eth1
RTNETLINK answers: File exists

I am not sure WHAT or better WHERE this last command does something? Is there a settings file that this command edits, and that I could also access via vi or nano? AFTER having issued the first two commands, doing an "arp" on the VPS IP then already shows the allocated MAC address .... thats gone with a network restart though. BUT it shows this only as 2nd connection ... makes it still not to work.


Any input here? Maybe someone has had the same or a very similar problem?


A last thought:


The physical server (= the node) uses "eth1" to connect to the network. When, with that "bridge" setup, within the VPS (in /etc/sysconfig/network-scripts/) I use ...
ifcfg-eth0
AND
ifcfg-eth1
... as a test, and then restart the network within that VPS, I get this:

---------
Bringing up interface eth0:
Device eth0 does not seem to be present, delaying initialization. [FAILED]

Bringing up interface eth1:
RTNETLINK answers: Operation not permitted
---------

The first error I understand.... so, because the node uses "eth1" and thus trying to use "eth0" gets me an error.
But "eth1" should then work, given it connects to the bridge. So, this I do not understand.
Do you?


Thanks!

Frank

Share this post


Link to post
Share on other sites

Just noted that, if I add some fantasy MAC address to "ifcfg-br0" on the host note (physical server), it then does display in the br0 bridge and for teh Cobbler VPS. However, it ALSO displays the same for all other VPS container IPs (of other VPS) on the same physical node -- so this does not make Cobbler work either.

Share this post


Link to post
Share on other sites

Finally solved this problem ... more so by playing around with it than by a clear-cut analysis. So I am still not sure why exactly the following issue was/is an issue ... but worked for me:

 

On the VPS container itself (runing Cobbler and set up for "veth") the file

/etc/sysconfig/network-scripts/ifcfg-eth1

(for most other this would likely be "ifcfg-eth0", but our server connects via eth1)

I had an entry for the GATEWAY IP ... like this (the IPs are changed for this posting):

 

DEVICE=eth1
BOOTPROTO=static
IPADDR=210.72.155.105
NETMASK=255.255.255.192
BROADCAST=210.72.155.127

GATEWAY=210.72.155.65
DNS1=8.8.8.8
DNS2=4.2.2.2
ONBOOT=yes

 

THAT was the problem .... it works fine when having the NETWORK IP there, and when taking OFF the GATEWAY entry. Not really sure why a GATEWAY entry creates is a problem, given this is for this one VPS only -- maybe it clashes with other entries in the "veth" forwarding.

 

DEVICE=eth1
BOOTPROTO=static
IPADDR=210.72.155.105
NETMASK=255.255.255.192
BROADCAST=210.72.155.127
NETWORK=210.72.155.64
DNS1=8.8.8.8
DNS2=4.2.2.2
ONBOOT=yes

 

Best,

Frank

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×