ipchains with dynamic IP
Hallo, a simple question. I'm running Suse Linux 7.2 with DSL ans I use damon dsl, which is starting pppd with pppoe. Now the connection is fine. I would like to put in the dsl script the Ipchains rules. How I tell this rules the IP for eth1, which is a dynamic IP from the Provider ? regards eduard
On October 31, 2001 10:48 am, Eduard Meiler wrote:
Hallo,
a simple question.
I'm running Suse Linux 7.2 with DSL ans I use damon dsl, which is starting pppd with pppoe. Now the connection is fine. I would like to put in the dsl script the Ipchains rules. How I tell this rules the IP for eth1, which is a dynamic IP from the Provider ?
Do you want the IP for eth1 or PPP0? EXTERNAL_INTERFACE="ppp0" export IPADDR=$(ifconfig ${EXTERNAL_INTERFACE}|sed -ne '/addr:/{s/.*addr:\([^ ]*\).*/\1/;p;}') This is what I use. Just edit External to reflect what is right for you. I know other methods exist but this what I've got. The export line should be one line with no breaks. Nick
which is not the most simple method - but this perlscript throws you the address of ppp0 #!/usr/bin/perl foreach (`ifconfig ppp0 2>/dev/null`) { if (/inet/) { chomp; split(/:/); @_[1] =~ s/\s+P-t-P/\n/; print (@_[1]); } } hope it helped... -----Original Message----- From: Eduard Meiler [mailto:edik@meiler.org] Sent: Wednesday, October 31, 2001 4:48 PM To: suse-security@suse.com Subject: [suse-security] ipchains with dynamic IP Hallo, a simple question. I'm running Suse Linux 7.2 with DSL ans I use damon dsl, which is starting pppd with pppoe. Now the connection is fine. I would like to put in the dsl script the Ipchains rules. How I tell this rules the IP for eth1, which is a dynamic IP from the Provider ? regards eduard
At least you have the possibility to chose the scripting-language you want to use ! AWK / SED / PERL Well done, List - well done !
participants (3)
-
Eduard Meiler
-
Lars Krisitan Klauske
-
Nick Zentena