#!/bin/bash # # UTNET The University of Tokyo IP Ranges - iptables/ipset rules # ASN: AS2501 # Generated: 2025-12-18 # Source: ScaniteX (https://scanitex.com) # # Usage: chmod +x this_script.sh && sudo ./this_script.sh # # Create IPv4 ipset ipset create utnettheuniversityoftokyo_v4 hash:net -exist ipset flush utnettheuniversityoftokyo_v4 # Add IPv4 ranges ipset add utnettheuniversityoftokyo_v4 157.82.0.0/16 ipset add utnettheuniversityoftokyo_v4 192.51.208.0/20 ipset add utnettheuniversityoftokyo_v4 130.69.0.0/16 ipset add utnettheuniversityoftokyo_v4 133.11.0.0/16 # Create IPv6 ipset ipset create utnettheuniversityoftokyo_v6 hash:net family inet6 -exist ipset flush utnettheuniversityoftokyo_v6 # Add IPv6 ranges ipset add utnettheuniversityoftokyo_v6 2404:d540:1::/48 ipset add utnettheuniversityoftokyo_v6 2404:d540::/32 # Apply iptables rules (uncomment to use) # iptables -A INPUT -m set --match-set utnettheuniversityoftokyo_v4 src -j ACCEPT # iptables -A INPUT -m set --match-set utnettheuniversityoftokyo_v4 src -j DROP # ip6tables -A INPUT -m set --match-set utnettheuniversityoftokyo_v6 src -j ACCEPT # ip6tables -A INPUT -m set --match-set utnettheuniversityoftokyo_v6 src -j DROP echo "IP ranges for UTNET The University of Tokyo loaded successfully!" echo "IPv4 ranges: 4" echo "IPv6 ranges: 2"