Container in Proxmox with Static IP Can't Ping Local or External Network

kaisORM

New Member
Feb 14, 2025
5
0
1
I am running a container on Proxmox and I have assigned a static IP address to the container. However, after configuring the static IP, the container is unable to ping both the local network (including the Proxmox host) and the external network (internet).

Despite these configurations, when I try to ping the Proxmox host or an external address (ping 8.8.8.8), I get no response.

Why is the container unable to ping either the local network or external networks after assigning a static IP?
Are there any missing configurations I need to apply in Proxmox or the container to enable proper connectivity?
 

Attachments

  • 1739540612531.png
    1739540612531.png
    9.7 KB · Views: 5
The static IP for the container is set in the /etc/network/interfaces file:
auto eth0
```bash
iface eth0 inet static
address <public-ip>
netmask 255.255.255.0
gateway <gateway-ip>
```
IP forwarding is enabled on the Proxmox host:
```bash
sysctl -w net.ipv4.ip_forward=1
```
added a NAT rule to allow the container to access the internet:
```
iptables -t nat -A POSTROUTING -s 192.168.56.0/24 -o ens33 -j MASQUERADE

```
 
If you do ip a in the container terminal, what is the output?
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether bc:24:11:f5:df:06 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.56.132/24 brd 192.168.56.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::be24:11ff:fef5:df06/64 scope link
valid_lft forever preferred_lft forever