OpenVZ Forum


Home » General » HowTo » Bandwidth Accounting for VPS
Re: Bandwidth Accounting for VPS [message #1325 is a reply to message #187] Mon, 06 February 2006 20:54 Go to previous messageGo to previous message
Emitkins is currently offline  Emitkins
Messages: 7
Registered: February 2006
Junior Member
If you would like create a file called ip.sh
chmod +x ip.sh
edit the SUBNET1 FIRST1 AND LAST1

subnet1 being your 1st 3 rangs numbers.
first1 being your 1st ip
last1 being your last ip
Hope this saves everyone some time
#! /bin/sh -x
IPTABLES="/sbin/iptables"
EXTERNAL_INTERFACE="eth0"
SUBNET1="72.2.23"
FIRST1=129
LAST1=254

I=$FIRST1;

while [ $I -le $LAST1 ]; do
$IPTABLES -A FORWARD -o $EXTERNAL_INTERFACE -s $SUBNET1.$I
$IPTABLES -A FORWARD -i $EXTERNAL_INTERFACE -d $SUBNET1.$I

let I=$I+1;
done;
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: iptables Blocking for ALL VEs
Next Topic: Simple script to download rpm files.
Goto Forum:
  


Current Time: Wed Jul 17 14:18:13 GMT 2024

Total time taken to generate the page: 0.02727 seconds