internet accelerators
    internet access
    internet and phone call
    web hosting
    storage space
    url redirection
    internet call waiting
    free sms
    nota bene

How to configure a tunnel on PPPoE connection with dynamic IP



Location A) Cisco 851. CiscoIOS version 12.4. PPPoE connection to internet with dynamic IP

Location B) Linux (Slackware). Internet connection with a stable IP

Problem to resolve: it is desired to make a GRE tunnel between Cisco and Linux

Possible solution: IP changes on Cisco are tracked by SNMP and reported (by traps) to SNMP daemon on Linux which updates tunnel with new IP

Cisco end configuration (configuration commands related to our problem showed only)

show conf 
vpdn-group 1
  protocol pppoe
 l2tp tunnel receive-window 128
interface Tunnel1
 ip address
 tunnel source Dialer1
 tunnel destination
interface FastEthernet4
 no ip address
 ip virtual-reassembly
 duplex auto
 speed auto
 pppoe enable group 1
 pppoe-client dial-pool-number 1
interface Vlan1
 ip address
 ip nat inside
 ip virtual-reassembly
 ip tcp adjust-mss 1452
interface Dialer1
 ip address negotiated
 ip mtu 1492
 ip nat outside
 ip virtual-reassembly
 encapsulation ppp
 ip tcp adjust-mss 1452
 no ip mroute-cache
 dialer pool 1
 dialer-group 1
 no keepalive
 no cdp enable
 ppp authentication chap callin
 ppp chap hostname USERNAME
 ppp chap password 7 ENCRYPTEDPASSWORD
 ppp pap sent-username USERNAME password 7 ENCRYPTEDPASSWORD
 no ppp pap wait
 ppp ipcp dns request
ip route Dialer1 permanent
ip route Tunnel1
ip nat inside source list 101 interface Dialer1 overload
access-list 101 permit ip any
snmp-server enable traps snmp linkup
snmp-server host version 2c SnmpTrap

Linux end configuration

# cat /etc/snmp/snmptrapd.conf
pidFile /var/run/snmptrapd.pid
logOption f /var/log/snmpdtraps.log
authCommunity log,execute ciscotrap
traphandle IF-MIB::linkUp /etc/snmp/traphandle

# cat /etc/snmp/traphandle 

while read <&0
awk '$1 ~ "UDP:" {split ($2, A, "["); split (A[2], B, "]"); print B[1] }'
done | /etc/rc.d/rc.tun restart

# cat /etc/rc.d/rc.tun


tun_stop () {
ip link set my_tunnel down ;
ip tunnel del my_tunnel ;

tun_start () {
read IP <&0
ip tunnel add my_tunnel mode gre remote $IP local $local ttl 255 ;
ip addr add dev my_tunnel ;
ip link set dev my_tunnel up ;
ip route add dev my_tunnel;

case $1 in

# snmptrapd -c /etc/snmp/snmptrapd.conf

# snmptrapd -v

NET-SNMP Version:  5.4