LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-18-2010, 01:43 PM   #1
DD554
Member
 
Registered: May 2010
Location: Rome, Italy
Distribution: fedora, centos, debian.
Posts: 34

Rep: Reputation: 0
nat and QEMU guests


Hi all.

I have QEMU with 2 virtual os running in, on virtual network 192.168.122.0/24. today i installed on it a win 2k3 server and a centos as web servers. well, except from the computer that hosts QEMU, there is no way to access apache or IIS of the guests from internet or LAN (192.168.1.0/24)
what nat rules are supposed to add, cause virtd manager applies only rules to make guests work as clients only.

thanks in advance
 
Old 12-18-2010, 03:32 PM   #2
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Can you send here the output of:
ifconfig -a
executed on host, when QEMU works with virtual os.

And also:
route -n
executed on host

Please, before post outputs here remove all private IPs.


Thanks
 
Old 12-18-2010, 04:20 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Isn't the default qemu something like 10.0.2.15?
 
Old 12-18-2010, 04:52 PM   #4
DD554
Member
 
Registered: May 2010
Location: Rome, Italy
Distribution: fedora, centos, debian.
Posts: 34

Original Poster
Rep: Reputation: 0
remove private IP addresses from output?? if i launch ifconfig and route it means i wanna see IPs, how can i remove from output? so sorry, i'll copy as it is. it's no confusing and it's not a security issue. it's just a local network.
192.168.1.19 is the host, 192.168.122.0/24 is for the guests

[root@poc ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1F0:9D:3A:9C
inet addr:192.168.1.19 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21f:d0ff:fe9d:3a9c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:472465 errors:0 dropped:0 overruns:0 frame:0
TX packets:277007 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:622992186 (594.1 MiB) TX bytes:25487405 (24.3 MiB)
Interrupt:44 Base address:0x6000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:26723 errors:0 dropped:0 overruns:0 frame:0
TX packets:26723 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24917867 (23.7 MiB) TX bytes:24917867 (23.7 MiB)

virbr0 Link encap:Ethernet HWaddr FE:54:00:C4:6B:99
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:81777 errors:0 dropped:0 overruns:0 frame:0
TX packets:111450 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9744596 (9.2 MiB) TX bytes:78110758 (74.4 MiB)

vnet0 Link encap:Ethernet HWaddr FE:54:00:C4:6B:99
inet6 addr: fe80::fc54:ff:fec4:6b99/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:66149 errors:0 dropped:0 overruns:0 frame:0
TX packets:86474 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:9808226 (9.3 MiB) TX bytes:38418031 (36.6 MiB)

[root@poc ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
 
Old 12-19-2010, 04:45 AM   #5
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
You have two interfaces:
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0

I do not understand what vnet0 is and what is it made for, but I think you can ignore it.

All packets can be addressed to your eth0, and if you want them to go to virbr0 you need to:
Enable forward in sysctl
Accept forward in iptables
Redirect some ports from eth0 to virbr0 with iptable in "prerouting/dnat" chain.

That is what I think, if anyone else here suggest a different solution you will have a choice.


Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
KVM / QEMU and NAT on the host machine (mini-tutorial) heby Linux - Networking 5 05-16-2012 10:17 AM
Error while installing qemu (qemu-kvm-0.13.0) in rhel 5.3 birla.sunil Linux - Virtualization and Cloud 2 10-19-2010 03:56 AM
On qemu-kvm, qemu-ifup script not found on Slackware 13 AndrewGaven Linux - Virtualization and Cloud 14 01-29-2010 03:36 AM
After qemu-img, qemu is not capable to detect the C drive (empty) frenchn00b Linux - General 3 10-18-2009 05:39 AM
qemu: qemu stopped right after command exec bitpicker Linux - Software 1 03-04-2005 11:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration