|
参考的文章是http://en.gentoo-wiki.com/wiki/KVM
本人英文不好,看的真吃力,尤其是网络那块看的一沓糊涂,情赐教啊:
[edit] Enabling the access to Internet
The most transparent option to allow your guests access to the internet is the "virtual hub". In this scheme, the bridge connects eth0 and your tuntap interfaces together, routing packets as if it were a real "old fashioned" hub (not a switch). The key to this approach is to make sure you have unique mac addresses on both the host's tuntap interface as well as the guest. The guest ip addresses are typically in the same subnet as the host, and they can ask for and receive a dhcp lease from the same dhcp server that the host might use if it used dhcp. That is because all arp traffic and other broadcasts are passed through the bridge between the eth0 interface and the guest taps. The guests can use the same default gateway as the host because of this transparent passage.
The following snippet from an /etc/conf.d/net file shows the setup of a bridge between eth0 and two tap devices for guests. Note that the dependency for eth0 is left out of the br0 config since it is always started earlier on this particular system
1、上面这段话tuntap interfaces是什么东西啊,是属于客户机上的吗?
2、The key to this approach is to make sure you have unique mac addresses on both the host's tuntap interface as well as the guest
这句话是什么意思啊,是说主机的tuntap接口和客户机的tuntap接口拥有唯一的MAC地址,怎么个唯一法啊。
3、Note that their nic definitions on the kvm command line use different mac addresses than what is set for their taps. If the same mac address had been used on both sides, the arp queries for address resolution would not work. This conf.d/net setup is also why the kvm command line says not to do anything about interface startup or takedown.这句话是什么意思,谁给翻译一下啊
4、The changes in /etc/sysctl.conf are to prevent the traffic from the guests to be sent to iptables to be filtered。If you want to filter the traffic from/to the guests, you can keep the file unchanged but you will have to add the correct rules to iptables. The addition needed in /etc/sysctl.conf is ... 这句话也没看懂啊
最后还是想问问这里的网络连接是不是就是桥接,固定i难到没别的连接网络的方法了吗,我记得安装virtualbox的时候发现安装好操作系统可以直接上网了,这个咋这么费事呢
还有下面这个配置文件时针对固定ip地址的:
File: /etc/conf.d/net
bridge_br0="eth0 tap0 tap1"
brctl_br0=( "setfd 0" "sethello 0" "stp off" )
RC_NEED_br0="net.tap0 net.tap1"
#
# host system is a static address at 192.168.1.12 with dns server at 34 and a router at 33
#
config_br0=( "192.168.1.12/24" )
routes_br0=( "default via 192.168.1.33" )
dns_domain_br0="example.com"
dns_servers_br0="192.168.1.34"
dns_search_br0="example.com"
config_tap0=( "null" )
tuntap_tap0="tap"
tunctl_tap0="-u joeuser"
mac_tap0="52:54:00:12:34:56"
config_tap1=( "null" )
tuntap_tap1="tap"
tunctl_tap1="-u joeuser"
mac_tap1="52:54:00:12:34:59"
config_eth0=( "null" )
要是ip地址不固定该怎样设置呢 |
|