怎樣 ssh to kvm host

請教一下,我在ssh 到一部centos7 的server上setup 了KVM, 但setup 完bridge,restart network 就 connect 唔番Host?  是否不能 ssh 到 host 上做KVM setting?,即係一定要插monitor 在主機上做settings?  還是有其他方法?  請指教,謝!

睇唔明, 你個 setup 係,
1. centos host, kvm client
2. kvm client can ssh to centos host ?
3. restart network of kvm client.
4. 咁就 kvm client ping 唔到 centos 個 host ?
一話 centos host network 死咗 ?

TOP

我從一部機 ssh 去另一部機上,該部機上是行centos 7 的。
我跟網上的教學如http://jensd.be/207/linux/instal ... virtualization-host
我install KVM packages 後 set  network /etc/sysconfig/network-scripts/ifcfg-enoxxxx and /etc/sysconfig/network-scripts/ifcfg-br0 等等。
之後restart network 後就繼了 ssh connection.  之後也不能再 ssh 到這部機。

TOP

  1. DEVICE="virbr0"
  2. TYPE=BRIDGE
  3. ONBOOT=yes
  4. BOOTPROTO=static
  5. IPADDR="192.168.202.111"
  6. NETMASK="255.255.255.0"
  7. GATEWAY="192.168.202.2"
  8. DNS1="192.168.202.2"
複製代碼
try to connect to centos host by add 192.168.202.111

TOP

就是connect 不到...
所以我想知道其實可以用ssh remotely 去host 做 setup 的嗎?
還是必要插mon 插keyboard 在host 上 create VMs?

TOP

估計應該係
/etc/sysconfig/network-scripts/ifcfg-br0 錯咗,
ifcfg-virbr0
不過, 經唔經 ssh 問題不大, 而家死咗個 net, 點都要搞返掂先得
而家响街, 返到屋企, 再吹過

TOP

op 嘅 guide, 試吓呢個
http://xmodulo.com/install-configure-kvm-centos.html

通常只要有一個 br0 就夠用,
其它嘅嘢 libvirtd, virt-manager 會同你整
  1. my router is 192.168.0.xxx
  2. my local host ip 192.168.0.123
  3. nat network by libvirtd is 192.168.100.xxx
複製代碼
  1. # ifconfig of my host just after boot
  2. br0: bridge to eth0 and with static ip to router
  3.         inet 192.168.0.123  netmask 255.255.255.0  broadcast 192.168.0.255
  4.         inet6 fe80::490:c1ff:fe54:c4c2  prefixlen 64  scopeid 0x20<link>
  5.         ether xx:xx:xx:xx:xx:xx  txqueuelen 5000  (Ethernet)

  6. eth0: host physical lan
  7.         inet6 fe80::9a4b:e1ff:fe9f:4e6d  prefixlen 64  scopeid 0x20<link>
  8.         ether xx:xx:xx:xx:xx:xx  txqueuelen 1000  (Ethernet)
複製代碼
  1. # ifconfig of host afher libvirtd start
  2. br0: bridge to eth0 and with static ip to router
  3.         inet 192.168.0.123  netmask 255.255.255.0  broadcast 192.168.0.255
  4.         inet6 fe80::490:c1ff:fe54:c4c2  prefixlen 64  scopeid 0x20<link>
  5.         ether xx:xx:xx:xx:xx:xx  txqueuelen 5000  (Ethernet)

  6. eth0: host physical lan
  7.         inet6 fe80::9a4b:e1ff:fe9f:4e6d  prefixlen 64  scopeid 0x20<link>
  8.         ether xx:xx:xx:xx:xx:xx  txqueuelen 1000  (Ethernet)

  9. virbr1: new virtual nat interface created by libvirtd
  10.         inet 192.168.100.1  netmask 255.255.255.0  broadcast 192.168.100.255
  11.         ether 52:54:00:2e:3a:87  txqueuelen 0  (Ethernet)
複製代碼
  1. # ifconfig of vm 2 lan cards. 1 nat, 1 bridge to br0
  2. eth0: vm m/c nat1 assigned by dnsmasq bring up by libvartd
  3.         inet 192.168.100.244  netmask 255.255.255.0  broadcast 192.168.100.255
  4.         inet6 fe80::5054:ff:fed3:a408  prefixlen 64  scopeid 0x20<link>
  5.         ether 52:54:00:d3:a4:08  txqueuelen 1000  (Ethernet)

  6. eth1: bridge to br0 connected to router
  7.         inet 192.168.0.102  netmask 255.255.255.0  broadcast 192.168.0.255
  8.         inet6 fe80::5054:ff:fe7e:28ee  prefixlen 64  scopeid 0x20<link>
  9.         ether 52:54:00:7e:28:ee  txqueuelen 1000  (Ethernet)
複製代碼
  1. # ifconfig of host after vm running
  2. br0: bridge to eth0 and with static ip to router
  3.         inet 192.168.0.123  netmask 255.255.255.0  broadcast 192.168.0.255
  4.         inet6 fe80::490:c1ff:fe54:c4c2  prefixlen 64  scopeid 0x20<link>
  5.         ether xx:xx:xx:xx:xx:xx  txqueuelen 5000  (Ethernet)

  6. eth0: host physical lan
  7.         inet6 fe80::9a4b:e1ff:fe9f:4e6d  prefixlen 64  scopeid 0x20<link>
  8.         ether xx:xx:xx:xx:xx:xx  txqueuelen 1000  (Ethernet)
  9.         
  10. virbr1: new virtual nat interface created by libvirtd
  11.         inet 192.168.100.1  netmask 255.255.255.0  broadcast 192.168.100.255
  12.         ether 52:54:00:2e:3a:87  txqueuelen 0  (Ethernet)

  13. vnet0: host virt nat created by libvartd
  14.         inet6 fe80::fc54:ff:fed3:a408  prefixlen 64  scopeid 0x20<link>
  15.         ether fe:54:00:d3:a4:08  txqueuelen 500  (Ethernet)

  16. vnet1: host virt nat created by libvartd
  17.         inet6 fe80::fc54:ff:fe7e:28ee  prefixlen 64  scopeid 0x20<link>
  18.         ether fe:54:00:7e:28:ee  txqueuelen 500  (Ethernet)
複製代碼
當然响 local host 度 with Xorg,  setup 會容易啲,
起咗個 vm 先搞 remote setup 都唔遲

TOP