FAQ
I need to allocate public IP address to two guest os.

I have only 2 network card Interface on server. say eth0 and eth1.

I set eth1 a public IP address. so it should in

# vi /etc/sysconfig/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=static
HWADDR�:1a:4d:83:ad:00
BROADCAST 2.127.29.0
IPADDR 2.127.29.5
NETMASK%5.255.255.0
NETWORK 2.127.29.0
ONBOOT=yes
TYPE=Ethernet

Question 1: do I have to add GATEWAY 2.127.29.1 to above setting?

now continue to set eth0,seems I would use it as bridge ,so ifcfg-eth0 would be:
# vi ifcfg-eth0
DEVICE=eth0
HWADDR�:1a:4d:83:ad:50
ONBOOT=yes
BRIDGE=br0

There's no IP address in this ifcfg-eth0. so
Question 2: do I need to add the rest 2 IP addresses in br0? or I should keep br0 with no IP address and set IP in guest OS directly?
Could anybody tell me how to set br0 to let host os and 2 guest os all have their own dedicated IP address?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.centos.org/pipermail/centos-virt/attachments/20091211/e49876e7/attachment.html

Search Discussions

  • Christopher G. Stach II at Dec 11, 2009 at 11:32 am

    ----- "rewing" wrote:

    I need to allocate public IP address to two guest os.

    I have only 2 network card Interface on server. say eth0 and eth1.

    I set eth1 a public IP address. so it should in

    # vi /etc/sysconfig/ifcfg-eth1

    DEVICE=eth1
    BOOTPROTO=static
    HWADDR�:1a:4d:83:ad:00
    BROADCAST 2.127.29.0
    IPADDR 2.127.29.5
    NETMASK%5.255.255.0
    NETWORK 2.127.29.0
    ONBOOT=yes
    TYPE=Ethernet

    Question 1: do I have to add GATEWAY 2.127.29.1 to above setting?
    GATEWAY probably belongs in /etc/sysconfig/network...
    Question 2: do I need to add the rest 2 IP addresses in br0? Nope.
    or I
    should keep br0 with no IP address and set IP in guest OS directly?
    Yep. However, if you do that, you will need something acting as the gateway. If your host is going to be the gateway, it will need an address set in ifcfg-br0 and packet forwarding turned on. If eth1 and br0 are both in the same [public] network, you should just set the public IP address on br0 and add both eth0 and eth1 to the bridge and turn on STP.

    (I don't see why you need eth0 in this mix at all if you are just using it for guests on the local machine.)

    --
    Christopher G. Stach II
    http://ldsys.net/~cgs/
  • Rewing at Dec 12, 2009 at 10:51 am

    To: Discussion about the virtualization on CentOS
    <centos-virt at centos.org>
    Message-ID:
    <448255702.63.1260531144350.JavaMail.root at mail.chi.ldsys.net>
    Content-Type: text/plain; charset=utf-8
    ----- "rewing" wrote:
    I need to allocate public IP address to two guest os.

    I have only 2 network card Interface on server. say eth0 and eth1.

    I set eth1 a public IP address. so it should in

    # vi /etc/sysconfig/ifcfg-eth1

    DEVICE=eth1
    BOOTPROTO=static
    HWADDR�:1a:4d:83:ad:00
    BROADCAST 2.127.29.0
    IPADDR 2.127.29.5
    NETMASK%5.255.255.0
    NETWORK 2.127.29.0
    ONBOOT=yes
    TYPE=Ethernet

    Question 1: do I have to add GATEWAY 2.127.29.1 to above setting?
    GATEWAY probably belongs in /etc/sysconfig/network...
    Question 2: do I need to add the rest 2 IP addresses in br0? Nope.
    or I
    should keep br0 with no IP address and set IP in guest OS directly?
    Yep. However, if you do that, you will need something acting as the gateway. If your host is going to be the gateway, it will need an address set in ifcfg->br0 and packet forwarding turned on. If eth1 and br0 are both in the same [public] network, you should just set the public IP address on br0 and add both eth0 and eth1 to the bridge and turn on STP.
    (I don't see why you need eth0 in this mix at all if you are just using it for guests on the local machine.)
    --
    Christopher G. Stach II
    http://ldsys.net/~cgs/
    Hi,Christopher,

    Thanks, But still I'm a little confused.

    Actually I don't need host to be a gateway. There're should be gate way's on that IDC center. So the gate way should be add to /etc/sysconfig/network, right?

    And still, I have 2 ehtnet interface on my mainboard. So I should allocate eth1 an IP address for host, and only make eth0 as br0, and set guest OS IP address in guest OS network configuration, right?

    Please help to check if this is the correct setting as bellow

    /etc/sysconfig/ifcfg-eth1
    DEVICE=eth1
    BOOTPROTO=static
    HWADDR�:1a:4d:83:ad:00
    BROADCAST 2.127.29.0
    IPADDR 2.127.29.5
    NETMASK%5.255.255.0
    NETWORK 2.127.29.0
    ONBOOT=yes
    TYPE=Ethernet

    /etc/sysconfig/ifcfg-eth0
    DEVICE=eth0
    HWADDR�:1a:4d:83:ad:50
    ONBOOT=yes
    BRIDGE=br0

    /etc/sysconfig/ifcfg-br0
    DEVICE=br0
    TYPE=Bridge
    BOOTPROTO=none
    ONBOOT=yes
    DELAY=0

    will this work so host os and 2 guest oses all got their IP address? or I should modify something?
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.centos.org/pipermail/centos-virt/attachments/20091212/6be84965/attachment.html
  • Christopher G. Stach II at Dec 12, 2009 at 8:22 pm

    ----- "rewing" wrote:

    Thanks, But still I'm a little confused.

    Actually I don't need host to be a gateway.
    How do you expect packets to get from one ethernet interface to the other without packet forwarding and a gateway on each network?
    And still, I have 2 ehtnet interface on my mainboard. So I should
    allocate eth1 an IP address for host, and only make eth0 as br0, and
    set guest OS IP address in guest OS network configuration, right?
    Maybe just add eth1 to br0 and not use eth0?

    --
    Christopher G. Stach II
    http://ldsys.net/~cgs/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos-virt @
categoriescentos
postedDec 11, '09 at 9:23a
activeDec 12, '09 at 8:22p
posts4
users2
websitecentos.org
irc#centos

2 users in discussion

Christopher G. Stach II: 2 posts Rewing: 2 posts

People

Translate

site design / logo © 2022 Grokbase