How to create tar.gz?
You can create tar.gz file with the following command.DO NOT ENTER / after the directory name.
tar -cvzf test.tar.gz test
You can create tar.gz file with the following command.DO NOT ENTER / after the directory name.
tar -cvzf test.tar.gz test
From the root prompt on your server, invoke the CPAN shell:
#perl -MCPAN -e shell
Once the Perl interpreter has loaded (and been configured), you can install modules with: install .MODULENAME
The first thing you should do is upgrade your CPAN:
cpan>install Bundle::CPAN
Once it is completed, type:
cpan>reload cpan
Now, enter the following command to retrieve all of the required modules:
cpan> install DateTime
Note
Be aware that after freshly installing make / gcc, your perl installation will not necessarily detect it. This means module installation will still fail during the 'make' stage. You may need to invoke the CPAN shell and run the setup routine again, to point to the location of make:
# perl -MCPAN -e shell CPAN
cpan> o conf make /usr/bin/make
cpan> o conf commit
The following link contains list of TCP and UDP ports:
http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
Opensips is one of the best solution that are present in opensource, it provide you ITSP level services on good hardware box, Single box configure with opensips can supports 5000-10000 calls at time, which it make any teleco to operate with more then 5-10 billion mins per year. Anyone can use it to support their bussiness which is incuring lot of cost due high hardware cost such as iSoftSwitch.
REQUIRMENTS:
INSTALLATION
Introduction
The field of application of a NAT Gateway is in example a private LAN consisting of several PC with an Internet connection with one public IP address.
The Gateway (GW) is equipped with two network interfaces. One gets assigned the public IP, the second a private IP (i.e. 192.168.0.1). Every other LAN PCs has it’s own private IP (i.e. 192.168.0.2). If an outbound connection is requested the LAN PC talks to the gateway which masquerades the outbound traffic using the public IP. So every external connection looks like if it is coming from only one PC.
The basic firewalling will prevent all connections from outside with the exception of SSH (port 22) which we leave open for service purposes (i.e.).
System preparation
The following assumes that the gateway has two network interfaces:
To use iptables you need to have at least the following kernel components compiled in or as modules
IP forwarding needs to be active (echo 1 > /proc/sys/net/ipv4/ip_forward</userdefined).
Setup the external interface using the necessary data from your provider (IP and standard gateway). The internal interface (eth1) needs to get a private IP address, like 10.174.254.197. The routing table of the gateway will be set up automatically during network initialization.
Every LAN PC will use the NAT-Gateways internal IP (192.168.0.1 in our example) as standard gateway in its networking setup.
Firewall script
#!/bin/sh ipt=/sbin/iptables extip=192.168.2.243 # replace with your EXTERNAL IP lan=10.174.254.197/27 # your LAN< # start firewall start_firwall { echo “Enabling IP forwarding.” echo 1 > /proc/sys/net/ipv4/ip_forward echo “Enabling iptables firewall.” # default policies $ipt -P INPUT DROP $ipt -P FORWARD DROP # NAT $ipt -t nat -A POSTROUTING -o eth0 -j SNAT –to-source $extip # INPUT chain $ipt -A INPUT -i lo -j ACCEPT $ipt -A INPUT -i eth1 -s $lan -j ACCEPT $ipt -A INPUT -i eth0 -m state –state ESTABLISHED,RELATED -j ACCEPT $ipt -A INPUT -p tcp –destination-port 22 -j ACCEPT # FORWARD chain $ipt -A FORWARD -i eth1 -s $lan -j ACCEPT $ipt -A FORWARD -i eth0 -m state –state ESTABLISHED,RELATED -j ACCEPT } # stop firewall stop_firwall { $ipt -P INPUT DROP $ipt -P OUTPUT DROP $ipt -P FORWARD DROP # allow internal traffic $ipt -A INPUT -i eth1 -j ACCEPT $ipt -A OUTPUT -o eth1 -j ACCEPT } # flushing, removing and zeroing tables
reset_firwall { chains=`cat /proc/net/ip_tables_names` for i in $chains; do $debug $ipt -t $i -F $debug $ipt -t $i -X $debug $ipt -t $i -Z done } case “$1″ in start|restart|reload) reset_firewall start_firewall ;; stop) reset_firewall stop_firewall ;; *) echo “Usage: $0 {start|stop|restart|reload}” exit 1 ;; esac exit 0
#!/bin/bash
# get ip
/sbin/ifconfig $1 | grep inet | awk ‘{print $2}’ | sed ‘s/^addr://g’
To get your Internet address if you are behind a NAT:
## The -n option retrieves the Internet IP address
## if you are behind a NAT
if [ "$1" = "-n" ]
then ip=$(lynx -dump http://cfaj.freeshell.org/ipaddr.cgi)
else if=$1 ## specify which interface, e.g. eth0, fxp0
system=$(uname)
case $system in FreeBSD)
sep=”inet “ ;;
Linux) sep=”addr:” ;;
esac temp=$(ifconfig $if)
temp=${temp#*”$sep”}
ip=${temp%% *}
fi
printf “%s\n” “$ip”
### CFAJ ###
Add the following line on /etc/network/interfaces
up route add -net 172.22.0.0 netmask 255.255.254.0 gw 192.168.15.101 dev eth0 (The connected Hardware interface.)
Now restart the network service by
#/etc/init.d/networking restart
Enable Auto-Reply
Go to users home folder (here we want to create auto-reply for “user” account)
cd /home/user
create .forward file
vi .forward (add the following line)
|/usr/bin/procmail
create .procmailrc
vi .procmailrc (add the following lines)
SHELL=/bin/sh :0 h c * !^FROM_DAEMON * !^X-Loop: user@example.com | (formail -r -I”Precedence:junk” \ -A”X-Loop: user@example.com ” ; \ cat $HOME/message; \ ) | $SENDMAIL -oi -t :0
create a file message-
vi message
hi, I will be leave on ………… (here you add your message which will be sent to the sender during your vacation)
Disable Auto-Reply
Go to users home folder (here we want to remove auto-reply settings of “user” account)
cd /home/user
mv .forward forward
mv .procmailrc procmailrc