Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 46 lines (34 sloc) 1.18 kb
#!/bin/sh
##
## junxond
## Author : <shashi@inf.in>
## Started on Mon Feb 22 13:06:09 2010 Shashishekhar S
## $Id$
##
## Copyright (C) 2010 INFORMEDIA TECHNOLOGIES (MYSORE) PRIVATE LIMITED
##
# Set environment
export PYTHONPATH=/opt:/opt/junxon:/opt/junxon/lib:/opt/junxon/xroad
export DJANGO_SETTINGS_MODULE=settings
# Restart Pyro NS - TODO
/etc/init.d/pyro-nsd restart
# Flush all at commands, as they'll be recreated by junxond.py
for a in `atq|awk '{ print $1 }'`; do atrm $a; done
# Start junxond.py
/opt/junxon/server/junxond.py restart
/opt/junxon/server/xroad-daemon.py restart
# Setup Netfilter Rules
# Flush All
/sbin/iptables -t filter --flush
/sbin/iptables -t nat --flush
/sbin/iptables -t mangle --flush
# Init Rules
/sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j DNAT --to 192.168.1.200 # Redirect all incoming packets
# Create new chains
/sbin/iptables -t mangle -N in_traffic
/sbin/iptables -t mangle -N out_traffic
# Push all traffic
/sbin/iptables -t mangle -A FORWARD -s 192.168.1.0/24 -j out_traffic
/sbin/iptables -t mangle -A FORWARD -d 192.168.1.0/24 -j in_traffic
# Enable packet forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
Jump to Line
Something went wrong with that request. Please try again.