[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: configure firewall in etch



leo wrote:
> On Mon, 2001-12-31 at 10:52 -0700, leo wrote:
>   
>> On Mon, 2001-12-31 at 10:33 -0700, leo wrote:
>>     
>>> hello,
>>>
>>> is there any problem configuring a firewall in an dhcp client machine
>>> when an IP address change every time I reboot. In the firewall rules I
>>> denied (DROP) all incoming and OUTCOMING packet messages and after that
>>> this line:
>>>
>>> iptables -A INPUT -s 192.168.16.118 -j ACCEPT
>>> iptables -A OUTPUT -d 192.168.16.118 -j ACCEPT
>>>
>>> lets my IP address can do anything although in the next reboot this IP
>>> changes so that line will not be valid anymore
>>>
>>> my idea to fix this is copying this IP to an enviroment variable (with
>>> export command?) to use it in my firewall rules script taking it's value
>>> for example: 
>>>
>>> iptables -A INPUT -s $myIP -j ACCEPT
>>> iptables -A OUTPUT -d $myIP -j ACCEPT
>>>
>>> the part I don't know is how can I copy the IP address from boot
>>>
>>>
>>>       
>>     
>
>
>   
It's no need to send one e-mail multiple times, and please set your
system date and time acordingly
You can find out your ip address using a script like  this

#!/bin/bash
ip=`ifconfig ethX | grep "inet addr" | awk '{print $2}' | tr -d addr:`
echo Your ip on ethX is $ip

where X is the number of your ethernet interface that you want to find
out its ip


Reply to: