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="...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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/ |
|
|||
|
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. |
|
|||
|
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 |