How to access a VM outside? bridge networking?

P

phongtnit

Guest
Hi,

I created Windows 7 VM and using NAT with E1000, so the VM can access the Internet. However, I want to access the VM from outside, so I used bridge network (vmbr155), the VM CANNOT access the Internet. I also changed vmbr0, but I didn't access the Internet from the VM too. Please help me to fix it! Thanks a lot,

Win7 VM:
rNJx3.png


Inside Win7 VM:
2MuVx.png


Network adapters:
qBYcj.png
 
Last edited by a moderator:
Hi,
you have missunderstand a bridge! In you case it's looks that you have only one net ond only one real nic (eth0).
So you simply need the default-bridge vmbr0 (which is connected to eth0).
Let say, your pve-host has 100.200.200.154 and you connect an VM also to the bridge vmbr0, this VM can use an free ip on this network (e.g. 100.200.200.155).
You should only define IPs on additional bridges on the host if they in an different network, and if you need an IP-connection on the host!
Normaly it's enough to use only vmbr0 with an ip on the host and define additional bridges (for different networks, like vlans) without IP on the host.

Remove your interfaces eth0:x and the bridges and your VM should access the Internet. Otherwise check with tcpdump on the pvehost.

Udo
 
Hi,
you have missunderstand a bridge! In you case it's looks that you have only one net ond only one real nic (eth0).
So you simply need the default-bridge vmbr0 (which is connected to eth0).
Let say, your pve-host has 100.200.200.154 and you connect an VM also to the bridge vmbr0, this VM can use an free ip on this network (e.g. 100.200.200.155).
You should only define IPs on additional bridges on the host if they in an different network, and if you need an IP-connection on the host!
Normaly it's enough to use only vmbr0 with an ip on the host and define additional bridges (for different networks, like vlans) without IP on the host.

Remove your interfaces eth0:x and the bridges and your VM should access the Internet. Otherwise check with tcpdump on the pvehost.

Udo

Thanks for your help,

I did your instructions including:
+ Remove the interfaces eth0:x and the bridges
+ Use vmbr0

However, the VM could NOT access the Internet.

Do you make some configurations in /etc/network/interfaces? Which network driver do you use?

Do you recommend me basic tutorials about setup a VM on Proxmox 2.0 having Internet access without using NAT?

Thanks a lot,
 
Thanks for your help,

I did your instructions including:
+ Remove the interfaces eth0:x and the bridges
+ Use vmbr0

However, the VM could NOT access the Internet.

Do you make some configurations in /etc/network/interfaces? Which network driver do you use?

Do you recommend me basic tutorials about setup a VM on Proxmox 2.0 having Internet access without using NAT?

Thanks a lot,
Hi,
i'm a little bit oldschool so i do all things directly in /etc/network/interfaces, but work also with the gui.

An bridge is simply like an hub - all traffic over the bridge, go to all interfaces which are connected to the bridge.
If your client (for testing use first an linux-live-cd in a VM) ping to your router, you should see the traffic on the host with "tcpdump -i vmbr0 host ip.of.the.vm" (perhaps "apt-get install tcpdump").
If all run fine, you must see outgoing and incomming traffic - and the vm must receive the pings. If that don't work, use another ip in that network - perhaps your gateway disable traffic from this IP (or multible mac-addresses?).
I hate windows-firewall - many issues are simply windows-firewall issues. Therefore try with an linux-distro and if this work look with windows.

Udo
 
Hi,
i'm a little bit oldschool so i do all things directly in /etc/network/interfaces, but work also with the gui.

An bridge is simply like an hub - all traffic over the bridge, go to all interfaces which are connected to the bridge.
If your client (for testing use first an linux-live-cd in a VM) ping to your router, you should see the traffic on the host with "tcpdump -i vmbr0 host ip.of.the.vm" (perhaps "apt-get install tcpdump").
If all run fine, you must see outgoing and incomming traffic - and the vm must receive the pings. If that don't work, use another ip in that network - perhaps your gateway disable traffic from this IP (or multible mac-addresses?).
I hate windows-firewall - many issues are simply windows-firewall issues. Therefore try with an linux-distro and if this work look with windows.

Udo

Thanks udo very much.

I installed CentOS 5.6 from Proxmox template. The VM used venet network (public IP: x.x.x.158) to connect to the Internet. I can access the VM from public IP (x.x.x.158) via SSH or HTTP. However, the VM could NOT access the Internet, I didn't why and I need install programs on the VM via the Internet. I accessed the VM via gui console. After that, I entered "ping google.com" command. The result was "unknown host google.com" as below image. What did I do wrong? How can I fix it? Thanks a lot,

P/S:
+ If I installed veth (eth0) and venet (IP: x.x.x.158) together on the VM. the VM could NOT access the Internet too.
+ If I only installed veth (eth0) on the VM. the VM could NOT access the Internet too.

ifconfig of the CentOS VM.
ZNZjZ.png



Network interfaces of the CentOS VM.
ncrlC.png



Network interfaces of the server.
0voeK.png
 
Last edited by a moderator:
Thanks udo very much.

