Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------------------------------------------------
- ifconfig
- ------------------------------------------------------------------------------
- eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001
- inet 172.31.26.95 netmask 255.255.240.0 broadcast 172.31.31.255
- inet6 fe80::469:4dff:fe51:b6fd prefixlen 64 scopeid 0x20<link>
- ether 06:69:4d:51:b6:fd txqueuelen 1000 (Ethernet)
- RX packets 217 bytes 28152 (27.4 KiB)
- RX errors 0 dropped 0 overruns 0 frame 0
- TX packets 285 bytes 31224 (30.4 KiB)
- TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
- lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
- inet 127.0.0.1 netmask 255.0.0.0
- inet6 ::1 prefixlen 128 scopeid 0x10<host>
- loop txqueuelen 1 (Local Loopback)
- RX packets 6 bytes 416 (416.0 B)
- RX errors 0 dropped 0 overruns 0 frame 0
- TX packets 6 bytes 416 (416.0 B)
- TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
- ------------------------------------------------------------------------------
- sudo iptables -S
- ------------------------------------------------------------------------------
- -P INPUT ACCEPT
- -P FORWARD ACCEPT
- -P OUTPUT ACCEPT
- -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 48 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 47 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 27015 -j ACCEPT
- -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
- -A INPUT -p icmp -j ACCEPT
- -A INPUT -i lo -j ACCEPT
- -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
- -A INPUT -j REJECT --reject-with icmp-host-prohibited
- -A INPUT -s 127.0.0.1/32 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
- -A INPUT -p udp -m udp --dport 1200 -j ACCEPT
- -A INPUT -p udp -m udp --dport 27000 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 27020 -j ACCEPT
- -A INPUT -p tcp -m tcp --dport 27039 -j ACCEPT
- -A INPUT -p udp -m udp --dport 27020 -j ACCEPT
- -A INPUT -d 172.31.26.95/32 -p udp -m udp --dport 27015
- -A INPUT -d 35.156.12.85/32 -p udp -m udp --dport 27015
- -A INPUT -d 35.156.12.85/32 -p tcp -m tcp --dport 27015 -j ACCEPT
- -A FORWARD -j REJECT --reject-with icmp-host-prohibited
- ------------------------------------------------------------------------------
- cat /etc/sysconfig/iptables-config
- ------------------------------------------------------------------------------
- # Load additional iptables modules (nat helpers)
- # Default: -none-
- # Space separated list of nat helpers (e.g. 'ip_nat_ftp ip_nat_irc'), which
- # are loaded after the firewall rules are applied. Options for the helpers are
- # stored in /etc/modprobe.conf.
- IPTABLES_MODULES=""
- # Unload modules on restart and stop
- # Value: yes|no, default: yes
- # This option has to be 'yes' to get to a sane state for a firewall
- # restart or stop. Only set to 'no' if there are problems unloading netfilter
- # modules.
- IPTABLES_MODULES_UNLOAD="yes"
- # Save current firewall rules on stop.
- # Value: yes|no, default: no
- # Saves all firewall rules to /etc/sysconfig/iptables if firewall gets stopped
- # (e.g. on system shutdown).
- IPTABLES_SAVE_ON_STOP="no"
- # Save current firewall rules on restart.
- # Value: yes|no, default: no
- # Saves all firewall rules to /etc/sysconfig/iptables if firewall gets
- # restarted.
- IPTABLES_SAVE_ON_RESTART="no"
- # Save (and restore) rule and chain counter.
- # Value: yes|no, default: no
- # Save counters for rules and chains to /etc/sysconfig/iptables if
- # 'service iptables save' is called or on stop or restart if SAVE_ON_STOP or
- # SAVE_ON_RESTART is enabled.
- IPTABLES_SAVE_COUNTER="no"
- # Numeric status output
- # Value: yes|no, default: yes
- # Print IP addresses and port numbers in numeric format in the status output.
- IPTABLES_STATUS_NUMERIC="yes"
- # Verbose status output
- # Value: yes|no, default: yes
- # Print info about the number of packets and bytes plus the "input-" and
- # "outputdevice" in the status output.
- IPTABLES_STATUS_VERBOSE="no"
- # Status output with numbered lines
- # Value: yes|no, default: yes
- # Print a counter/number for every rule in the status output.
- IPTABLES_STATUS_LINENUMBERS="yes"
- # Reload sysctl settings on start and restart
- # Default: -none-
- # Space separated list of sysctl items which are to be reloaded on start.
- # List items will be matched by fgrep.
- #IPTABLES_SYSCTL_LOAD_LIST=".nf_conntrack .bridge-nf"
- ------------------------------------------------------------------------------
- sudo ip6tables -S
- ------------------------------------------------------------------------------
- -P INPUT ACCEPT
- -P FORWARD ACCEPT
- -P OUTPUT ACCEPT
- -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
- -A INPUT -p ipv6-icmp -j ACCEPT
- -A INPUT -i lo -j ACCEPT
- -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
- -A INPUT -d fe80::/64 -p udp -m udp --dport 546 -m state --state NEW -j ACCEPT
- -A INPUT -j REJECT --reject-with icmp6-adm-prohibited
- -A FORWARD -j REJECT --reject-with icmp6-adm-prohibited
- ------------------------------------------------------------------------------
- lsmod |grep iptab
- ------------------------------------------------------------------------------
- iptable_filter 12810 0
- ip_tables 27115 1 iptable_filter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement