PDA

View Full Version : Bridged KVM Difficulties



alphadogg
30th November 2008, 08:01 PM
Okay, so I am not sure how to setup Virtual Machine Manager to run a VM such that it isn't on its own private network, but rather is visible on my home private network.

So far, along with what I've read here (http://www.linux-kvm.com/content/using-bridged-networking-virt-manager#comment-276), here (http://home.nyc.rr.com/computertaijutsu/vboxbridge.html) and here (http://kvm.qumranet.com/kvmwiki/Networking), I do the following. First, NetworkManager is disabled.



IF="eth1"
NET="192.168.1"
HOST="202"
BR="br0"

brctl addbr $BR
ifconfig $IF 0.0.0.0
brctl addif $BR $IF
ifconfig $BR $NET.$HOST netmask 255.255.255.0 up
route add -net $NET.0 netmask 255.255.255.0 $BR
route add default gw $NET.1 $BR


I put this as a script in /etc/sysconfig/network-scripts/ifcfg-br0.

File /etc/sysconfig/network-scripts/ifconfig-eth1 was edited to IPADDR=0.0.0.0.

iptables was updated with:


iptables -I INPUT -i br0 -j ACCEPT
service iptables save


and, sysctl.conf was changed to:


net.ipv4.ip_forward = 1


I end up, after reboot, with:


br0 Link encap:Ethernet HWaddr 00:15:17:7E:F9:82
inet addr:192.168.1.202 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::215:17ff:fe7e:f982/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12349 errors:0 dropped:0 overruns:0 frame:0
TX packets:9323 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:555068 (542.0 KiB) TX bytes:28781719 (27.4 MiB)

eth0 Link encap:Ethernet HWaddr 00:1E:90:FB:B4:E4
inet addr:192.168.1.201 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21e:90ff:fefb:b4e4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:37 errors:0 dropped:0 overruns:0 carrier:2
collisions:0 txqueuelen:1000
RX bytes:1610 (1.5 KiB) TX bytes:5644 (5.5 KiB)
Interrupt:16

eth1 Link encap:Ethernet HWaddr 00:15:17:7E:F9:82
inet6 addr: fe80::215:17ff:fe7e:f982/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:12354 errors:0 dropped:0 overruns:0 frame:0
TX packets:25791 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:753664 (736.0 KiB) TX bytes:29736903 (28.3 MiB)
Memory:feae0000-feb00000

eth2 Link encap:Ethernet HWaddr 00:15:17:7E:F9:81
inet addr:192.168.1.203 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::215:17ff:fe7e:f981/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9890 (9.6 KiB) TX bytes:5202 (5.0 KiB)
Memory:febe0000-fec00000

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:22 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1470 (1.4 KiB) TX bytes:1470 (1.4 KiB)

virbr0 Link encap:Ethernet HWaddr 82:8F:EA:5A:AA:FA
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::808f:eaff:fe5a:aafa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:5113 (4.9 KiB)


So, I then fire up VMM, setup an F10 image with a shared physical device on eth1 (Bridge br0). Set a fixed MAC address, using easymac.sh -g. (Set to 1e:ed:72:af:1e:65 for this particular VM.)

Install F10 from DVD with a handful of packages removed for slimmer install.

Once in the VM, I disable NetworkManager there too. Device eth0 is setup with a static IP of 192.168.1.220. Network is unrecheable. Set to pivk up an IP via DHCP results in no IP.

Any ideas how to start diagnosing this? Help.