I installed CentOS 5.6 from Proxmox template. The VM used venet network (public IP: x.x.x.158) to connect to the Internet. I can access the VM from public IP (x.x.x.158) via SSH or HTTP. However, the VM could NOT access the Internet, I didn't why and I need install programs on the VM via the Internet. I accessed the VM via gui console. After that, I entered "ping google.com" command. The result was "unknown host google.com" as below image. What did I do wrong? How can I fix it? Thanks a lot,

...
Hi,
unknown hosts shows, that your host can't resolv the ip of the hosts. Look at /etc/resolv.conf in the VM. Can you ping (or better traceroute) with the IP instead of hostname?

Udo
 
Hi,
unknown hosts shows, that your host can't resolv the ip of the hosts. Look at /etc/resolv.conf in the VM. Can you ping (or better traceroute) with the IP instead of hostname?

Udo

Thanks. I can ping other websites via IP. My /etc/resolv.conf look like:
search localhost

I see the solution on the Internet: add HOSTNAME=myhostname and DHCP_HOSTNAME=myhostname in /etc/sysconfig/network. I also did that and reboot the VM, but it didn't work.

How to fix it?

Thanks,

P/S:
+ I installed CentOS 5.6 from Proxmox template. I didn't change any configurations.
+ Proxmox server can resolve domain name.
 
Last edited by a moderator:
Thanks. I can ping other websites via IP. My /etc/resolv.conf look like:


I see the solution on the Internet: add HOSTNAME=myhostname and DHCP_HOSTNAME=myhostname in /etc/sysconfig/network. I also did that and reboot the VM, but it didn't work.

How to fix it?

Thanks,

P/S:
+ I installed CentOS 5.6 from Proxmox template. I didn't change any configurations.
+ Proxmox server can resolve domain name.
Hi,
two things - why you don't use bridged networking (veth), because you wan't to test the connectivity like your windows-vm with an "real" ip-address, or not?
For OpenVZ - simply use the DNS-Entry in the pve-gui to push the right value "DNS server: xx.xx.xx.153" (if your gateway also serves DNS).

Udo
 
Hi,
two things - why you don't use bridged networking (veth), because you wan't to test the connectivity like your windows-vm with an "real" ip-address, or not?
For OpenVZ - simply use the DNS-Entry in the pve-gui to push the right value "DNS server: xx.xx.xx.153" (if your gateway also serves DNS).

Udo

Thanks a lot,

I only used veth (eth0), but it didn't work. So I only installed venet and both venet and veth to test my Internet access.

I really didn't know which IP is my DNS server. In my Proxmox server, I checked /etc/resolv.conf and see
nameserver 127.0.0.1
so, I guess my DNS server is my Proxmox server.

I changed DNS server to xx.xx.xx.153 (my default gateway) and xx.xx.xx.154 (my Proxmox server). However, when I ping google.com, there was "unknown host" error too.

Do I need to reboot my proxmox server when I change DNS configuration?
 
Thanks a lot,

I only used veth (eth0), but it didn't work. So I only installed venet and both venet and veth to test my Internet access.
But the issue is DNS and not IP-Routing, or?
I really didn't know which IP is my DNS server. In my Proxmox server, I checked /etc/resolv.conf and see

so, I guess my DNS server is my Proxmox server.

I changed DNS server to xx.xx.xx.153 (my default gateway) and xx.xx.xx.154 (my Proxmox server). However, when I ping google.com, there was "unknown host" error too.

Do I need to reboot my proxmox server when I change DNS configuration?
If you don't install an name-server on the pve-host then your DNS-server isn't this host.

You use official IPs? Then is your DNS perhaps the DNS-Server of your ISP? Check the documentation of the ISP, or use an free DNS-Server like googe (nameserver 8.8.8.8).
You can try the resolving with (on the host, and then on inside the VM)
Code:
dig www.proxmox.com 8.8.8.8
Udo
 
But the issue is DNS and not IP-Routing, or?

If you don't install an name-server on the pve-host then your DNS-server isn't this host.

You use official IPs? Then is your DNS perhaps the DNS-Server of your ISP? Check the documentation of the ISP, or use an free DNS-Server like googe (nameserver 8.8.8.8).
You can try the resolving with (on the host, and then on inside the VM)
Code:
dig www.proxmox.com 8.8.8.8
Udo

You're right. I didn't install anything on pve-host. I simply installed Proxmox 2.0 from ISO file. That's it.

I changed DNS name to 8.8.8.8 in pve-gui. It worked.

I bought a server from stealthyhosting.com and install Proxmox on it. I will try to install DNS server (BIND9) on Proxmox server.

Thanks udo in advance,
 
You're right. I didn't install anything on pve-host. I simply installed Proxmox 2.0 from ISO file. That's it.

I changed DNS name to 8.8.8.8 in pve-gui. It worked.

I bought a server from stealthyhosting.com and install Proxmox on it. I will try to install DNS server (BIND9) on Proxmox server.

Thanks udo in advance,
Hmm,
it seems that you don't know DNS very good... so it's probably not the best idea to run your own bind on the host (esp. if the host is reachable over the internet).
What's wrong with the DNS-server of your ISP or one of the many free DNS-Servers??

Udo

Edit: Normaly you need only an DNS-proxy. Look for dnsmasq instaed of bind9 if you would to use your own dns
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!