<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>互联网，请记住我 &#187; virtualBox</title>
	<atom:link href="http://www.162cm.com/archives/category/virtualbox/feed" rel="self" type="application/rss+xml" />
	<link>http://www.162cm.com</link>
	<description>一米六二，绝不转载</description>
	<lastBuildDate>Fri, 03 Sep 2010 15:30:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>qemu:一个win/linux/bsd/mac下的虚拟机软件(二):qemu的几种上网方式</title>
		<link>http://www.162cm.com/archives/482.html</link>
		<comments>http://www.162cm.com/archives/482.html#comments</comments>
		<pubDate>Fri, 21 Sep 2007 15:38:47 +0000</pubDate>
		<dc:creator>一米六二</dc:creator>
				<category><![CDATA[qemu]]></category>
		<category><![CDATA[virtualBox]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.162cm.com/archives/482.html</guid>
		<description><![CDATA[上一文章大致地介绍了qemu.这篇写网络设置。 qemu虚拟机中客户机的上网方式有两种： User-net:qemu 默认的上网方式是user-net.这种情况下你会看到Geust OS 中有一个网卡，通过DHCP方式得到了一个10.2.0.15的IP，通过真实主机访问互联网，但是虚拟机(Guest OS)与客户机的访问很难。因此这种方式我不喜欢。但是这个简单,装上系统就是了，不需配置，而虚拟机也能容易地上互联网。 另一种是Tap/tun模式。需要配置. a.首先要启用Tap设备。modprobe tun即可。如果内核中没有对tap的支持，要重新编译内核。我用的是fedora,用yum安装一下就行了. b.设置qemu使用tap设备时主机添加的tap设备的IP.建这样一个脚本(/etc/qemu-ifup)，加上可执行权限即可(chmod +x /etc/qemu-ifup)。 #! /bin/sh /sbin/ifconfig $1 172.20.0.1 有了这个脚本后，当你用-net tap 参数启动qemu时，主机中就会多一个ip为172.20.0.1的tap设备。 c.启动qemu: qemu -hda linux1.img -boot c -net tap -net nic,model=rtl8139 进入虚拟机系统后，将网卡IP设为172.20.0.100，掩码设为255.255.255.0,网关设置为172.20.0.1(就是你在/etc/qemu-ifup中设的IP)。现在虚拟机与主机间通信已经可以了，但是还需要第四步让虚拟机连上互联网。 d.在iptables中进行设置，以让虚拟机访问互联网: 分别执行: [root@LFS ~]#echo 1 &#62; /proc/sys/net/ipv4/ip_forward [root@LFS &#8230; <a href="http://www.162cm.com/archives/482.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.162cm.com/archives/482.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.372 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-08 14:21:47 -->
