Difference between revisions of "User:StasFomin/VZ"

From Wiki4Intranet
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
  iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
 
  iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  
 +
vzctl set 501 --netif_add eth0 --save
 +
vzctl set 501 --ipadd 10.11.0.51 --save
  
 
<code-bash>
 
<code-bash>
Line 22: Line 24:
 
yum repolist | grep -i puias
 
yum repolist | grep -i puias
 
</code-bash>
 
</code-bash>
 +
 +
 +
vzctl set 501 --features bridge:on --save
 +
vzctl set 501 --netfilter full --save
 +
vzctl set 501 --devnodes net/tun:rw --save
 +
 +
vzctl mount 501
 +
echo "JoinControllers=cpu,cpuacct,cpuset freezer,devices" >> /vz/root/501/etc/systemd/system.conf

Latest revision as of 17:36, 16 September 2015

iptables -t nat -A PREROUTING -p tcp -d 85.143.219.9 --dport 8085 -i eth0 -j DNAT --to-destination 10.11.0.5:80
iptables -t nat -A POSTROUTING -s 10.11.0.5 -o eth0 -j SNAT --to 85.143.219.9
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
vzctl set 501 --netif_add eth0 --save
vzctl set 501 --ipadd 10.11.0.51 --save
cd /etc/pki/rpm-gpg/
wget -q http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias
rpm --import RPM-GPG-KEY-puias
 
gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-puias
/etc/yum.repos.d/puias-computational.repo
[PUIAS_6_computational]
name=PUIAS computational Base $releasever - $basearch
mirrorlist=http://puias.math.ias.edu/data/puias/computational/$releasever/$basearch/mirrorlist
#baseurl=http://puias.math.ias.edu/data/puias/computational/$releasever/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puias
 
yum repolist | grep -i puias


vzctl set 501 --features bridge:on --save
vzctl set 501 --netfilter full --save
vzctl set 501 --devnodes net/tun:rw --save
vzctl mount 501
echo "JoinControllers=cpu,cpuacct,cpuset freezer,devices" >> /vz/root/501/etc/systemd/system.conf