LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 04-16-2013, 09:29 AM   #1
sanaz
Member
 
Registered: Aug 2012
Posts: 76

Rep: Reputation: Disabled
guest public IP address


Hi all,

I am trying to get a public ip address to VM(I am using kvm). In the host I have everyhting I nedd(I think)
Code:
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 128.197.11.108  netmask 255.255.255.0  broadcast 128.197.11.255
        inet6 fe80::230:48ff:fefe:ceb0  prefixlen 64  scopeid 0x20<link>
        ether 00:30:48:fe:ce:b0  txqueuelen 0  (Ethernet)

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

p13p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

tap0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500


virbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
 

vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
      

vnet1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
       
vnet2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
Guest VM has an ip adress(192.168.100.144) which is only accessible from host. Now I am wondering what shoul dI do to get a public ip to guest VM which is accessible from everywhere.
This is what I have inside guest VM
Code:
ifconfig
eth 0     Link encap:Ethernet HWaddr 52:54:00:F5::5D:D1
          inet6 addr: fe80::5054:ff:fef5:5dd1/65 scope:Link
.....................

eth1      Link encap:Ethernet HWaddr 52:54:00:F5::5D:D2
          inet addr: 192.168.100.144 Bcast...
lo:  .........
Sould I assign static ip to guest vm or configure bridge in host to translate IPx to 192.168.100.144?

Any help is highly appreciated
 
Old 04-17-2013, 06:19 AM   #2
eggshell
LQ Newbie
 
Registered: Jan 2012
Posts: 11

Rep: Reputation: Disabled
Hmm I'm no network expert but if you have enabled X11 on your guest VM and use a web browser to access the internet to a site like whatismyip.com I am pretty sure the external ipaddress recorded will be the same as the host machines.

Unfortunately I do not know enough about kvm configurations to make a suggestion on how to set it up to access the vm externally
 
Old 04-18-2013, 06:30 PM   #3
sanaz
Member
 
Registered: Aug 2012
Posts: 76

Original Poster
Rep: Reputation: Disabled
In the VM I have access to internet and whatismyip returnted 128.197.11.18 and I ssh to it within host and it was working. But outside of the host I got
Code:
ssh: connect to host 128.197.11.18 port 22: Connection timed out
. I want to get access to it outside the host.


Any help?
 
Old 05-16-2013, 02:38 PM   #4
thompal58
LQ Newbie
 
Registered: May 2013
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by sanaz View Post
In the VM I have access to internet and whatismyip returnted 128.197.11.18 and I ssh to it within host and it was working. But outside of the host I got
Code:
ssh: connect to host 128.197.11.18 port 22: Connection timed out
. I want to get access to it outside the host.


Any help?
This looks more like a case where you don't have the ssh service available to foreign IPs, rather than a case of your IP being unreachable.
 
Old 05-28-2013, 03:09 AM   #5
phdam8
LQ Newbie
 
Registered: Nov 2011
Location: Aktau Kazakhstan
Distribution: CentOS Ubuntu RHEL
Posts: 18

Rep: Reputation: Disabled
You can bridge your host and guest networks. If you have a router, your router will assign your guest an IP, usually 192.168.x.x. If you are directly connected to the Internet and have a static IP, you can assign your guest an IP and it will be directly connected to the Internet, just like any other computer.

You can do it both in the command line and in the virt-manager gui.

For the virt-manager gui, it's really easy. Go to the settings page of specified guest VM. Go to the information page by clicking on the blue button at the top of the gui.

Go down to NIC Virtual Network Interface.

For Source Device, select "Host device ethX: macvtap".

For Source Mode, select "Bridge".

Use Virtio as it provides better I/O throughput. It is much better than the default emulated Realtek device, but make sure you have Virtio drivers installed.

Of course, you can also just forward connections from your host, which in this case is acting as a sort of router for your VM, to your guest, but I don't know how to do that. The gui method is easier in my opinion anyway.

Last edited by phdam8; 05-28-2013 at 03:11 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Guest to Host message passing - guest's memory usage statistics & guest's IP address Prince_Pangeni Linux - Virtualization and Cloud 2 03-03-2012 03:06 AM
Convert guest logical address to host physical address hmd429 Linux - Virtualization and Cloud 1 10-07-2011 03:44 AM
Convert guest logical address to host physical address hmd429 Linux - Kernel 0 10-07-2011 02:35 AM
How to assign public IP to vmware guest OS cucolin@ Linux - Software 12 02-24-2009 05:00 PM


All times are GMT -5. The time now is 08:41 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration