Using Centos 7 openvz containers with iptables on Proxmox

By | August 25, 2015

I started with the minimal install and had to complete the following steps to get a basic web server up and running –
I used create CT to setup the container in Proxmox, specifying a network device rather than IP
Manually created & edited /etc/sysconfig/network-scripts/ifcfg-eth0
Manually edited /etc/sysconfig/network
Started the virtual machine

Ran additional commands in a terminal –
yum install -y httpd
systemctl start httpd.service
systemctl enable httpd.service

yum install iptables-services
yum install policycoreutils (you will get restorecon command not found if you try to run iptables without this package)
systemctl enable iptables
systemctl start iptables
service iptables save

iptables -A INPUT -p tcp -m tcp –dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp –dport 22 -j ACCEPT