How to bind an IP to a variable (firewall)

This is a discussion on How to bind an IP to a variable (firewall) within the Linux Networking forums, part of the Linux Forums category; Hi, In my rc.firewall file, I have something like this: INET_IP="XXX.XXX.XXX.XXX" INET_IFACE="...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2004
circuit_breaker
 
Posts: n/a
Default How to bind an IP to a variable (firewall)

Hi,

In my rc.firewall file, I have something like this:

INET_IP="XXX.XXX.XXX.XXX"
INET_IFACE="eth0"

I would like to assign INET_IP the IP address given by my ISP.
How?

Thanks.
Reply With Quote
  #2 (permalink)  
Old 04-12-2004
David Efflandt
 
Posts: n/a
Default Re: How to bind an IP to a variable (firewall)

On 12 Apr 2004, circuit_breaker <circuit_breaker@canada.com> wrote:
> Hi,
>
> In my rc.firewall file, I have something like this:
>
> INET_IP="XXX.XXX.XXX.XXX"
> INET_IFACE="eth0"
>
> I would like to assign INET_IP the IP address given by my ISP.
> How?


Since you are on cable modem and likely get an IP via dhcp, see man pages
or docs for whatever dhcp client you are using (dhcpcd or pump?). It
should have a method to run a script whenever you get a new IP, and you
can either set something in a file or refresh your firewall from there
(or pass it to your firewall script as a command line parameter).

--
David Efflandt - All spam ignored http://www.de-srv.com/
Reply With Quote
  #3 (permalink)  
Old 04-13-2004
James Knott
 
Posts: n/a
Default Re: How to bind an IP to a variable (firewall)

circuit_breaker wrote:

> Hi,
>
> In my rc.firewall file, I have something like this:
>
> INET_IP="XXX.XXX.XXX.XXX"
> INET_IFACE="eth0"
>
> I would like to assign INET_IP the IP address given by my ISP.
> How?
>
> Thanks.


1) You don't have to filter on your IP.

2) The assigned IP should be available in a file stored by the dhcp client.

--

Fundamentalism is fundamentally wrong.

To reply to this message, replace everything to the left of "@" with
james.knott.
Reply With Quote
  #4 (permalink)  
Old 04-13-2004
Christoph Scheurer
 
Posts: n/a
Default Re: How to bind an IP to a variable (firewall)

On 12 Apr 2004 06:51:19 -0700
circuit_breaker@canada.com (circuit_breaker) wrote:

> Hi,
>
> In my rc.firewall file, I have something like this:
>
> INET_IP="XXX.XXX.XXX.XXX"
> INET_IFACE="eth0"
>
> I would like to assign INET_IP the IP address given by my ISP.
> How?
>
> Thanks.


INET_IP=`ifconfig eth0 | awk -F' ' '/inet addr/ {print $2}' - | sed -e 's/.*:\(.*\)/\1/'`

Greets
Chris
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 01:46 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0