iptables script error
Hi,
I make a script as folows #!/bin/bash #mv ReservedUserIP.txt ReservedUserIPList.txt exec < ReservedUserIPList.txt IPT="/sbin/iptables" DIP="172.20.128.88" while read line do echo "I m Reading" echo $line; $IPT -I FORWARD 1 -s $line -d $DIP -j ACCEPT done errror: I m Reading 10.203.176.230 ' not found.3.5: host/network `10.203.176.230 Try `iptables -h' or 'iptables --help' for more information. no clue why this error is coming.urgent help needed |
Quote:
The script line works fine on my system as you have it above, but you don't show us the input text file. Chances are, as the error says, you're getting some bad input, and IPtables is erroring out on it. |
The problem is you're confusing iptables by giving it a non-IP address string. Try echoing each line of input with a guard character at each end.
Code:
echo "[$line]" Code:
cat -vET ReservedUserIPList.txt |
All times are GMT -5. The time now is 11:52 AM. |