Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   Multiple IP Addresses for a bridge (http://www.linux-archive.org/centos/519849-multiple-ip-addresses-bridge.html)

Emmanuel Noobadmin 04-29-2011 10:51 AM

Multiple IP Addresses for a bridge
 
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.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Lucian 04-29-2011 10:59 AM

Multiple IP Addresses for a bridge
 
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..
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Ljubomir Ljubojevic 04-29-2011 11:21 AM

Multiple IP Addresses for a bridge
 
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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Benjamin Hackl 04-29-2011 11:51 AM

Multiple IP Addresses for a bridge
 
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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Emmanuel Noobadmin 04-29-2011 07:54 PM

Multiple IP Addresses for a bridge
 
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.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Kai Schaetzl 04-30-2011 03:31 PM

Multiple IP Addresses for a bridge
 
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


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Arun Khan 05-03-2011 09:40 AM

Multiple IP Addresses for a bridge
 
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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


All times are GMT. The time now is 10:24 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.