qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Assigning Real Network IP Address to Guest OS
@ 2008-06-24 11:12 Volkan YAZICI
  2008-06-24 11:24 ` Laurent Vivier
  0 siblings, 1 reply; 3+ messages in thread
From: Volkan YAZICI @ 2008-06-24 11:12 UTC (permalink / raw)
  To: qemu-devel

Hi,

Finally I managed to install Windows Server 2003 on a Debian
GNU/Linux. Just with below configurations, network works without a touch
in the guest OS.

  host> cat /etc/network/interfaces
  # The loopback network interface
  auto lo
  iface lo inet loopback
  
  # The bridge network interface(s)
  auto br0
  iface br0 inet static
          address 192.168.1.10
          network 192.168.1.0
          netmask 255.255.255.0
          broadcast 192.168.1.255
          gateway 192.168.1.1
          bridge_ports eth0
          bridge_fd 9
          bridge_hello 2
          bridge_maxage 12
          bridge_stp off

  host>
  br0       Link encap:Ethernet  HWaddr 00:1A:64:C1:94:3C
            inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
            inet6 addr: fe80::21a:64ff:fec1:943c/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:1376286 errors:0 dropped:0 overruns:0 frame:0
            TX packets:689106 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes:83136118 (79.2 MiB)  TX bytes:864192345 (824.1 MiB)
  
  eth0      Link encap:Ethernet  HWaddr 00:1A:64:C1:94:3C
            inet6 addr: fe80::21a:64ff:fec1:943c/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:1686146 errors:0 dropped:0 overruns:0 frame:0
            TX packets:1074092 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:169127408 (161.2 MiB)  TX bytes:890492221 (849.2 MiB)
            Interrupt:106 Memory:ce000000-ce011100
  
  eth1      Link encap:Ethernet  HWaddr 00:1A:64:C1:94:3E
            BROADCAST MULTICAST  MTU:1500  Metric:1
            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
            Interrupt:169 Memory:ca000000-ca011100

  guest> ipconfig
  ...
  Connection-specific DNS Suffix . :
  IP Address ..................... : 10.0.2.15
  Subnet Mask .................... : 255.255.255.0
  Default Gateway ................ : 10.0.2.2
  ...

I can make any sort of network operation on the guest OS. But what I
really want to do is to assign a static IP to the guest OS in the
192.168.1.0/24 network, to be able to access to guest OS through
machines in the same network. For this purpose, what kind of
configuration should I follow? I such an adjustment possible via
brdiging configuration? If not, I have a second NIC in the host OS
(eth1), can I use that interface for that?

I couldn't find any solutions on the qemu wiki and google. Any kind of
help will be appreciated. (Documentation pointers are welcome as well.)


Regards.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Assigning Real Network IP Address to Guest OS
  2008-06-24 11:12 [Qemu-devel] Assigning Real Network IP Address to Guest OS Volkan YAZICI
@ 2008-06-24 11:24 ` Laurent Vivier
  2008-06-24 12:07   ` [Qemu-devel] " Volkan YAZICI
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2008-06-24 11:24 UTC (permalink / raw)
  To: qemu-devel

Le mardi 24 juin 2008 à 14:12 +0300, Volkan YAZICI a écrit :
> Hi,
> 
> Finally I managed to install Windows Server 2003 on a Debian
> GNU/Linux. Just with below configurations, network works without a touch
> in the guest OS.
> 
>   host> cat /etc/network/interfaces
>   # The loopback network interface
>   auto lo
>   iface lo inet loopback
>   
>   # The bridge network interface(s)
>   auto br0
>   iface br0 inet static
>           address 192.168.1.10
>           network 192.168.1.0
>           netmask 255.255.255.0
>           broadcast 192.168.1.255
>           gateway 192.168.1.1
>           bridge_ports eth0
>           bridge_fd 9
>           bridge_hello 2
>           bridge_maxage 12
>           bridge_stp off
> 
>   host>
>   br0       Link encap:Ethernet  HWaddr 00:1A:64:C1:94:3C
>             inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
>             inet6 addr: fe80::21a:64ff:fec1:943c/64 Scope:Link
>             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>             RX packets:1376286 errors:0 dropped:0 overruns:0 frame:0
>             TX packets:689106 errors:0 dropped:0 overruns:0 carrier:0
>             collisions:0 txqueuelen:0
>             RX bytes:83136118 (79.2 MiB)  TX bytes:864192345 (824.1 MiB)
>   
>   eth0      Link encap:Ethernet  HWaddr 00:1A:64:C1:94:3C
>             inet6 addr: fe80::21a:64ff:fec1:943c/64 Scope:Link
>             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>             RX packets:1686146 errors:0 dropped:0 overruns:0 frame:0
>             TX packets:1074092 errors:0 dropped:0 overruns:0 carrier:0
>             collisions:0 txqueuelen:1000
>             RX bytes:169127408 (161.2 MiB)  TX bytes:890492221 (849.2 MiB)
>             Interrupt:106 Memory:ce000000-ce011100
>   
>   eth1      Link encap:Ethernet  HWaddr 00:1A:64:C1:94:3E
>             BROADCAST MULTICAST  MTU:1500  Metric:1
>             RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>             collisions:0 txqueuelen:1000
>             RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
>             Interrupt:169 Memory:ca000000-ca011100
> 
>   guest> ipconfig
>   ...
>   Connection-specific DNS Suffix . :
>   IP Address ..................... : 10.0.2.15
>   Subnet Mask .................... : 255.255.255.0
>   Default Gateway ................ : 10.0.2.2
>   ...
> 
> I can make any sort of network operation on the guest OS. But what I
> really want to do is to assign a static IP to the guest OS in the
> 192.168.1.0/24 network, to be able to access to guest OS through
> machines in the same network. For this purpose, what kind of
> configuration should I follow? I such an adjustment possible via
> brdiging configuration? If not, I have a second NIC in the host OS
> (eth1), can I use that interface for that?
> 

I use this kind of configuration on a debian etch (host) with winxp
(guest).

on your host, you must have an /etc/qemu-ifup like this:

#!/bin/sh
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
sudo /usr/sbin/brctl addif br0 $1

And in your guest configure it using a valid IP address for your host
network (I use DHCP), something like 192.168.1.11. You must also
configure guest route to use real gateway.

then remember to start qemu with "-net nic -net tap".

> I couldn't find any solutions on the qemu wiki and google. Any kind of
> help will be appreciated. (Documentation pointers are welcome as well.)

Regards,
Laurent
-- 
------------- Laurent.Vivier@bull.net ---------------
"The best way to predict the future is to invent it."
- Alan Kay

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: Assigning Real Network IP Address to Guest OS
  2008-06-24 11:24 ` Laurent Vivier
@ 2008-06-24 12:07   ` Volkan YAZICI
  0 siblings, 0 replies; 3+ messages in thread
From: Volkan YAZICI @ 2008-06-24 12:07 UTC (permalink / raw)
  To: qemu-devel

On Tue, 24 Jun 2008, Laurent Vivier <Laurent.Vivier@bull.net> writes:
> I use this kind of configuration on a debian etch (host) with winxp
> (guest).
>
> on your host, you must have an /etc/qemu-ifup like this:
>
> #!/bin/sh
> sudo /sbin/ifconfig $1 0.0.0.0 promisc up
> sudo /usr/sbin/brctl addif br0 $1
>
> And in your guest configure it using a valid IP address for your host
> network (I use DHCP), something like 192.168.1.11. You must also
> configure guest route to use real gateway.
>
> then remember to start qemu with "-net nic -net tap".

Worked like a charm! Thanks so much for the prompt reply!


Regards.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-24 12:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-24 11:12 [Qemu-devel] Assigning Real Network IP Address to Guest OS Volkan YAZICI
2008-06-24 11:24 ` Laurent Vivier
2008-06-24 12:07   ` [Qemu-devel] " Volkan YAZICI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).