Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/scripts/compute_firewall.sh
Views: 687
#!/bin/bash1# Written by Keith Clawson, with some modifications by William Stein. March 201423# flush table4iptables -F56# default policy: accept all connections7iptables -P INPUT ACCEPT8iptables -P OUTPUT ACCEPT9iptables -P FORWARD ACCEPT1011# accept any related or established connections, needed for ssh to work12# because it uses a random large port to connect to other machines13iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT1415# loop over the set of hub nodes -- TODO -- what about when I add new hubs!16for N in {1..21}17do18# accept incoming traffic to ports >= 1024 from each hub node19iptables -A INPUT -p tcp --dport 1024: --source 10.1.$N.3 -j ACCEPT20done2122# europe data center web host23iptables -A INPUT -p tcp --dport 1024: --source 10.4.1.3 -j ACCEPT2425# admin machines26iptables -A INPUT -p tcp --dport 1024: --source 10.1.3.1 -j ACCEPT27iptables -A INPUT -p tcp --dport 1024: --source 10.1.10.1 -j ACCEPT2829# accept incoming traffic to ports >= 1024 from localhost -- this is used for port30# forwarding over ssh, and the local_hub to sage_server and console_server connections.31iptables -A INPUT -p tcp --dport 1024: --source localhost -j ACCEPT3233# reject incoming tcp connections to ports >= 1024 from any source that34# did not match any of the previous rules35iptables -A INPUT -p tcp --dport 1024: -j DROP363738