Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
11-25-2004, 11:29 AM
#1
Member
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97
Rep:
: bad interpreter: No such file or directory
hi... i was wondering if someone else had this problem runing
"./rc.firewall"
?
any help?
i already check the file with vim to see if there are any characters using ^M or something like but don't so i'm kind of scared here... i have to get this job done by today... it was working god i restarted the os and try to run the rcfirewall and got that error....
i also have the "sh" file under bin...
Last edited by ciberrust; 11-25-2004 at 11:33 AM .
11-25-2004, 12:41 PM
#2
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
Can you post the contents of the file.
11-25-2004, 12:54 PM
#3
Member
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97
Original Poster
Rep:
#!/bin/sh
#DHCP Internet and Connection Sharing Script
# Use Ports as 22 [ssh]
/sbin/iptables -A INPUT -p tcp --dport 21 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 22 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 1400 -j ACCEPT
/sbin/iptables -A PREROUTING -t nat -p tcp -i eth0 --dport 555 -j DNAT --to 192.168.1.2:555
/sbin/iptables -A PREROUTING -t nat -p udp -i eth0 --dport 555 -j DNAT --to 192.168.1.2:555
/sbin/iptables -A FORWARD -p tcp --destination-port 555 -j ACCEPT
/sbin/iptables -A PREROUTING -t nat -p tcp -i eth0 --dport 411 -j DNAT --to 192.168.1.2:411
/sbin/iptables -A FORWARD -p tcp --destination-port 411 -j ACCEPT
#localhost 127.0.0.1 and icmp
/sbin/iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
/sbin/iptables -A FORWARD -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
/sbin/iptables -A OUTPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
/sbin/iptables -A INPUT -p icmp -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A OUTPUT -p icmp -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
#Net Sharing
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A INPUT -j LOG --log-level 4 --log-prefix "ATTACK"
/sbin/iptables -A INPUT -i eth0 -j DROP
#Add your additional rule here
/sbin/iptables -t nat -A POSTROUTING -s 192.168.1.1/24 -j MASQUERADE
Last edited by ciberrust; 11-25-2004 at 12:55 PM .
11-25-2004, 01:20 PM
#4
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
It does seem a bit odd. Have you tried changing the shebang line to "#!/bin/bash"
11-25-2004, 01:46 PM
#5
Member
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97
Original Poster
Rep:
yes
know i change everithing to the original file and i get
"bash: ./rc.firewall: Permission denied"
i don't know what to do
11-25-2004, 01:50 PM
#6
Member
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97
Original Poster
Rep:
when i do the chmod u+x command i get now the same error
no such file...
11-25-2004, 01:50 PM
#7
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
What are the permissions on the file:
ls -l rc.firewall
11-25-2004, 01:51 PM
#8
Member
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97
Original Poster
Rep:
-rwxr--r-- 1 root root 1138 Nov 25 14:46 rc.firewall
11-25-2004, 02:04 PM
#9
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
Something odd is going on if you can't even chmod another file.
Can you open up another terminal ok? If so, what happens if you create a simple bash script and run that?
11-25-2004, 02:09 PM
#10
Member
Registered: Dec 2003
Location: AUS
Distribution: CentOs, OpenSuse, Ubuntu, Leopard :D
Posts: 97
Original Poster
Rep:
i can run without problems "rc.local"
so i copy the star of this file and put it on the rcfirewall header... but nothing
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
modprobe ip_nat_ftp
modprobe ip_conntrack_ftp
modprobe iptable_nat
modprobe ip_conntrack
09-09-2010, 06:51 AM
#11
LQ Newbie
Registered: Oct 2004
Posts: 17
Rep:
Looks like the file is a DOS file. Use dos2unix command.
Usage: dos2unix file.sh
Thread Tools
Search this Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 01:03 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News