Ik heb pas Fedora Core 5 geïnstalleerd, maar ondervind iets vrij vreemds bij het uitvoeren van scripts, bvb eentje om met iptables een router te maken:
Ik krijg dan een fout in dit geval:
Wanneer ik zelf regel per regel uitvoer is er geen enkel probleem.
Ook bij andere scripts gebeuren er vreemde dingen. Als ik bvb een map maak met "mkdir testmap" en ik kijk of die gemaakt is met dir, blijkt er iets als "testmap\r"
Iemand een idee wat er mis is?
alvast bedankt
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| echo 1 > /proc/sys/net/ipv4/ip_forward echo "ok" iptables -F echo "ok" iptables -t nat -F iptables --delete-chain iptables --table nat --delete-chain iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT ACCEPT iptables -A INPUT -m state --state INVALID -j DROP iptables -A FORWARD -m state --state INVALID -j DROP iptables -A OUTPUT -m state --state INVALID -j DROP iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT iptables -A FORWARD -i eth1 -o eth0 iptables -A FORWARD -i eth0 -o eth1 iptables -A INPUT -i eth0 -j ACCEPT iptables -A INPUT -i eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE |
Ik krijg dan een fout in dit geval:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
| ./firewall: line 1: /proc/sys/net/ipv4/ip_forward : No such file or directory ok iptables: No chain/target/match by that name ok iptables: No chain/target/match by that name iptables v1.3.5: Unknown arg `--delete-chain ' Try `iptables -h' or 'iptables --help' for more information. iptables v1.3.5: Unknown arg `--delete-chain ' Try `iptables -h' or 'iptables --help' for more information. iptables: Bad policy name iptables: Bad policy name iptables: Bad policy name iptables v1.3.5: Invalid target name `DROP ' Try `iptables -h' or 'iptables --help' for more information. iptables v1.3.5: Invalid target name `DROP ' Try `iptables -h' or 'iptables --help' for more information. iptables v1.3.5: Invalid target name `DROP ' Try `iptables -h' or 'iptables --help' for more information. iptables v1.3.5: Invalid target name `ACCEPT ' Try `iptables -h' or 'iptables --help' for more information. iptables v1.3.5: Invalid target name `ACCEPT ' Try `iptables -h' or 'iptables --help' for more information. Warning: wierd character in interface `eth0 ' (No aliases, :, ! or *). Warning: wierd character in interface `eth1 ' (No aliases, :, ! or *). iptables v1.3.5: Invalid target name `ACCEPT ' Try `iptables -h' or 'iptables --help' for more information. iptables v1.3.5: Invalid target name `ACCEPT ' Try `iptables -h' or 'iptables --help' for more information. |
Wanneer ik zelf regel per regel uitvoer is er geen enkel probleem.
Ook bij andere scripts gebeuren er vreemde dingen. Als ik bvb een map maak met "mkdir testmap" en ik kijk of die gemaakt is met dir, blijkt er iets als "testmap\r"
Iemand een idee wat er mis is?
alvast bedankt