Linux Netfilter discussions
 help / color / mirror / Atom feed
* Ineeed of major help with  Dynamic IP Addy for my IPTABLES :(((
@ 2002-10-17  4:18 Tasha Smith
  2002-10-17  4:48 ` Tasha Smith
  0 siblings, 1 reply; 4+ messages in thread
From: Tasha Smith @ 2002-10-17  4:18 UTC (permalink / raw)
  To: netfilter

Hiii,
Guys!
What iam running:
Linux 7.2 Kernel 2.4.19
Iptables-1.2.7a
Pump-0.8.11-7

K, Since i am connected to the net with a ADSL connection my ip address changes
usually. But in my script i have to put in my  ipaddy in some rules. My iptables
script is in my "/etc/init.d" named "firewall" and it runs and is working.But to
update my iptables in the script i installed "PUMP" .(i tryed following the
directions out of LINUX FIREWALLS book ed.2) I created a pump.conf file in /etc
dir whick looks like this!
# "/etc/pump.conf"

retries 3
script /etc/rc.d/rc.pump.done

device eth0 {
     noisdomain
}
*******************************************************************************
And in the "/etc/rc.d/" i created this script like the book said and ran it
using "chmod -u=rwx /etc/rc.d/rc.pump.done" here is what the script looks like:

#!/bin/bash

if [ "$1" = "down" ]; then
    exit 0
fi

if [ "$1" = "lease" ]; then
    echo address $3 assigned to network interface $2 >
/dev/console
fi

/sbin/pump -i eth0 -s > /var/tmp/pump.out

IPADDR=`fgrep IP: /var/tmp/pump.out | sed -e "s/.*IP:
//"`
NETMASK=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*Netmask: //"`
BROADCAST=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*Broadcast: //"`
NETWORK=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*Network: //"`
DHCP_SERVER=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*DHCP_SERVER: //"`
GATEWAY=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*Gateway: //"`
DOMAIN=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*Domain: //"`

rm /var/tmp/pump.out

echo IPADDR=$IPADDR . /etc/rc.d/pump.info
echo NETMASK=$NETMASK >> /etc/rc.d/pump.info
echo SUBNET_BASE=$NETWORK >> /etc/rc.d/pump.info
echo SUBNET_BROADCAST=$BROADCAST >>
/etc/rc.d/pump.info
echo GATEWAY=$GATEWAY >> /etc/rc.d/pump.info
echo HOSTNAME=$HOSTNAME >> /etc/rc.d/pump.info
echo DHCP_SERVER=$DHCP_SERVER>> /etc/rc.d/pump.info

sh /etc/init.d/iptables restart

exit 0
********************************************************************************
And soo after any where in the script where my IP ADDRESS is i put this
 
if [ -f /etc/rc.d/pump.info ]; then
     . /etc/rc.d/pump.info
 else

 echo "rc.firewall: dhcp is not configured."
 sh /ect/init.d/iptables panic
 exit 1 
fi
********************************************************************************
But it is not working:  here is what i get  when i reboot all that happen when
linux says: 

Starting up redhat network daemon:  
/etc/init.d/ipatables no such file or directory  <---- i didnt catch the whole
error cause it disappers to fast and cant find it in /var/log/boot.log but  i
know it is pretty close to the error!!  ANY HELP GUYS :((((( 

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ineeed of major help with  Dynamic IP Addy for my IPTABLES :(((
  2002-10-17  4:18 Ineeed of major help with Dynamic IP Addy for my IPTABLES :((( Tasha Smith
@ 2002-10-17  4:48 ` Tasha Smith
  2002-10-17  5:20   ` JeeBak Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Tasha Smith @ 2002-10-17  4:48 UTC (permalink / raw)
  To: netfilter

Ohh just soo you guys know "was i suppose to do this part to the rc.pump.done
script": 
"chmod -u=rwx /etc/rc.d/rc.pump.done" or should i have left that part out?????

And 1 more thing when i changed in the script
"sh /etc/init.d/iptables panic "to ----->" /etc/init.d/firewall panic


#!/bin/bash

if [ "$1" = "down" ]; then
    exit 0
fi

if [ "$1" = "lease" ]; then
    echo address $3 assigned to network interface $2 >
/dev/console
fi

/sbin/pump -i eth0 -s > /var/tmp/pump.out

IPADDR=`fgrep IP: /var/tmp/pump.out | sed -e "s/.*IP:
//"`
NETMASK=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*Netmask: //"`
BROADCAST=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*Broadcast: //"`
NETWORK=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*Network: //"`
DHCP_SERVER=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*DHCP_SERVER: //"`
GATEWAY=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*Gateway: //"`
DOMAIN=`fgrep IP: /var/tmp/pump.out | sed -e
"s/.*Domain: //"`

rm /var/tmp/pump.out

echo IPADDR=$IPADDR . /etc/rc.d/pump.info
echo NETMASK=$NETMASK >> /etc/rc.d/pump.info
echo SUBNET_BASE=$NETWORK >> /etc/rc.d/pump.info
echo SUBNET_BROADCAST=$BROADCAST >>
/etc/rc.d/pump.info
echo GATEWAY=$GATEWAY >> /etc/rc.d/pump.info
echo HOSTNAME=$HOSTNAME >> /etc/rc.d/pump.info
echo DHCP_SERVER=$DHCP_SERVER>> /etc/rc.d/pump.info

sh /etc/init.d/iptables restart  <---when i changed iptables to firewall retsart

exit 0
********************************************************************************
AND HERE WHEN I CHANGE IPTABLES TO FIREWALL sh/etc/init.d/firewall panic 

if [ -f /etc/rc.d/pump.info ]; then
     . /etc/rc.d/pump.info
 else

 echo "rc.firewall: dhcp is not configured."
 sh /etc/init.d/iptables panic <---when i changed this to firewall panic
 exit 1 
fi
********************************************************************************
WHEN I CHANGES THOSE 2 THINGS IPTABLES TO FIREWALL AND RESTART MY MACHINE ALL IT
WILL DO WHEN IT starts it SAYS 
STARTING UP REDHAT NETWORK DAEMON
DHCP IS NOT CONFIGURED
DHCP IS NOT CONFIGURED
DHCP IS NOT CONFIGURED
DHCP IS NOT CONFIGURED
DHCP IS NOT CONFIGURED
DHCP IS NOT CONFIGURED
DHCP IS NOT CONFIGURED
DHCP IS NOT CONFIGURED
"AND KEEPS SAYING THIS!"

Just thought i would let you know i tryed that!!!! And thats what happen  


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ineeed of major help with  Dynamic IP Addy for my IPTABLES :(((
  2002-10-17  4:48 ` Tasha Smith
@ 2002-10-17  5:20   ` JeeBak Kim
  0 siblings, 0 replies; 4+ messages in thread
From: JeeBak Kim @ 2002-10-17  5:20 UTC (permalink / raw)
  To: Tasha Smith; +Cc: netfilter

* Tasha Smith (natasha3641@yahoo.com) [021016 21:51]:
> Ohh just soo you guys know "was i suppose to do this part to the rc.pump.done
> script": 
> "chmod -u=rwx /etc/rc.d/rc.pump.done" or should i have left that part out?????
> 
> And 1 more thing when i changed in the script
> "sh /etc/init.d/iptables panic "to ----->" /etc/init.d/firewall panic
[snip]
> rm /var/tmp/pump.out
> 
> echo IPADDR=$IPADDR . /etc/rc.d/pump.info

Try changing the . to > in the above line.

> echo NETMASK=$NETMASK >> /etc/rc.d/pump.info
> echo SUBNET_BASE=$NETWORK >> /etc/rc.d/pump.info
> echo SUBNET_BROADCAST=$BROADCAST >> /etc/rc.d/pump.info
> echo GATEWAY=$GATEWAY >> /etc/rc.d/pump.info
> echo HOSTNAME=$HOSTNAME >> /etc/rc.d/pump.info
> echo DHCP_SERVER=$DHCP_SERVER>> /etc/rc.d/pump.info
[snip]

or better yet:

cat << EOF > /etc/rc.d/pump.info
IPADDR=$IPADDR
NETMASK=$NETMASK
SUBNET_BASE=$NETWORK
SUBNET_BROADCAST=$BROADCAST
GATEWAY=$GATEWAY
HOSTNAME=$HOSTNAME
DHCP_SERVER=$DHCP_SERVER
EOF



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Ineeed of major help with Dynamic IP Addy for my IPTABLES :(((
@ 2002-10-17  7:56 Tasha Smith
  0 siblings, 0 replies; 4+ messages in thread
From: Tasha Smith @ 2002-10-17  7:56 UTC (permalink / raw)
  To: netfilter

Sorry guys that was a type i worte here not in my script...it was right in my
script!
it is a   > instead of a . 


> > rm /var/tmp/pump.out
> > 
> > echo IPADDR=$IPADDR . /etc/rc.d/pump.info
> 
> Try changing the . to > in the above line. (it was a >   )
> 
> > echo NETMASK=$NETMASK >> /etc/rc.d/pump.info
> > echo SUBNET_BASE=$NETWORK >> /etc/rc.d/pump.info



__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-17  7:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-17  4:18 Ineeed of major help with Dynamic IP Addy for my IPTABLES :((( Tasha Smith
2002-10-17  4:48 ` Tasha Smith
2002-10-17  5:20   ` JeeBak Kim
  -- strict thread matches above, loose matches on Subject: below --
2002-10-17  7:56 Tasha Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox