I can't seem to figure out how to setup a public IP for the VM so we could use it as a second public webserver. The host machine runs our primary webserver with CentOS 6.9 and one public ipv4 address configured on physical interface eth0. Now i have configured a new bridge interface br0: DEVICE=br0 TYPE=Bridge BOOTPROTO=static The IP settings are for a second public ipv4 address in the same network. Now i setup the VM to use br0 for the NIC and set the same IP settings inside the VM... but it doesn't work. The VM can't resolve any hosts, and if i try to ssh to the second public IP, it just sends me to the host machine instead of the VM.
On 12/07/2017 05:57 AM, scar wrote:> I can't seem to figure out how to setup a public IP for the VM so we > could use it as a second public webserver. The host machine runs our > primary webserver with CentOS 6.9 and one public ipv4 address configured > on physical interface eth0. Now i have configured a new bridge > interface br0: > DEVICE=br0 > TYPE=Bridge > BOOTPROTO=static > > The IP settings are for a second public ipv4 address in the same > network. Now i setup the VM to use br0 for the NIC and set the same IP > settings inside the VM... but it doesn't work. The VM can't resolve any > hosts, and if i try to ssh to the second public IP, it just sends me to > the host machine instead of the VM. >Try using macvtap instead. A bridge is more like an internal software-based switch, it's not really a NIC. /tony -- Tony Albers Systems administrator, IT-development Royal Danish Library, Victor Albecks Vej 1, 8000 Aarhus C, Denmark. Tel: +45 2566 2383 / +45 8946 2316
scar writes:> I can't seem to figure out how to setup a public IP for the VM so we could > use it as a second public webserver. The host machine runs our primary > webserver with CentOS 6.9 and one public ipv4 address configured on physical > interface eth0. Now i have configured a new bridge interface br0: > DEVICE=br0 > TYPE=Bridge > BOOTPROTO=static > > The IP settings are for a second public ipv4 address in the same network. > Now i setup the VM to use br0 for the NIC and set the same IP settings > inside the VM... but it doesn't work. The VM can't resolve any hosts, and > if i try to ssh to the second public IP, it just sends me to the host > machine instead of the VM.Do you have BRIDGE=br0 In the ifcfg file for your host's network interface, with only its first, primary, IP address? Also my bridge configuration has ONBOOT=yes
On Thu, 2017-12-07 at 11:55 -0500, Doug Hughes wrote: [...]> from the guest perspective, here's an example from the .xml > <interface type='network'> > <mac address='52:54:00:b0:98:0b'/> > <source network='default'/> > <model type='rtl8139'/>As a side note, you should only use rtl8139 if your guest OS literally can't be convinced to work with anything else. -- Andrea Bolognani / Red Hat / Virtualization