[SOLVED] Help How to configure the network of VM to access internet

Edsw

New Member
Jun 27, 2020
4
0
1
52
Help please I am new in all, and need help please.

I need access to internet from KVM with Centos 7
I need to know what is wrong in my configuration, I can’t have access to internet from my VM.

I have one node with one KVM and one LXC both with centos 7

the node has this configuration:

has 1 network device is this
nametypeActiveAutostarVLAN aware Ports/Slave IP AddressSubnet maskCIDRGateway
enp5s4network device YesNoNo


has 1 linux bridge is this
nametypeActiveAutostarVLAN aware Ports/Slave IP AddressSubnet maskCIDRGateway
vmbr0 linux bridge Yes YesNoenp5s4165.170.125.19 255.255.255.0165.170.125.189/24165.170.125.1


For the KVM the network device is this
network device(net0)vmbr0= C*:6*:7*:C*:0*:B*, bridge= vmbr0

in the shell of the node I can do ping google.com and is ok
this to show me

# ping google.com
PING google.com (216.58.206.238) 56(84) bytes of data.
64 bytes from par10s34-in-f14.1e100.net (216.58.206.238): icmp_seq=1 ttl=120 time=0.953 ms
64 bytes from par10s34-in-f14.1e100.net (216.58.206.238): icmp_seq=2 ttl=120 time=1.14 ms
64 bytes from par10s34-in-f14.1e100.net (216.58.206.238): icmp_seq=3 ttl=120 time=1.22 ms
but when I am goin to Console to my KVM with centos 7 I do the ping google.com but is not ok
this is to show me

ping: google.com: Name or service not known
but if I do ping 127.0.0.1 in Console to my KVM that is ok
this is to show me

[root@SC-CT-Test etc]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.024 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.022 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.019 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.033 ms

I do not know how to configure the network of my KVM to have access to internet

Please anybody help me with this

Thanks
 
Last edited:
Mar 19, 2018
116
10
23
You need to configure the network settings in the Centos VM itself. Proxmox cannot set them (unless you happened to use a cloud-init image).

During Centos installation, did you enable networking and set up a public IP?

In the Centos VM, check /etc/sysconfig/network-scripts/ifcfg-eth0 as this is (usually) where the network configuration is held

You will need an unused public IP to give it, of course.
You should specify the same gateway IP as you have specified for the node itself. Treat it as a physical server from the point of view of the network (NOTE: I'm assuming bridged networking based on what you have posted, but if this isn't the case then this is beyond my knowledge)
 
  • Like
Reactions: Edsw

Edsw

New Member
Jun 27, 2020
4
0
1
52
You need to configure the network settings in the Centos VM itself. Proxmox cannot set them (unless you happened to use a cloud-init image).

During Centos installation, did you enable networking and set up a public IP?

In the Centos VM, check /etc/sysconfig/network-scripts/ifcfg-eth0 as this is (usually) where the network configuration is held

You will need an unused public IP to give it, of course.
You should specify the same gateway IP as you have specified for the node itself. Treat it as a physical server from the point of view of the network (NOTE: I'm assuming bridged networking based on what you have posted, but if this isn't the case then this is beyond my knowledge)


Thank you very much for answering me, I did not know that I had to get a public IP I am going to get it and I'm sure to do the test tomorrow and I will let you know how it turned out, I appreciate your help because I am new to all this.

Regards
 

Edsw

New Member
Jun 27, 2020
4
0
1
52
Thanks @Faris Raouf for your help, you have given me the information that I needed to solve my problem, and for others who have the same problem, here is the configuration

1) For a container, when creating it

1593629586949.png


2) For a KVM, when creating it

1593629631044.png

And also for the KVM when you are installing the server, in this case Centos 8 there you must add the rest, preferable when installing the server

1593629710041.png


If someone wants to add something else to this, you can leave a message
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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!