accessing a KVM guest from outside the host
I have two machines, a laptop on 192.168.1.82 and a desktop which is the host for KVM setup on 192.168.1.98. There is 1 guest running which is a centos minimal addressed at 192.168.122.100. All OS's are centos here.
I'm trying to ssh from the laptop (which has no connection to the host whatsoever besides being on the same subnet) to the KVM guest at 192.168.122.100. There already is a default bridge created on the host machine of course. Its called virbr0 and the subnet is 192.168.122.0
I tried to ssh into the guest from the laptop and fail
[03:10 PM][root@ibm network-scripts]# ssh root@192.168.122.100
ssh: connect to host 192.168.122.100 port 22: No route to host
I tried to create a bridge on the laptop machine. Here are the 2 files in /etc/sysconfig/network-scripts that I have edited to reflect that. I did name this bridge br0 instead of virbr0 because I dont think it really matters
this is ifcfg-br0
DEVICE=br0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Bridge
And ifcfg-eth0
DEVICE=eth0
IPADDR=192.168.1.82
NETMASK=255.255.255.0
GATEWAY=192.168.1.254
ONBOOT=yes
NM_CONTROLLED=no
DNS1=192.168.1.254
BRIDGE=br0
This is the output after restarting the network
[05:15 PM][root@ibm network-scripts]# service network restart
Shutting down interface br0: [ OK ]
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface br0:
Determining IP information for br0... done.
[ OK ]
[05:18 PM][root@ibm network-scripts]# ssh root@192.168.122.100
ssh: connect to host 192.168.122.100 port 22: No route to host
Am I supposed to setup masquerading and ip forwarding on the host machine to allow the network to traverse outside the host? I guess I just want to understand HOW I am supposed to get in from outside the host. Thanks.
Last edited by rootaccess; 04-27-2013 at 07:23 PM.
|