LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 04-28-2004, 09:06 AM   #1
lnx8
LQ Newbie
 
Registered: Apr 2004
Posts: 9

Rep: Reputation: 0
: bad interpreter: No such file or directory


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!

Last edited by lnx8; 04-28-2004 at 09:13 AM.
 
Old 04-28-2004, 11:44 AM   #2
rkef
Member
 
Registered: Mar 2004
Location: bursa
Posts: 110

Rep: Reputation: 15
Quote:
!/bin/bash
Is that just a "mis-paste" or did you forget that it should be '#!/bin/bash' (the sha in the shabang)?
 
Old 04-28-2004, 08:12 PM   #3
lnx8
LQ Newbie
 
Registered: Apr 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by rkef
Is that just a "mis-paste" or did you forget that it should be '#!/bin/bash' (the sha in the shabang)?
sorry, i write erro
thanks point out.
source text is such:
Code:
[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

Last edited by lnx8; 04-28-2004 at 08:14 PM.
 
Old 04-28-2004, 08:19 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,623
Blog Entries: 10

Rep: Reputation: 773Reputation: 773Reputation: 773Reputation: 773Reputation: 773Reputation: 773Reputation: 773
You may want to have a look at your kernel configuration :)

Looks like a few things are missing, both in iptables and
the proc file-system.



Cheers,
Tink
 
Old 04-29-2004, 02:56 AM   #5
lnx8
LQ Newbie
 
Registered: Apr 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks!
go home again try.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bad interpreter: No such file or directory EcLip$e Linux - General 33 02-09-2011 10:22 PM
"bad interpreter : no such file or directory" when configure "flex" acer_peri Linux - Software 10 11-10-2010 01:19 AM
: bad interpreter: No such file or directory ciberrust Linux - Networking 10 09-09-2010 06:51 AM
bash: ./fam_mirror: bad interpreter: No such file or directory linuxboy69 Linux - Software 5 12-22-2003 11:35 AM
bash: ./myscript: bad interpreter: No such file or directory Stefangeelen Linux - Newbie 3 09-05-2002 01:50 AM


All times are GMT -5. The time now is 03:14 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration