Is it possible to assign multiple IP addresses to a bridge the same way ethernet devices can?
The purpose is to accept incoming traffic for multiple public IP. 1 Physical NIC -> br0 (accepts incoming traffic for x.x.x.2 to x.x.x.5)
Then 3 different virtual interfaces are connected to this bridge 1. eth0 (x.x.x.2) 2. eth1 (x.x.x.3) 3. eth2 (x.x.x.4)
On Fri, Apr 29, 2011 at 10:08 AM, Emmanuel Noobadmin centos.admin@gmail.com wrote:
Is it possible to assign multiple IP addresses to a bridge the same way ethernet devices can?
Yes, I think you can even define whole ranges of addresses.
The purpose is to accept incoming traffic for multiple public IP. 1 Physical NIC -> br0 (accepts incoming traffic for x.x.x.2 to x.x.x.5)
Then 3 different virtual interfaces are connected to this bridge
- eth0 (x.x.x.2)
- eth1 (x.x.x.3)
- eth2 (x.x.x.4)
Something seems out of order with the above; may I ask what exactly you are trying to achieve? Unless I read it all wrong you want (i.e.) x.x.x.2 on br0 and also on eth0? This cannot work.
On 4/29/11, Lucian lucian@lastdot.org wrote:
Something seems out of order with the above; may I ask what exactly you are trying to achieve? Unless I read it all wrong you want (i.e.) x.x.x.2 on br0 and also on eth0? This cannot work.
Well, I have a physical connected to the ISP modem/router which assigned the connection a block of 8 IPs
So I already have eth0 bridged to br0 using the IP x.x.x.2
Now I'm trying to figure out why a virtual guest with an eth0 device assigned wth IP x.x.x.3 can't connect anywhere.
Looking at the Rx Tx of the vnet0 device that was generated, it seems that the vnet0 is getting traffic but not sending them on.
So I'm wondering if it's because the bridge isn't assigned the x.x.x.3 IP hence ignoring the packets for/from x.x.x.3
And which then led me to try to assign more than 1 IP address. But using options such as IPADDR_START and IPADDR_END in ifcfg-br0 doesn't appear to work.
Neither did creating another bridge device ifcfg-br1 with the IP x.x.x.3 worked.
So I'm starting to wonder if it was possible in the first place.
On Fri, Apr 29, 2011 at 11:51 AM, Emmanuel Noobadmin centos.admin@gmail.com wrote:
On 4/29/11, Lucian lucian@lastdot.org wrote:
Something seems out of order with the above; may I ask what exactly you are trying to achieve? Unless I read it all wrong you want (i.e.) x.x.x.2 on br0 and also on eth0? This cannot work.
Well, I have a physical connected to the ISP modem/router which assigned the connection a block of 8 IPs
So I already have eth0 bridged to br0 using the IP x.x.x.2
Now I'm trying to figure out why a virtual guest with an eth0 device assigned wth IP x.x.x.3 can't connect anywhere.
So .2 works as main IP and .3 does not? Is your ISP doing any MAC address filtering? You may need to use a routed bridge then..
Lucian wrote:
On Fri, Apr 29, 2011 at 11:51 AM, Emmanuel Noobadmin centos.admin@gmail.com wrote:
On 4/29/11, Lucian lucian@lastdot.org wrote:
Something seems out of order with the above; may I ask what exactly you are trying to achieve? Unless I read it all wrong you want (i.e.) x.x.x.2 on br0 and also on eth0? This cannot work.
Well, I have a physical connected to the ISP modem/router which assigned the connection a block of 8 IPs
So I already have eth0 bridged to br0 using the IP x.x.x.2
Now I'm trying to figure out why a virtual guest with an eth0 device assigned wth IP x.x.x.3 can't connect anywhere.
So .2 works as main IP and .3 does not? Is your ISP doing any MAC address filtering? You may need to use a routed bridge then..
Correct way of doing bridging is to create a bridge br0 and add *all* IP's on the bridge itself (br:0, br:1, ....).
I am not sure, but it *might* allow you to add IP's on the *first* bonded device, but I am not sure about all of the later bonded devices.
Test somewhere first, and make sure you do "service network restart" each time.
Ljubomir
On 4/29/11, Lucian lucian@lastdot.org wrote
So .2 works as main IP and .3 does not? Is your ISP doing any MAC address filtering? You may need to use a routed bridge then..
It turns out that I was barking up the wrong tree and chasing red herrings.
The virtualized guest definition was off by one item so its networking was never really working properly. Once that was fixed, the .2 and .3 became pingable and the guests could connect to .1
Once I finish installing a base CentOS on the guest, I'll be able to confirm if the guest could actually connect to the external world.
if they are accessible via the Internet, then it means it wasn't necessary to add any IP to a bridge.
Nevertheless, thanks to everybody who responded.
Emmanuel Noobadmin wrote on Sat, 30 Apr 2011 03:54:01 +0800:
if they are accessible via the Internet, then it means it wasn't necessary to add any IP to a bridge.
FYI: the IP addresses of host and guest don't have to be in the same subnet, e.g. your host may have a private, non-routable IP address only and your VMs may have routable public addresses, no problem. If there is a working bridge the virtualization software takes care of adding virtual interfaces as required, at least xen does that.
Kai
On Fri, 29 Apr 2011 18:51:50 +0800 Emmanuel Noobadmin centos.admin@gmail.com wrote:
On 4/29/11, Lucian lucian@lastdot.org wrote:
Something seems out of order with the above; may I ask what exactly you are trying to achieve? Unless I read it all wrong you want (i.e.) x.x.x.2 on br0 and also on eth0? This cannot work.
Well, I have a physical connected to the ISP modem/router which assigned the connection a block of 8 IPs
You don't need a bridge unless you want to do firewalling or some routing or network modification at the bridge.
Just assign IP1 to eth0, IP2 to eth0:1, IP3 to eth0:2 and so on.
/etc/sysconfig/network-scripts/ifcfg-eth0:1 DEVICE=eth0:1 BOOTPROTO=none TYPE=Ethernet IPADDR=1.2.3.4 NETMASK=5.6.7.8 ONPARENT=yes
Should do the work.
Brgds
On Fri, Apr 29, 2011 at 4:21 PM, Emmanuel Noobadmin centos.admin@gmail.com wrote:
On 4/29/11, Lucian lucian@lastdot.org wrote:
Something seems out of order with the above; may I ask what exactly you are trying to achieve? Unless I read it all wrong you want (i.e.) x.x.x.2 on br0 and also on eth0? This cannot work.
Well, I have a physical connected to the ISP modem/router which assigned the connection a block of 8 IPs
So I already have eth0 bridged to br0 using the IP x.x.x.2
Now I'm trying to figure out why a virtual guest with an eth0 device assigned wth IP x.x.x.3 can't connect anywhere.
The interface from the host OS to the guest also needs to be part of the bridge. For instance, in Linux KVM, the "tap" interface presented by the host OS has to be part of the bridge. The guest OS can assign the IP you want and traffic passes bidirectionally. Don't know about other Virtualization platforms.
Can you share the output from "/sbin/brctl show"?
This is what my setup looks like (from a Debian setup)
$ /usr/sbin/brctl show bridge name bridge id STP enabled interfaces br0 8000.00262d5588d1 no eth0 tap1 tap3 br1 8000.aa9267231e88 no tap2 tap4
-- Arun Khan