# mkdir /var/lib/lxc/NAME/rootfs/lib/modules
# echo "iptable_filter" >> /etc/modules
и в конфиг контейнера:
lxc.mount.entry = /lib/modules /var/lib/lxc/NAME/rootfs/lib/modules none ro,bind 0 0
# mkdir /var/lib/lxc/NAME/rootfs/lib/modules
# echo "iptable_filter" >> /etc/modules
lxc.mount.entry = /lib/modules /var/lib/lxc/NAME/rootfs/lib/modules none ro,bind 0 0
# aptitude install build-essential libncurses5-dev libssl-dev libxml2-dev uuid-dev libsqlite3-dev libjansson-dev
$ wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
$ tar -zxvf asterisk*
$ cd ./asterisk*
$ ./configure
$ make menuselect
app_dial.so Dialing Application
bridge_native_rtp.so Native RTP bridging module
bridge_simple.so Simple two channel bridging module
chan_sip.so Session Initiation Protocol (SIP)
codec_alaw.so A-law Coder/Decoder
codec_gsm.so GSM Coder/Decoder
format_gsm.so Raw GSM data
format_pcm.so Raw/Sun uLaw/ALaw 8KHz (PCM,PCMA,AU)
pbx_config.so Text Extension Configuration
res_crypto.so Cryptographic Digital Signatures
res_http_websocket.so HTTP WebSocket Support
res_rtp_asterisk.so Asterisk RTP Stack
res_security_log.so Security Event Logging
res_srtp.so Secure RTP (SRTP)
chan_iax2.so Inter Asterisk eXchange (Ver 2)
res_timing_timerfd.so Timerfd Timing Interface
pbx_ael Asterisk Extension Language Compiler
res_ael_share share-able code for AEL
app_echo.so Simple Echo Application
app_playback.so Sound File Playback Application
codec_speex.so Speex Coder/Decoder
res_musiconhold.so Music On Hold Resource
$ make
# make install
# make config
# make install-logrotate
# adduser --system --group --home /var/lib/asterisk --no-create-home --gecos "Asterisk PBX" asterisk
#!/bin/sh
chown -R asterisk:asterisk /var/lib/asterisk/
chown -R asterisk:asterisk /var/log/asterisk/
chown -R asterisk:asterisk /var/run/asterisk/
chown -R asterisk:asterisk /var/spool/asterisk/
AST_USER="asterisk"
AST_GROUP="asterisk"
create 640 asterisk asterisk
# aptitude install bind9 vlan
# cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 0.0.0.0
# Managment
auto vlan10
iface vlan10 inet static
address 10.10.0.10
netmask 255.255.0.0
vlan_raw_device eth0
# Link to world
auto vlan20
iface vlan20 inet static
address x.x.x.x
netmask 255.255.255.252
gateway x.x.x.y
dns-nameservers 127.0.0.1
vlan_raw_device eth0
# cat /etc/bind/named.conf.options
acl ournets {
127.0.0.1;
x.x.x.x/24;
y.y.y.y/24;
z.z.z.z/24;
};
options {
directory "/var/cache/bind";
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { none; };
listen-on {127.0.0.1; x.x.x.x;};
allow-query {"ournets";};
};
zone "." {
type hint;
file "/etc/bind/db.root";
};
# /etc/init.d/bind9 reload
# nslookup ya.ru localhost
Server: localhost
Address: 127.0.0.1#53
Non-authoritative answer:
Name: ya.ru
Address: 87.250.251.3
Name: ya.ru
Address: 93.158.134.3
Name: ya.ru
Address: 93.158.134.203
Name: ya.ru
Address: 213.180.193.3
Name: ya.ru
Address: 213.180.204.3
Name: ya.ru
Address: 77.88.21.3
Name: ya.ru
Address: 87.250.250.3
Name: ya.ru
Address: 87.250.250.203
# cat /etc/init.d/iptables
PATH='/sbin'
case "$1" in
start)
echo "Starting iptables"
iptables -F
iptables -P FORWARD DROP
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -p all -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
iptables -A INPUT -i vlan10 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -i vlan20 -p tcp --dport 53 -j ACCEPT
iptables -A INPUT -i vlan20 -p udp --dport 53 -j ACCEPT
;;
stop)
echo "Stopping iptables"
iptables -F
iptables -P FORWARD ACCEPT
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
;;
*)
echo "Usage: /etc/init.d/iptables {start|stop}"
exit 1
;;
esac
exit 0
# chmod +x /etc/init.d/iptables
# update-rc.d iptables defaults
#
# /etc/init.d/iptables start
# curl http://catap.ru/stuff/en_RU > /usr/share/i18n/locales/
# echo "en_RU.UTF-8 UTF-8" >> /usr/share/i18n/SUPPORTED
# echo "en_RU.UTF-8 UTF-8" >> /etc/locale.gen
# echo "en_RU.UTF-8 UTF-8" >> /var/lib/locales/supported.d/en
# locale-gen
# dpkg-reconfigure locales
LANG=en_RU.UTF-8
# apt-get install debhelper fakeroot
$ git clone git@github.com:cedricpineau/java-package.git && cd java-package
$ J2SE_PACKAGE_LIBDIR=./lib ./make-jpkg downloaded-archive
# dpkg -i oracle-java6-*.deb
# aptitude install sudo
# adduser username sudo
%sudo ALL=NOPASSWD: ALL
alias apu='sudo aptitude update'
alias apf='sudo aptitude full-upgrade'
alias app='sudo aptitude purge'
alias api='sudo aptitude install'
alias aps='aptitude search'
alias apv='apt-cache policy'