Hi, I get following error message when trying to execute a simple NAT script :
[root@gareway net]# ./nat
: bad interpreter: No such file or directory
Code:
[root@gareway net]# ls -al
total 16
drwxr-xr-x 2 root root 4096 Jan 1 19:50 .
drwxr-xr-x 13 root root 4096 Apr 28 2004 ..
-rwxr-xr-x 1 root root 799 Apr 28 2004 firewall
-rwxr-xr-x 1 root root 814 Jan 1 19:50 nat
[root@gareway net]# vi nat
!/bin/bash
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
/sbin/modprobe ip_tables
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_nat
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_nat_ftp
iptables -N syn-flood
iptables -A INPUT -p tcp --syn -j syn-flood
iptables -I syn-flood -p tcp -m limit --limit 3/s --limit-burst 6 -j RETURN
iptables -A syn-flood -j REJECT
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -d 0/0 -o eth1 -j MASQUERADE
iptables -t nat -A PREROUTING -i eth0 -p tcp -s 192.168.0.0/24 --dport 80 -j REDIRECT --to -port 8080
Code:
[root@gareway net]# whereis /bin/bash
bash: /bin/bash /usr/lib/bash /usr/share/man/man1/bash.1.gz
[root@gareway net]#
I get following the error when execute "bash nat"
Code:
[root@gareway net]# bash nat
: No such file or directoryipv4/ip_forward
: No such file or directoryipv4/conf/all/rp_filter
: No such file or directoryipv4/tcp_syncookies
modprobe: Can't locate module ip_tables
modprobe: Can't locate module iptable_filter
modprobe: Can't locate module iptable_nat
modprobe: Can't locate module ip_conntrack
modprobe: Can't locate module ip_conntrack_ftp
modprobe: Can't locate module ip_nat_ftp
iptables: Chain already exists
'ptables v1.2.6a: Invalid target name `syn-flood
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.2.6a: Invalid target name `RETURN
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.2.6a: Invalid target name `REJECT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.2.6a: Invalid target name `MASQUERADE
Try `iptables -h' or 'iptables --help' for more information.
[root@gareway net]#
thx!