{"id":3,"date":"2007-07-19T23:33:00","date_gmt":"2007-07-19T23:33:00","guid":{"rendered":"http:\/\/tech.moosaico.com\/blog\/?p=3"},"modified":"2014-03-01T14:35:59","modified_gmt":"2014-03-01T14:35:59","slug":"qemu-over-a-bridge-in-ubuntu-linux","status":"publish","type":"post","link":"https:\/\/thejoyofstick.com\/blog\/2007\/07\/19\/qemu-over-a-bridge-in-ubuntu-linux\/","title":{"rendered":"QEmu over a bridge in Ubuntu Linux"},"content":{"rendered":"<p>Being a linux user, I use QEmu to save me with those windows applications that I must use on the corporation environment. It all went well until I installed a windows tool that needed icmp to work. As you know, the basic and simple network setup of QEmu just support tcp and udp.<\/p>\n<p>To have enough freedom I wanted to have my QEmu &#8220;machine&#8221; with a unique ip address as my notebook do. I pretend to simulate having two different systems over my subnet.<\/p>\n<p>Let&#8217;s configure my Linux Ubuntu 7.04 Feisty to run this environment.<\/p>\n<p>Let&#8217;s use a bridge instead of <span style=\"font-family: courier new\">eth0<\/span> to have two different interfaces.<br \/>\nEdit your <span style=\"font-family: courier new\">\/etc\/network\/interfaces<\/span> to look like this<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nauto lo\r\niface lo inet loopback\r\n\r\nauto br0\r\niface br0 inet static\r\n\u00a0 address 10.0.0.17\r\n\u00a0 netmask 255.255.255.240\r\n\u00a0 gateway 10.0.0.30\r\n\u00a0 bridge-ports eth0\r\n<\/pre>\n<p>We add <span style=\"font-family: courier new\">eth0<\/span> to the bridge group <span style=\"font-family: courier new\">br0<\/span> and configure the allocated ip address to my linux notebook.<\/p>\n<p>QEmu must be launched adding the options &#8220;<span style=\"font-family: monospace\">-net nic -net tap<\/span>&#8221; so it uses the tap device. You must &#8220;<span style=\"font-family: monospace\">sudo<\/span>&#8221; qemu so it can use the device &#8211; or configure it so it&#8217;s accessible from user mode. I don&#8217;t spend time with that and always use &#8220;sudo&#8221; &#8211; it&#8217;s just <span style=\"font-style: italic\">my<\/span> machine.<br \/>\nEdit the interface script <span style=\"font-family: courier new\">\/etc\/qemu-ifup<\/span> to add it to <span style=\"font-family: courier new\">br0<\/span>.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n#!\/bin\/bash\r\necho \"Running \/etc\/qemu-ifup\"\r\necho \"...Bringing up $1 for bridged mode\"\r\nsudo \/sbin\/ifconfig $1 0.0.0.0 promisc up\r\necho \"...Adding $1 to br0\"\r\nsudo \/usr\/sbin\/brctl addif br0 $1\r\n<\/pre>\n<p>After having my windows running I configured its network ethernet device:<\/p>\n<p>ip address: 10.0.0.18<br \/>\nnetmask:    255.255.255.240<br \/>\ngateway:    10.0.0.30<\/p>\n<p>The name server caches were configured too.<\/p>\n<p><span style=\"font-style: italic\">Et voil\u00e1<\/span>, you have two operating systems on two <span style=\"font-style: italic\">different<\/span> machines<br \/>\nusing each own ip address and completely exposed to your network.<\/p>\n<blockquote><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Being a linux user, I use QEmu to save me with those windows applications that I must use on the corporation environment. It all went well until I installed a windows tool that needed icmp to work. As you know,&hellip; <a href=\"https:\/\/thejoyofstick.com\/blog\/2007\/07\/19\/qemu-over-a-bridge-in-ubuntu-linux\/\" class=\"more-link\">Continue Reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,4],"tags":[],"class_list":["post-3","post","type-post","status-publish","format-standard","hentry","category-emulator","category-ubuntu"],"jetpack_shortlink":"https:\/\/wp.me\/pcmwlL-3","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts\/3","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/comments?post=3"}],"version-history":[{"count":3,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts\/3\/revisions"}],"predecessor-version":[{"id":613,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts\/3\/revisions\/613"}],"wp:attachment":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/media?parent=3"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/categories?post=3"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/tags?post=3"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}