[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: network/bridging problems



On Wed, Oct 2, 2013 at 3:05 AM, Ross Boylan <ross@biostat.ucsf.edu> wrote:




> I setup bridging on my system for kvm, but on restart of the host system
> (no guest VM's running) could not ping outside my local network.
>
> Bringing the bridge down corrected the  problem, but I'm trying to
> understand what is going on, and how I can make networking from the VM's
> work.
>
> /etc/network/interfaces has (on the advice of a wiki page on Debian and
> kvm)
> auto br0
> iface br0 inet dhcp
>    pre-up ip tuntap add dev tap0 mode tap user root
>    pre-up ip link set tap0 up
>    bridge_ports all tap0
>    bridge_stp off
>    bridge_maxwait 0
>    bridge_fd      0
>    post-down ip link set tap0 down
>    post-down ip tuntap del dev tap0 mode tap
>
> My one connected interface, eth2, was brought up by hotplug with no
> mention in interfaces.

Is NetworkManager running (for eth2 to be brought up in this way)?

If you want eth2 (or other ethX NICs since you're using "all") to be
part of the bridge (and you need at least one for your VM to have net
access), it has to be defined in this way:

auto eth2
iface inet eth2 manual

without having an ip address assigned and a default route defined.




> Originally, with the system up, I added the br0 stanza to interfaces and
> did ifup br0. This temporarily interrupted my network connections,
> which was not good, but they resumed afterwords.
>
> This time I restarted the system and found networking non-functional. I
> could not ping my ISP's nameserver.
> # ip route
> default via 192.168.40.10 dev eth2  proto static
> 192.168.40.0/24 dev br0  proto kernel  scope link  src 192.168.40.103
> 192.168.40.0/24 dev eth2  proto kernel  scope link  src 192.168.40.102
> #  ifconfig
> Tue Oct  1 23:14:42 PDT 2013
> br0       Link encap:Ethernet  HWaddr 60:a4:4c:21:bc:9f
>           inet addr:192.168.40.103  Bcast:192.168.40.255
> Mask:255.255.255.0
>           inet6 addr: fe80::62a4:4cff:fe21:bc9f/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:896 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:434 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:100681 (98.3 KiB)  TX bytes:49358 (48.2 KiB)
>
> eth1      Link encap:Ethernet  HWaddr 60:a4:4c:21:bc:9f
>           UP BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>           Interrupt:17 Memory:f0600000-f0620000
>
> eth2      Link encap:Ethernet  HWaddr 60:a4:4c:21:bc:a0
>           inet addr:192.168.40.102  Bcast:192.168.40.255
> Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:990 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:604 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:145073 (141.6 KiB)  TX bytes:76668 (74.8 KiB)
>           Interrupt:18 Memory:f0500000-f0520000
>
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:323 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:323 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:92559 (90.3 KiB)  TX bytes:92559 (90.3 KiB)
>
> tap0      Link encap:Ethernet  HWaddr ce:45:fc:e6:32:46
>           UP BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:500
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>
> which looked OK to me; that is, ip route seems to show external packets
> should go to eth2, which is the external interface, via the .10 address
> of the router. But
> # ping 198.144.192.2
> PING 198.144.192.2 (198.144.192.2) 56(84) bytes of data.
> >From 192.168.40.102 icmp_seq=1 Destination Host Unreachable
>
> One difference between the ifconfig above and what I saw before
> rebooting was that before rebooting eth2 had no IP (which seemed odd).
>
> ifdown br0 also brought eth2 down. I added iface eth2 inet dhcp
> to /etc/network/interface and did ifup eth2; now I can reach the world
> and see
> # ip route
> default via 192.168.40.10 dev eth2  proto static
> 192.168.40.0/24 dev eth2  proto kernel  scope link  src 192.168.40.102


Reply to: