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

need help about bind and dns



@ Home I have a 5 computer LAN so that I share files, internet etc. with my sibling and parents.
Currently to connect to the internet I use my Debian 2.1 using pon and then I run another script
I made called ipon which runs the ipfwadm stuff... then when I disconnect I use poff and then
ipoff which sets my network settings again so my network works after I disconnect... I also use
a server called dynamic IP (from dynip.com).

I run this dynipclient program and it will assign my current dynamic ip to something.dynip.com
and then I have a cname from my domain to point to that from something.mydomain.com

I really need to find a way to automate this so when I run pon/poff they will take care of my
ipfwadm setup and maybe my dynipcleint if possible.

The other thing is I really really want to find out how to make my computer believe it
is for example:   home.mydomain.com
since home.mydomain.com allready points to my IP

below I have including my pon, poff, ipon, ipoff, and /etc/init.d/network files if they help:

Thanks,
   Ramiel

---pon---
#!/bin/sh

/usr/sbin/pppd call ${1:-provider}
---------

---poff--
#!/bin/sh

# $Id: poff,v 1.4 1998/05/26 14:46:08 phil Exp $
# Written by Phil Hands <phil@hands.com>, distributed under the GNU GPL
SIG=TERM DONE=stopped;

getopts rdch FLAG
case $FLAG in
 "r") SIG=HUP  DONE=signalled; shift  ;;
 "d") SIG=USR1 DONE=signalled; shift ;;
 "c") SIG=USR2 DONE=signalled; shift ;;
 "h") cat <<!EOF!
usage: $0 [options] [provider]

options:
  -r        cause pppd to drop the line and redial
  -d        toggles the state of pppd's debug option
  -c        cause pppd to renegotiate compression
  -h        this help summary
!EOF!
    exit 1
    ;;
esac

PROVIDER=$1


# Lets see how many pppds are running....
set -- `cat /var/run/ppp*.pid 2>/dev/null`

case $# in
  0) # pppd only creates a pid file once ppp is up, so let's try killing pppd
     # on the assumption that we've not got that far yet.
     kill -${SIG} `ps axw | egrep "pppd call [[:alnum:]]+" | grep -v grep | awk '{print $1}'`
     exit 0
     ;;
  1) # If only one was running then it can be killed using the pid
     kill -${SIG} $1
     exit 0
     ;;
  *) # More than one! Aieehh.. We have to use ps to figure it out.
     # If no arguments were specified, then assume the 'provider' default.
     PID=`ps axw | egrep "pppd call ${PROVIDER:-provider}[[:space:]]*\$" | grep -v grep | awk '{print $1}'`
     if [ $PID ]; then
        kill -${SIG} ${PID}
        exit 0
     else
        echo "I could not find a pppd process or provider '${PROVIDER:-provider}'. None ${DONE}"
        exit 1
     fi
     ;;
esac
---------

---ipon--
/sbin/route add default ppp0
/sbin/ipfwadm -F -p deny
/sbin/ipfwadm -F -a m -S 192.168.1.0/24 -D 0.0.0.0/0
/usr/local/bin/dynipclient
---------

--ipoff--
/usr/local/bin/dynipclient -k
/etc/init.d/network
---------

-network-
#! /bin/sh
ifconfig lo 127.0.0.1
route add -net 127.0.0.0

#The below I setup for my ethernet card
IPADDR="192.168.1.1"    #This will be this computers IP on my LAN
NETMASK="255.255.255.0" #Should be ok
NETWORK="192.168.1.0"   #hope this is right
BROADCAST="192.168.1.255" #hope this is right
GATEWAY="205.226.156.1" #Let's hope this is going to work

#Setup eth0 to use the above shit
/sbin/ifconfig eth0 ${IPADDR} netmask ${NETMASK} up

#Route to my own network
/sbin/route add -net ${NETWORK} netmask ${NETMASK} eth0
---------



Ramiel Givergis, webmaster@relm.net, http://www.relm.net 
--------------------------~~~===<[^]>===~~~------------------------------ 
This mail is a natural product. The slight variations in spelling and 
grammar enhance its individual character and beauty and in no way are to 
be considered flaws or defects.


Reply to: