Ask Your Question
0

Failed to ping from linux bridge's gw ip

asked 2012-06-01 23:31:39 -0500

gongysh gravatar image

I failed to set up a molti node env with linux bridge plugin. So I want to have a simulation first.

First I did a test between two hosts: host a: ip link add link eth0 name eth0.1000 type vlan id 1000 ip link set eth0.1000 up ip addr add 4.4.4.1/24 dev eth0.1000 host b: ip link add link eth0 name eth0.1000 type vlan id 1000 ip link set eth0.1000 up ip addr add 4.4.4.2/24 dev eth0.1000

This way I can ping each other from both hosts

Then I add in linux bridge on one host: host b: ip link add link eth0 name eth0.1000 type vlan id 1000 ip link set eth0.1000 up brctl addbr br200 brctl setfd br200 0 brctl stp br200 off ip link set br200 up brctl addif br200 eth0.1000

ip tuntap add gw200 mode tap ip link set gw200 up brctl addif br200 gw200 ip addr add 4.4.4.2/24 dev gw200

but I cannot ping from each other.

Who can help with this? Thanks

edit retag flag offensive close merge delete

15 answers

Sort by ยป oldest newest most voted
0

answered 2012-06-05 00:29:38 -0500

gongysh gravatar image

Hi Hua, I have tried, no chance to work. Thanks

edit flag offensive delete link more
0

answered 2012-06-04 01:31:01 -0500

gongysh gravatar image

Hi Summit, Now I can ping each other with following scripts: hosta: ip link add link eth0 name eth0.1000 type vlan id 1000 ip link set eth0.1000 up

ip tuntap add gw200 mode tap ip link set gw200 address 00:21:CC:6D:44:43 ip link set gw200 up

brctl addbr br200 brctl setfd br200 0 brctl stp br200 off ip link set br200 address 00:21:CC:6D:44:43 ip link set br200 up

brctl addif br200 eth0.1000

brctl addif br200 gw200 ip addr add 3.3.3.1/24 dev br200 ip addr add 3.3.3.1/24 dev gw200

hostb: ip link add link eth0 name eth0.1000 type vlan id 1000 ip link set eth0.1000 up

ip tuntap add gw200 mode tap ip link set gw200 address 00:21:CC:6D:44:45 ip link set gw200 up

brctl addbr br200 brctl setfd br200 0 brctl stp br200 off ip link set br200 address 00:21:CC:6D:44:45 ip link set br200 up

brctl addif br200 eth0.1000

brctl addif br200 gw200 ip addr add 3.3.3.2/24 dev br200 ip addr add 3.3.3.2/24 dev gw200

I have a new problem for the VM on each host. I created one vm with following steps on hosta: ip tuntap add tap4cce2519-02 mode tap ip link set tap4cce2519-02 address fa:16:3e:48:31:dc ip link set tap4cce2519-02 up brctl addif br200 tap4cce2519-02

virsh dumpxml instance-00000001: ... <interface type="ethernet"> <mac address="fa:16:3e:48:31:dc"/> <script path=""/> <target dev="tap4cce2519-02"/> </interface> ... and in the vm, I config the eth0: sudo ifconfig eth0 3.3.3.4 broadcast 3.3.3.255 netmask 255.255.255.0

after that I can ping hosta in VM: ping 3.3.3.1 but I cannot ping hostb: ping 3.3.3.2

By the same token, I created a vm on hostb with ip 3.3.3.3, I can ping hostb, but cannot ping hosta.

That means the ping cannot go across the host.

any ideas? Thanks

edit flag offensive delete link more
0

answered 2012-06-21 07:43:48 -0500

gongysh gravatar image

tap dev should have different mac than the VM

edit flag offensive delete link more
0

answered 2012-06-05 04:32:01 -0500

gongysh gravatar image

I can ping just hosta 3.3.3.1 which is a br200 ip address from VMs on hosta, but cannot ping hostb's 3.3.3.2, which is hostb's br200 ip address.

I will use tcpdump later. Thanks

edit flag offensive delete link more
0

answered 2012-06-02 03:06:57 -0500

I believe what happens in the later case is that the tap device by itself does not have a L3 stack to respond to the ping unless that tap device has a VM associated with it.

In the former case, the host's network stack itself will respond to the ping.

Hence in the current implementation, I assign the gateway IP address to the bridge (however we still need the gw interface so as to anchor the MAC address to the bridge).

edit flag offensive delete link more
0

answered 2012-06-02 11:06:22 -0500

gongysh gravatar image

Can you tell me more about (however we still need the gw interface so as to anchor the MAC address to the bridge)?

and how Should I modify the scripts so that they can ping each other without any VMs?

Thanks

edit flag offensive delete link more
0

answered 2012-06-03 08:17:26 -0500

In the experiment that you are trying, you can assign an IP address to the bridge.

When using Quantum/Linux-bridge plugin, you should not have to change anything. The only problem I have seen recently is that the VMs that are created on the default network (the one created when the installation is done using devstack) are not able to reach the metadata server, hence they do not acquire an IP address. I am trying to investigate this.

I have some more documentation on the gw interace here (see the section on handling the gateway interface): http://wiki.openstack.org/Quantum-Linux-Bridge-Plugin (http://wiki.openstack.org/Quantum-Lin...)

edit flag offensive delete link more
0

answered 2012-06-04 07:00:07 -0500

zhhuabj gravatar image

you can ping hosta in VM from hosta, but cann't ping hostb, so I think you try following command on hosta ( only a little of theory analysis, I am not sure it can work ): sysctl -w net.ipv4.ip_forward=1
route add -host 3.3.3.4 dev tap4cce2519-02

then on VM from hosta: route add default gw 3.3.3.1

edit flag offensive delete link more
0

answered 2012-06-05 04:16:31 -0500

Few things to check for -

Can you ping the gateway address 3.3.3.1 (in this case) from the VM on the hostb?

Can you ping the gateway address 3.3.3.1 from just the hostb?

Are there in iptables rules in place blocking the VM traffic?

If there are no further clues, you probably might want to do a tcpdump on the relevant interfaces to see how far the packets are reaching across the hosts.

edit flag offensive delete link more
0

answered 2012-06-05 07:04:16 -0500

zhhuabj gravatar image

Hi Sumit,

     I also done this experiment in multi physical machines, but faied.

     but I found one article,  it said should use TUN to communicate in two TAP virtual NIC from two physical machines.

     http://kovyrin.net/2006/04/05/connecting-two-remote-local-networks-with-transparent-bridging/

     So I was confused in following issues:

     1) can linux bridge with physical NICs be used in multi physical machines ?  

     2) can linux bridge with TAP virtual NICs be used in multi physical machines ?   need to use TUN ?

     3) why we create a TAP NIC named gw200 ?  what's it's role ? can we directly use br200 ?

     4) another other not related problem with this question, assume compute node only has one physical NIC ( eth0 ), and we don't use vlan (  means no eth0.1000 at this time ),  meanwhile I also want have two network ( manament nework 172.17.1.0/24, and service network 10.0.0.0/8)  in this single NIC,  can do do it ?
        my question is ,  the network of bridge is 10.0.0.0/8,  if I add this single NIC eth0  into bridge,  many docs said should remove ip from eth0 at this time.  can eth0 sitll keep it's original ip ( 17.17.1.0/24) ?  if so, what's their route path ?

     look forward to your input, many thanks.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2012-06-01 23:31:39 -0500

Seen: 1,585 times

Last updated: Jun 21 '12