FreeBSD PPP config for 3G modems
This is an example ppp configuration that allows connection to KPN networks (NL). See also the Wiki page with list of all APNs.
- The destination IP address negotiated by PPP when using KPN as your provider is invalid. You need to set up the default route to the interface, not the IP address, hence the ppp.link* scripts.
- KPN does not hand out DNS servers, or at least, not that I can see. Add entries from OpenDNS, Google (18.104.22.168 and 22.214.171.124) or other free DNS resolvers.
kpn: set device /dev/cuaU0.0 set speed 384000 set timeout 0 set authname KPN set authkey gprs set dial "ABORT BUSY TIMEOUT 2 \ \"\" \ AT OK-AT-OK \ AT+CFUN=1 OK-AT-OK \ AT+CMEE=2 OK-AT-OK \ AT+CSQ OK \ AT+CGDCONT=1,\\\"IP\\\",\\\"internet\\\" OK \ AT+CGACT? OK-AT-OK \ AT+CGATT? OK \ AT+CGCLASS? OK \ AT+COPS? OK \ ATD*99***1# CONNECT" ## Lower the MTU as this seems to make the link more stable for GPRS connections. #set mtu maximum 296 #set mru maximum 296 set crtscts on disable vjcomp disable acfcomp disable deflate disable deflate24 disable pred1 disable protocomp disable mppe disable ipv6cp disable lqr disable echo nat enable yes enable dns resolv writable set dns 126.96.36.199 188.8.131.52 # openDNS set ifaddr 10.1.0.2/0 10.1.0.1/0 255.255.255.255 0.0.0.0 #add default HISADDR # See ppp.link*
kpn: shell route delete default shell route add default -interface INTERFACE
default: shell logger "LABEL down (up UPTIME): OCTETSIN received, OCTETSOUT sent" kpn: shell route delete default
PPP configuration troubleshooting
Warning: iface add: ioctl(SIOCAIFADDR, 184.108.40.206 -> 0.0.0.0): Destination address required
means: the other party is not providing an IP address. Change the set ifaddr line to something like:
set ifaddr 10.1.0.2/0 10.1.0.1/0 255.255.255.255 0.0.0.0
with the second argument a valid IP address, but with a /0 mask.