<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linux-kvm.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Setiawan</id>
	<title>KVM - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://linux-kvm.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Setiawan"/>
	<link rel="alternate" type="text/html" href="https://linux-kvm.org/page/Special:Contributions/Setiawan"/>
	<updated>2026-04-29T22:19:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://linux-kvm.org/index.php?title=UbuntuNetworking&amp;diff=4623</id>
		<title>UbuntuNetworking</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=UbuntuNetworking&amp;diff=4623"/>
		<updated>2013-01-23T06:52:22Z</updated>

		<summary type="html">&lt;p&gt;Setiawan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Setting up NAT with KVM in Ubuntu =&lt;br /&gt;
&lt;br /&gt;
Normally, the best way to do guest networking is by setting up a bridge.  However, if you use a wireless card, are frequently switching network interfaces or using VPN, or for other reason want to do NAT, then this outlines the easiest way to set it up with Ubuntu.  The setup here is very similar to what [http://www.libvirt.org libvirt] uses for QEMU networking.                                                        &lt;br /&gt;
&lt;br /&gt;
== Install Dependencies ==&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install bridge-utils dnsmasq&lt;br /&gt;
&lt;br /&gt;
== Check Kernel Modules ==&lt;br /&gt;
&lt;br /&gt;
Make sure that all of the following modules are around: either built in to the kernel or loadable.  If you are running a plain distribution kernel, you should have all of these around without doing anything extra.&lt;br /&gt;
&lt;br /&gt;
 # lsmod&lt;br /&gt;
 Module                  Size  Used by&lt;br /&gt;
 tun                    15616  0      &lt;br /&gt;
 bridge                 64104  0      &lt;br /&gt;
 llc                    11504  1 bridge&lt;br /&gt;
 xt_state                5248  1       &lt;br /&gt;
 ipt_MASQUERADE          6720  1       &lt;br /&gt;
 iptable_nat            10512  1       &lt;br /&gt;
 nf_nat                 24344  2 ipt_MASQUERADE,iptable_nat&lt;br /&gt;
 nf_conntrack_ipv4      21776  3 iptable_nat               &lt;br /&gt;
 nf_conntrack           76688  5 xt_state,ipt_MASQUERADE,iptable_nat,nf_nat,nf_conntrack_ipv4&lt;br /&gt;
&lt;br /&gt;
== Enabling ip forwarding ==&lt;br /&gt;
&lt;br /&gt;
Add the following line to the bottom of &amp;lt;code&amp;gt;/etc/sysctl.conf&lt;br /&gt;
 net.ipv4.ip_forward=1&lt;br /&gt;
&lt;br /&gt;
== Configuring a bridge ==&lt;br /&gt;
&lt;br /&gt;
Add the following to the bottom of &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 auto br0&lt;br /&gt;
 iface br0 inet static&lt;br /&gt;
 address 10.0.1.1&lt;br /&gt;
 netmask 255.255.255.0&lt;br /&gt;
 network 10.0.1.0&lt;br /&gt;
 bridge_stp off&lt;br /&gt;
 bridge_maxwait 5&lt;br /&gt;
 bridge_ports none&lt;br /&gt;
 pre-up iptables-restore &amp;lt; /etc/iptables.up.rules&lt;br /&gt;
&lt;br /&gt;
== Installing config files ==&lt;br /&gt;
&lt;br /&gt;
# Copy [[Media:dnsmasq.conf|dnsmasq.conf]] to &amp;lt;code&amp;gt;/etc/dnsmasq.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
# Copy [[Media:iptables.up.rules|iptables.up.rules]] to &amp;lt;code&amp;gt;/etc/iptables.up.rules&amp;lt;/code&amp;gt;&lt;br /&gt;
# Copy [[Media:qemu-ifup|qemu-ifup]] to &amp;lt;code&amp;gt;/etc/qemu-ifup&amp;lt;/code&amp;gt; and change permissions to &amp;lt;code&amp;gt;755&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Setiawan</name></author>
	</entry>
</feed>