Not getting Internet in my CT

manues50

Active Member
Jul 25, 2019
58
0
26
37
I was trying to create a container CT, when I gave static IP while creating CT, I am not getting internet.

whereas I am getting internet when I configure it directly in interfaces(Linux)

Please check my configuration


cat /etc/network/interfaces
````````````````````````````
auto lo
iface lo inet loopback
iface lo inet6 loopback
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto eth0
iface eth0 inet static
address [IP]
netmask 255.255.255.0
# --- BEGIN PVE ---
post-up ip route add [GW IP] dev eth0
post-up ip route add default via [GW IP] dev eth0
pre-down ip route del default via [GW IP] dev eth0
pre-down ip route del [GW IP] dev eth0
# --- END PVE ---
ip route
`````````
default via [GW IP] dev eth0
[NW] dev eth0 proto kernel scope link src [IP]
[GW IP] dev eth0 scope link
 
I was trying to create a container CT, when I gave static IP while creating CT, I am not getting internet.

whereas I am getting internet when I configure it directly in interfaces(Linux)

Looks like a template which does not adapt correctly the settings.

Which is the container template you use?
 
Just had the same issue, with this container template.
Manually adjusting the interfaces file inside the container fixed it, as workaround.
Thanks for reporting