[SOLVED] OpenVZ container using public IP with different subnet

paulocoghi

Active Member
Oct 23, 2014
7
0
41
I am still using Proxmox 3.4 (3.4-16/40ccc11c) with OpenVZ and venet, in various servers in OVH. And in a new dedicated server, I cant ping my only container.

The public IP of the HN is 158.69.241.xxx and for the container 149.56.179.xxx

Routing table
Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
149.56.179.xxx  0.0.0.0         255.255.255.255 UH    0      0        0 venet0
158.69.241.0    0.0.0.0         255.255.255.0   U     0      0        0 vmbr0
0.0.0.0         158.69.241.254  0.0.0.0         UG    0      0        0 vmbr0

/etc/network/interfaces
Code:
auto lo
iface lo inet loopback

auto vmbr0
iface vmbr0 inet static
        address 158.69.241.xxx
        netmask 255.255.255.0
        broadcast 158.69.241.255
        gateway 158.69.241.254
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0

Netfilter configuration
Code:
$ iptables -t nat -L && iptables -t filter -L && iptables -t mangle -L

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination        

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination        

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination        
Chain INPUT (policy ACCEPT)
target     prot opt source               destination        

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination        

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination        
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination        

Chain INPUT (policy ACCEPT)
target     prot opt source               destination        

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination        

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination        

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
 
Last edited:
I entered in the console of my container and realized that the networking service were not running.

[ Solution ]

Step 1: access the container console with:
Code:
vzctl enter <id>

Step 2: inside it, check the network config with:
Code:
ifconfig -a

Step 3: if venet0:0 doesn't appear, restart your network with:
Code:
service networking restart