Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Oct 1998 10:53:24 -0700
From:      Jeff Kletsky <Jeff@Wagsky.com>
To:        questions@FreeBSD.ORG
Subject:   ppp -auto -alias and 1st connection w/ dynamic IP
Message-ID:  <l03110700b23eb36a384f@[192.168.6.3]>

next in thread | raw e-mail | index | archive | help
With an ISP that provides dynamically-assigned IP numbers, I am observing that

ppp -auto -alias sf

will dial properly when a command such as

telnet some.outside.host

is issued, but the connection is not established.  Once the link is up,
everything seems to function "correctly."  (telnet "immediately" connects)

My guess is that the packets which caused the dial to occur are
(incorrectly) aliased to the "last" IP number assigned to the interface.
When the link comes up, the interface's new address is different -- the
return packets are not recognized as destined for the PPP-client machine
(not to mention that the ISP's routers are sending the packet to another
machine!).

Virtually the same configuration works quite well with a static IP address.

Is there a way to change this behavior so that an initial connection is
properly established when using demand dialing, aliasing, and dynamically
assigned IP?


Thanks!

Jeff



Notes:

in ppp.conf,
 ! /sbin/ipfw add 100 allow all from MYADDR to any out via tun0
is to allow packets for the inital "dummy" tun0 address to pass and
initiate dialing.  Subsequent dial attempts are from the "last" IP address,
and the firewall is still passing them (it is not reset or closed when the
link goes down).

in ppp.linkup,
 ! /etc/firewall/firewall.ppp MYADDR
resets the firewall rules to reflect the "new" value (MYADDR) for the tun0
interface IP address.



%%%%% ppp.conf:
#################################################################
#
#  	PPP  Sample Configuration File
#
#	  Written by Toshiharu OHNO
#
# $Id: ppp.conf,v 1.3.1.1 1997/11/15 23:54:27 root Exp root $
#
#################################################################

# Default setup. Always executed when PPP is invoked.
#
# Modem initialization:
#
# &F1	Hardware flow control template
# M0	Speaker off
# &U14	Minimum carrier of 28,800
# &N0	No maximum carrier
# S7	Wait time for carrier

default:
 set log Carrier Connect Link Phase IPCP
 set server /var/run/tun0.ctl 0177
 set device /dev/cuaa1
 set speed 115200
 set dial "TIMEOUT 3   ABORT BUSY   ABORT \"NO CARRIER\"   ABORT \"NO
DIAL\"   \"\" AT   OK-+++-OK ATH0   OK AT\&F0M1W2S7=40   OK \"ATDT \\\\T\"
TIMEOUT 70   CONNECT \"\""
 set redial 1.1 5
 enable throughput
 deny lqr
 set timeout 300
 load filters
 load ntpdrop
 show route

#
# Dialup and keep-alive filters
#

nodial:
 set dfilter -1
 set dfilter 19 deny

#
# No ICMP for dialup or keep-alive
#
filters:
 set dfilter -1
 set dfilter  0 deny icmp
 set dfilter 19 permit 0/0 0/0
 set afilter -1
 set afilter  0 deny icmp
 set afilter 19 permit 0/0 0/0

#
# No NTP passes when link is down
#
ntpdrop:
 set ofilter  0 deny udp src eq 123
 set ofilter  1 deny udp dst eq 123
 set ofilter 19 permit 0/0 0/0

#
# but NTP permitted when link is up
#
ntppass:
 set ofilter  0 permit udp src eq 123
 set ofilter  1 permit udp dst eq 123
 set ofilter 19 permit 0/0 0/0

alias_options:
 alias same_ports yes
 alias use_sockets yes
 alias unregistered_only yes

# Common stuff for all Best Communications pops

best:
 set authname "*****"
 set authkey "*****"
 set login "TIMEOUT 10   ogin:--ogin: \\U   assword: \\P"
 set ifaddr  192.168.0.1/0 10.0.0.1/0 255.255.255.0 0.0.0.0
 ! /sbin/ipfw add 100 allow all from MYADDR to any out via tun0
 delete default
 delete ALL
 add 0 0 HISADDR
 load alias_options

sf:
 load best
 set phone 555-5555
 show modem
 show route

%%%%% ppp.linkup:
MYADDR:
 set ofilter  0 permit udp src eq 123
 set ofilter  1 permit udp dst eq 123
 set ofilter 19 permit 0/0 0/0
 delete ALL
 add 0 0 HISADDR
 ! echo MYADDR
 ! /etc/firewall/firewall.ppp MYADDR

%%%%%
ppp.linkdown:
MYADDR:
 set ofilter  0 deny udp src eq 123
 set ofilter  1 deny udp dst eq 123
 set ofilter 19 permit 0/0 0/0




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?l03110700b23eb36a384f>