starting a machine in Docker with ports

docker run -p 800:80 -p 2222:22 -p  4443:443  -it 68715929d32a  /bin/bash If ports do not work check : sysctl net.ipv4.ip_forward if  you get: net.ipv4.ip_forward = 0 then issue : sysctl -w net.ipv4.ip_forward=1 net.ipv4.ip_forward = 1if you get the error :   docker: Error response from daemon: driver failed programming external connectivity on endpoint amazing_williams (44e256a6039741b20e4124800702d9794d69fb6be9da71ba25059de4dd527121):…

fixing permission denied issue with udp 512 port graylog

use iptables to pre-route NAT the udp port :   iptables -A PREROUTING -t nat -i eth0 -p udp –dport 514 -j REDIRECT –to-port 10515   This will bypass the limit in the OS to ports < 1024 to non=root users . nJoy 😉  

Auto-blacklist iptables

Gather a list of ips which fail logins and drop from firewall for the future lastb | awk '{ FS == "[ \t]+" ; print $3; }' | egrep -o '([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}'| grep -v "192.168." | sort | uniq | xargs -n 1 -I {} iptables -A INPUT -s {} -j DROP if you want to…

Limiting access iptables

This is a Script that I use to deploy and script iptables. Sample handles ssh and mysql it’s easy to extend. #!/bin/bash # # iptables example configuration script # # Flush all current rules from iptables # iptables -F # # Allow SSH connections on tcp port 22 # This is essential when working on…