I have configured the network, but the VM cannot access the internet?

slj

New Member
Aug 2, 2017
18
0
1
51
I configured the network(/etc/networking/interfaces) as the official document, I used "Routed Configuration" mode since our network need every device's MAC address registered.

Here is the configure file:
auto lo
iface lo inet loopback
auto eno2
iface eno2 inet static
address 10.101.65.153
netmask 255.255.240.0
gateway 10.101.79.254
post-up echo 1 > /proc/sys/net/ipv4/conf/eno2/proxy_arp

auto vmbr0
iface vmbr0 inet static
address 10.10.10.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0

ProxmoxVE can access the internet, but when I install Ubuntun (selected vmbr0 when create the VM), it says DHCP failed, so I manually set the IP, etc as follows:

IP 10.10.10.5
netmask 255.255.255.0
anything else 10.10.10.1

but Ubutun cannot access the internet, what's wrong?
 

Alwin

Proxmox Staff Member
Staff member
Aug 1, 2017
4,617
441
88
On your interface eno2 you need to activate the forwarding for routing. post-up echo 1 > /proc/sys/net/ipv4/ip_forward
Also your provider may not route the 10.10.10.0/24 network, in the doc you can see that the physical interface and the bridge use different IPs.
 

slj

New Member
Aug 2, 2017
18
0
1
51
Thanks, Alwin! I would like to give you more information about my situation so that you can give me more advice.

So I have a server, and after registering the MAC address by our administrator I installed ProxmoxVE 5. During the installation, ProxmoxVE got an IP which is 10.101.65.153. After installation, I can indeed ssh into that server on another computer (GUI configuration also works), and the server can access the internet.

With everything default (use the default vmbr0), an Ubuntu VM will not be able to access the internet, I think it may due to the reason that each device's MAC address needs to be registered. So I tried "Routed Configuration" mentioned in the official document as I have posted.

I tried adding post-up echo 1 > /proc/sys/net/ipv4/ip_forward, unfortunately it does not work. You said "Also your provider may not route the 10.10.10.0/24 network", do you mean my "10.101.65.153" and "10.0.2.1" are the same? So maybe I should use "192.168.1.1"?

My final goal is to install several VMs and access them on another computer, what is the possible way to achieve that while MAC address is restricted (and only one IP is available)? By the way, if I choose "NAT mode" during creating VM and install Ubuntu everything works well, but I am not sure how to ssh into those VMs on another computer
 

Alwin

Proxmox Staff Member
Staff member
Aug 1, 2017
4,617
441
88
In the routed configuration you need to register all the MAC address of your VMs too. It is very likely that your provider may use adjacent subnets as well. In your case it might be easier to use NAT and do port forwarding to access your VMs.
 
  • Like
Reactions: slj

slj

New Member
Aug 2, 2017
18
0
1
51
In the routed configuration you need to register all the MAC address of your VMs too. It is very likely that your provider may use adjacent subnets as well. In your case it might be easier to use NAT and do port forwarding to access your VMs.
Great, thanks! So you mean I can indeed ssh into VM use NAT by port forwarding? Please give me an example on how to port forwarding, suppose I have Ubuntu VM with IP 10.0.2.5
 

Alwin

Proxmox Staff Member
Staff member
Aug 1, 2017
4,617
441
88
  • Like
Reactions: slj

slj

New Member
Aug 2, 2017
18
0
1
51
Alright, I kind of succeeded in port forwarding, only on host though. Here is what I did, simply use the following command:

# qm set <VMID> -args "--redir tcp:<HostPort>::22"

For example, if your VM's ID is 101, and you use port 5555 for forwarding, you just (in ProxmoxVE)

# qm set 101 -args "--redir tcp:5555::22"

I still don't know how to ssh into VM directly on another PC, but at least I can first ssh into ProxmoxVE, then ssh into the VM.

edit: oops, I made a mistake, I thought I have to first ssh into ProxmoxVE then ssh into the VMs, but in fact, I can ssh into the VMs on another PC directly, great!
 
Last edited:

Alwin

Proxmox Staff Member
Staff member
Aug 1, 2017
4,617
441
88
You use port 5555 to connect. The same config goes for any other service you want to reach.
 

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 your own in 60 seconds.

Buy now!