# cat blog >> /dev/brain 2> /proc/mind
cat blog >> /dev/brain 2> /proc/mind
# cat forwarder #!/bin/bash action="$1" source="$2" listener="$3" target="$4" in='iptables --table nat' case $action in start) echo 1 > /proc/sys/net/ipv4/ip_forward $in --append PREROUTING \ --source $source --destination $listener \ --jump DNAT --to-destination $target $in --append POSTROUTING \ --source $source --destination $target \ --jump SNAT --to-source $listener ;; stop) $in --delete PREROUTING \ --source $source --destination $listener \ --jump DNAT --to-destination $target $in --delete POSTROUTING \ --source $source --destination $target \ --jump SNAT --to-source $listener ;; status) $in --numeric --list --line-numbers ;; clean) $in --flush esac # ./forwarder start 192.168.1.1 192.168.1.2 8.8.8.8
cat forwarder
./forwarder start 192.168.1.1 192.168.1.2 8.8.8.8
Post a Comment
No comments:
Post a Comment