Re: Fedora, Samba, and iptables
From: noi (noi_at_siam.com)
Date: 03/10/05
- Next message: don_pettengill_at_spamgilent.com: "Linux UI vs Mac?"
- Previous message: Mr. Boy: "Re: boot using mount root=/dev/hdaN still prompts for root disk"
- In reply to: spodosaurus: "Re: Fedora, Samba, and iptables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 10 Mar 2005 17:26:30 GMT
On Thu, 10 Mar 2005 23:52:28 +0800, spodosaurus thoughtfully wrote:
> spodosaurus wrote:
>> i all,
>>
>> Where does Fedora Core 3 keep the iptables script? The only way I can
>> connect to my samba shares is to turn iptables off, and I'd rather just
>> get it properly configured. I think these are the commands that I need:
>>
>> iptables -A INPUT -s 192.168.0.0/24 -i eth0 -p UDP --destination-port
>> 137 -j ACCEPT
>> iptables -A INPUT -s 192.168.0.0/24 -i eth0 -p UDP --destination-port
>> 138 -j ACCEPT
>> iptables -A INPUT -s 192.168.0.0/24 -i eth0 -p TCP --destination-port
>> 139 -j ACCEPT
>> iptables -A INPUT -s 192.168.0.0/24 -i eth0 -p TCP --destination-port
>> 445 -j ACCEPT
>>
>> Now I just need to know where to put them. the file
>> /etc/sysconfig/iptables has this at the top, so I'm not sure if I should
>> be manually editting this file:
>>
>> # Firewall configuration written by system-config-securitylevel # Manual
>> customization of this file is not recommended.
>>
>> It also doesn't look quite like I'd expect an iptables configuration
>> file to look.
>>
>> Cheers,
>>
>> Ari
>>
>>
> Okay, let me know if I did the right things here. First, on advice from
> another group, I made a copy of the original /etc/sysconfig/iptables file.
> Then, I changed the above commands to iptables -I instead of iptables -A,
> which apparently was appending the new rules after the drop everything
> rule in the INPUT chain. Finally, I executed an iptables-save
> /etc/sysconfig/iptables command and restarted iptables to make sure
> everything was still working. All appears to be well. Does it sound like I
> made any errors here?
>
> Cheers,
>
> Ari
Absolutely. You can use
$ iptables -L --line-numbers -n -x -v
to display your iptables with line numbers
and check if your iptables are correct. Pipe the output to a file for
use as snapshots.
You can edit a copy of /etc/sysconfig/iptables. As root you can replace
/etc/sysconfig/iptables with the edited version so your changes will be
used the next time the system boots.
Why? because you can create a iptables.test then
$ iptables -F
$ iptables-restore < iptables.test
for testing new rules and then save the final version
root$ iptable-save > /etc/sysconfig/iptables
- Next message: don_pettengill_at_spamgilent.com: "Linux UI vs Mac?"
- Previous message: Mr. Boy: "Re: boot using mount root=/dev/hdaN still prompts for root disk"
- In reply to: spodosaurus: "Re: Fedora, Samba, and iptables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|