15.2. Using User PPP

Originally contributed by Brian Somers , with input from Nik Clayton , Dirk-Willem van Gulik , and Peter Childs .

15.2.1. User PPP

15.2.1.1. Assumptions

This document assumes you have the following:

  • An account with an Internet Service Provider (ISP) which you connect to using PPP. Further, you have a modem or other device connected to your system and configured correctly, which allows you to connect to your ISP.

  • The dial-up number(s) of your ISP.

  • Your login name and password. This can be either a regular UNIX-style login and password pair, or a PAP or CHAP login and password pair.

  • The IP address(es) of one or more name servers. Normally, you will be given two IP addresses by your ISP to use for this. If they have not given you at least one, then you can use the enable dns command in your ppp.conf file to tell ppp to set the name servers for you.

The following information may be supplied by your ISP, but is not completely necessary:

  • The IP address of your ISP's gateway. The gateway is the machine to which you will connect and will be set up as your default route. If you do not have this information, we can make one up and your ISP's PPP server will tell us the correct value when we connect.

    This IP number is referred to as HISADDR by ppp.

  • The netmask you should use. If your ISP has not provided you with one, you can safely use 255.255.255.0.

  • If your ISP provides you with a static IP address and hostname, you can enter it. Otherwise, we simply let the peer assign whatever IP address it sees fit.

If you do not have any of the required information, contact your ISP and make sure they provide it to you.

15.2.1.2. Ä¿³Î Áغñ

¾Õ¿¡¼­ ±â¼úÇßµíÀÌ, ppp ´Â Ä¿³ÎÀÇ tunÀåÄ¡¸¦ »ç¿ëÇÕ´Ï´Ù. µû¶ó¼­ tun configured. tunÀåÄ¡´Â ±âº»GENERIC Ä¿³Î¿¡ ÀÌ¹Ì ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù. ±×·¯³ª, Ä¿³ÎÀ» À缳ġ ÇÒ¶§¿¡´Â ppp¼³Á¤À» ²À È®ÀÎÇØ¾ß ÇÕ´Ï´Ù.

À̰ÍÀ» üũÇÏ·Á¸é, /sys/i386/conf³ª /sys/pc98/conf¿¡¼­ Ä¿³Î ¼³Á¤ÆÄÀÏÀ» È®ÀÎÇÕ´Ï´Ù. ¾Æ·¡ÀÇ ³»¿ëÀÌ Æ÷ÇԵǾî ÀÖ¾î¾ß ÇÕ´Ï´Ù:

    pseudo-device   tun        1

À§ÀÇ ³»¿ëÀÌ ¼³Á¤ÆÄÀÏ¿¡ ºüÁ®ÀÖ´Ù¸é, Ãß°¡ÇÑ ÈÄ Ä¿³ÎÀ» ÀçÄÄÆÄÀÏÇϰí ÀνºÅçÇØ¾ß ÇÕ´Ï´Ù. GENERICÄ¿³ÎÀº ÀÌ ³»¿ëÀ» Æ÷ÇÔ Çϰí Àֱ⠶§¹®¿¡, ¿©·¯ºÐÀÌ »õ·Î¿î Ä¿³ÎÀ» ¼³Ä¡ÇÏÁö ¾Ê°Å³ª, /sys µð·ºÅ丮°¡ ¾ø´Ù¸é Ä¿³ÎÀ» º¯°æÇÒ Çʿ䰡 ¾ø ½À´Ï´Ù. Ä¿³Î ¼³Ä¡¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ ³»¿ëÀº kernel configurationÀ» ÂüÁ¶ÇÏ½Ê ½Ã¿ä.

¾Æ·¡ÀÇ ¸í·ÉÀ» ÅëÇØ ÇöÀç Ä¿³Î¿¡ ÅͳÎÀåÄ¡°¡ ¸î°³³ª ¼³Á¤µÇ¾î ÀÖ´ÂÁö ¾Ë¾Æº¼ ¼ö ÀÖ½À´Ï´Ù:

    # ifconfig -a
    tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
            inet 200.10.100.1 --> 203.10.100.24 netmask 0xffffffff
    tun1: flags=8050<POINTOPOINT,RUNNING,MULTICAST> mtu 576
    tun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
            inet 203.10.100.1 --> 203.10.100.20 netmask 0xffffffff
    tun3: flags=8010<POINTOPOINT,MULTICAST> mtu 1500

Note: FreeBSD 4.0 ÀÌ»óÀÇ ¹öÀü¿¡¼­´Â ÀÌ¹Ì »ç¿ëµÇ´Â ¸î°³ÀÇ tun ÀåÄ¡¸¦ º¼ ¼ö ÀÖ½À´Ï´Ù. used. This means you might not see any tun devices. If this is the case, do not worry; the device should be created dynamically when ppp attempts to use it.

À§ÀÇ °æ¿ì´Â ³×°³ÀÇ ÀåÄ¡°¡ º¸À̰í ÀÖ°í, ÀÌÁß µÎ °³´Â Áö±Ý ¼³Á¤ µÇ¾î »ç¿ëµÇ°í ÀÖ½À´Ï´Ù. À§ÀÇ RUNNNINGÇ÷¡±×´Â ÀÎÅÍÆäÀ̽º°¡ ¾î¶»°Ô »ç¿ëµÇ°í Àִ°¡¸¦ º¸¿©Áشٴ °Í¿¡ ÁÖ¸ñÇØ¾ß ÇÕ ´Ï´Ù. --ÀÎÅÍÆäÀ̽º°¡ RUNNINGÀ¸·Î ³ªÅ¸³ªÁö ¾Ê¾Ò ´Ù°í ÇØ¼­ ¹®Á¦µÉ °ÍÀº ¾ø½À´Ï´Ù.

tun ÀåÄ¡¸¦ Áö´ÏÁö ¾ÊÀº Ä¿³ÎÀ» ¾²°í ÀÖ ´Âµ¥, »çÁ¤¿¡ ÀÇÇØ ´Ù½Ã ¸¸µéÁö ¸ø ÇÏ´Â °æ¿ìµµ ÀÖ½À´Ï´Ù. µ¿ÀûÀ¸·Î ÄÚ µå¸¦ ÀоîµéÀÏ ¼ö¸¸ ÀÖÀ¸¸é µË´Ï´Ù. ´õ ÀÚ¼¼ÇÑ »çÇ×Àº modload(8) ¿Í lkm(4) ÀÇ ÇØ´ç ¸ÇÆäÀÌÁö¸¦ ÂüÁ¶ÇϽʽÿÀ.

15.2.1.3. tun ÀåÄ¡ °Ë»ç

´ëºÎºÐÀÇ »ç¿ëÀÚ¿¡°Ô´Â ¿ÀÁ÷ ÇϳªÀÇ tun ÀåÄ¡¸¸(/dev/tun0)ÀÌ ÇÊ¿äÇÒ °ÍÀÔ´Ï´Ù. Çϳª ÀÌ»ó À» °¡Áö°í ÀÖ´Ù¸é, Áï Ä¿³Î ¼³Á¤ÆÄÀÏÀÇ pseudo-device ºÎºÐ¿¡ 2ÀÌ»óÀÇ ¼ýÀÚÀÎ °æ¿ì¿¡´Â ¾Æ·¡ ¸ðµç ºÎºÐ¿¡¼­ tun ´ë½Å¿¡ »ç¿ëÇÏ´Â ÀåÄ¡ÀÇ ¼ýÀÚ·Î º¯°æÇØ ÁֽʽÿÀ.

tun0 ÀåÄ¡°¡ Á¦´ë·Î ¼³Ä¡µÇ¾ú´ÂÁö È®ÀÎÇÏ´Â °¡Àå °£´ÜÇÑ ¹æ¹ýÀº ´Ù½Ã ¸¸µå´Â °ÍÀÔ´Ï´Ù. À̸¦ À§ÇØ ´ÙÀ½ÀÇ ¸í·ÉÀ» ½ÇÇà ½ÃŰ½Ê½Ã¿À::

    # cd /dev
    # ./MAKEDEV tun0

Ä¿³Î¿¡ 16°³ÀÇ ÅͳΠÀåÄ¡¸¦ »õ·Î ¸¸µé·Á¸é, ´ÙÀ½ÀÇ ¸í·ÉÀ» ½ÇÇà ½ÃŰ½Ê½Ã ¿À:

    # cd /dev
    # ./MAKEDEV tun15

Ä¿³ÎÀÌ Á¦´ë·Î ¼³Á¤µÇ¾úÀ½À» È®ÀÎÇÏ·Á¸é, ´ÙÀ½ÀÇ ¸í·ÉÀ» ½ÇÇàÇØ °á°ú ¸¦ ºñ±³ÇÕ´Ï´Ù::

    # ifconfig tun0
    tun0: flags=8050<POINTOPOINT,RUNNING,MULTICAST> mut 1500

RUNNING Ç÷¡±×°¡ ¾ÆÁ÷ ¼³Á¤µÇ¾î ÀÖÁö ¾ÊÀ» ¼öµµ Àִµ¥, ÀÌ °æ¿ì ´ÙÀ½°ú °°ÀÌ ³ªÅ¸³³´Ï´Ù::

    # ifconfig tun0
    tun0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500

Remember from earlier that you might not see the device if it has not been used yet, as tun devices are created on demand in FreeBSD 4.0 and later releases.

15.2.1.4. À̸§ ÇØ¼®(Name Resolution) ¼³Á¤

ÇØ¼®±â(resolver)´Â IP ÁÖ¼Ò¸¦ È£½ºÆ®³×ÀÓ(hostnames)À¸·Î, ¶Ç´Â ±×¿ª À¸·Î º¯È¯½ÃŰ´Â ½Ã½ºÅÛÀÇ ÀϺÎÀÔ´Ï´Ù. µÎ Àå¼Ò Áß ÇÑ °÷¿¡ IPÁÖ¼Ò¿¡ È£½º Æ®³×ÀÓ ¸ÅÇÎ(mapping)À» ±â¼úÇÑ ¸ÊÀ» ãµµ·Ï ¼³Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿ì¼± ¼³ Á¤ÇÒ ÆÄÀÏÀº /etc/hosts (hosts(5))ÀÔ´Ï´Ù. ´Ù À½À¸·Î ¹èÆ÷µÇ´Â µ¥ÀÌÅͺ£À̽ºÀÎ DNS(µµ¸ÞÀÎ ³×ÀÓ¼­ºñ½º)ÀÔ´Ï´Ù. ±× ·¯³ª DNS´Â ÀÌ ¹®¼­¿¡¼­ ´Ù·ç´Â ¹üÁÖ¸¦ ¹þ¾î³ª±â ¶§¹®¿¡ ¾ð ±ÞÇÏÁö ¾Ê½À´Ï´Ù.

ÇØ¼®±â´Â À̸§ ¸ÊÇÎÇØÁÖ´Â ½Ã½ºÅÛ È£Ãâ(system call)ÀÇ ÁýÇÕüÀÌÁö¸¸, ÀÌ Á¤º¸¸¦ ¾îµð¼­ ãÀ» °ÍÀÎÁö¸¦ ¾Ë·ÁÁÖ¾î¾ß ÇÕ´Ï´Ù. À̸¦ À§ÇØ ¿ì¼± /etc/host.conf¸¦ ÆíÁýÇÕ´Ï´Ù. È¥µ¿ÇÒ¼öµµ Àִµ¥ /etc/hosts.conf ¶ó°í(note the extra s) ÇÏÁö ¸¶½Ê½Ã¿À.

15.2.1.4.1. /etc/host.conf ÆÄÀÏ ÆíÁý

ÀÌ ÆÄÀÏÀº ´ÙÀ½ÀÇ ÁÖ ÁÙÀ» ¼ø¼­´ë·Î Æ÷ÇÔÇØ¾ß¸¸ ÇÕ´Ï´Ù:

    hosts
    bind

ÀÌ´Â ¿ì¼± ÇØ¼®±â°¡ ÆÄÀÏ /etc/hosts¿¡¼­ 㠾ƺ¸µµ·Ï Çϰí, ±× ÈÄ DNS¿¡ ¹®ÀÇÅä·Ï ÇÏ´Â °ÍÀÔ´Ï´Ù.

15.2.1.4.2. /etc/hosts ÆÄÀÏ ÆíÁý

ÀÌ ÆÄÀÏÀº ³×Æ®¿öÅ©»óÀÇ ÄÄÇ»ÅÍÀÇ À̸§°ú IPÁÖ¼Ò¸¦ Æ÷ÇÔÇϰí ÀÖ¾î¾ß ÇÕ´Ï´Ù. ÃÖ¼ÒÇÑ ppp¸¦ ½ÇÇà½Ãų ÄÄÇ»ÅÍIPÁÖ¼Ò¶óµµ Æ÷ÇÔÇØ¾ß ÇÕ´Ï´Ù. ¿¹ ¸¦ µé¾î IPÁÖ¼Ò°¡ 10.0.0.1ÀÎ foo.bar.comÀ̶ó´Â ÄÄÇ»ÅͰ¡ ÀÖ´Ù¸é, with the IP address , /etc/hosts ÆÄÀÏÀº ´ÙÀ½À» Æ÷ÇÔÇØ¾ß ÇÕ´Ï´Ù:

    127.0.0.1       localhost.bar.com        localhost
    127.0.0.1       localhost.bar.com.
    10.0.0.1        foo.bar.com                foo
    10.0.0.1        foo.bar.com.

ù¹øÂ°ÁÙÀº ÇöÀç ÄÄÇ»ÅÍÀÇ µ¿ÀǾî·Î¼­ Àϸí localhost ¶ó°í Á¤ÀÇÇϰí ÀÖ½À´Ï´Ù. IPÁÖ¼Ò¸¦ »ý°¢ÇÒ ÇÊ¿ä¾øÀÌ ÀÌ ÁÙ¿¡ ´ëÇÑ IPÁÖ¼Ò´Â Ç×»ó 127.0.0.1À̾î¾ß ÇÕ´Ï´Ù. µÎ¹øÂ° ÁÙÀº foo.bar.com (ª°Ô Ç¥ÇöÇÑ´Ù¸é foo ÀÔ´Ï´Ù) ¿¡ IPÁÖ¼Ò¸¦ 10.0.0.1·Î ¸í¸íÇϰí ÀÖ½À´Ï´Ù.

ȤÀº ISP¿¡¼­ °íÁ¤ IPÁÖ¼Ò¿Í À̸§À» ÇÒ´ç ¹Þ¾Ò´Ù¸é, 10.0.0.1 ÀÌ ÀÖ´Â ÀÚ¸®¿¡ ±×°ÍµéÀ» ±âÀÔ ÇÕ´Ï´Ù.

15.2.1.4.3. /etc/resolv.conf ÆÄÀÏ ÆíÁý

/etc/resolv.conf ´Â ÇØ¼®±â°¡ ¾î¶»°Ô µ¿ÀÛÇØ¾ß ÇÏ´ÂÁö¸¦ ¾Ë·ÁÁÝ´Ï´Ù. ÄÄÇ»ÅÍ ÀÚü°¡ DNS·Î µ¿ÀÛÀ» ÇÑ´Ù¸é ÀÌ ºÎºÐÀ» °ø¹é À¸·Î ³²°ÜµÓ´Ï´Ù. º¸Åë ´ÙÀ½°ú °°ÀÌ ±âÀÔÇÕ´Ï´Ù:

    domain bar.com
    nameserver x.x.x.x
    nameserver y.y.y.y

x.x.x.x ¿Í y.y.y.y ÁÖ¼Ò´Â ISP¿¡¼­ Á¦°øÇÏ´Â °ÍÀÔ´Ï´Ù. ISP¿¡¼­ Á¦°øÇÏ´Â ´ë·Î nameserver ÁÙÀ» Ãß°¡ÇϽʽÿÀ. domain ÁÙÀº È£½ºÆ®³×ÀÓÀÇ µµ¸ÞÀÎ ÀÇ ±âº»°©À» Á¤ÇÏ´Â °ÍÀε¥, Çʼö»çÇ×À» ¾Æ´Õ´Ï´Ù. ÀÌ ÆÄÀÏÀÇ ´õ ÀÚ¼¼ÇÑ ¿£Æ®¸®¿¡ ´ëÇØ °ÍÀº resolv.conf(5) ¸Þ´º¾ó ÆäÀÌÁö¸¦ ÂüÁ¶ÇϽýÿÀ.

¹öÀü 2 ÀÌÈÄÀÇ ppp¸¦ ½ÇÇàÇÏ´Â °æ¿ì, enable dns ¸í·É À¸·Î ppp°¡ ISP¿¡ ³×ÀÓ¼­¹ö °ªÀ» È®ÀÎÇϵµ·Ï ¿äû ÇÒ ¼ö ÀÖ½À´Ï´Ù. ISP°¡ ´Ù¸¥ ÁÖ¼Ò¸¦ Á¦°øÇϰųª /etc/resolv.conf)¿¡ ¾î¶°ÇÑ ³×ÀÓ¼­¹ö µµ ±âÀçµÇ¾î ÀÖÁö ¾Ê´Ù¸é, PPP´Â ISP¿¡¼­ ´Ù½Ã Á¦°øµÈ °ªÀ¸·Î ÆÄÀÏÀ» ´Ù½Ã ¾² °ÔµË´Ï´Ù.

15.2.1.5. PPP ¼³Á¤

Ä¿³Î ¼öÁØ PPP±¸Çö¿¡¼­´Â »ç¿ëÀÚ ppp ¿Í pppd ¸ðµÎ /usr/share/examples/ppp µð·ºÅ丮¿¡ À§Ä¡ÇÑ ¼³Á¤ ÆÄÀϵéÀ» ÀÌ¿ëÇÕ´Ï´Ù. Á¦°øµÈ ¼³Á¤ ¿¹Á¦ ÆÄÀÏÀº »ç¿ëÀÚ ppp¸¦ ¼³Á¤Çϴµ¥ ¸Å¿ì À¯¿ëÇϹǷΠ»èÁ¦ÇÏÁö ¾Ê½À´Ï´Ù.

ppp ¸¦ ¼³Á¤ÇÏ·Á¸é Çʿ信 µû¶ó ¸î°³ÀÇ ÆÄÀÏÀ» ÆíÁýÇØ¾ß ÇÕ´Ï´Ù. ÆíÁýÇØ¾ß ÇÒ ÆÄÀÏÀº ISP¿¡¼­ °íÁ¤ IPÁÖ¼Ò¸¦ ÇÒ´çÇÏ´ÂÁö, À¯µ¿ IPÁÖ¼Ò¸¦ ÇÒ´çÇÏ´ÂÁö¿¡ ¿µÇâÀ» ¹Þ½À´Ï´Ù.

15.2.1.5.1. PPP ¿Í °íÁ¤ IP ÁÖ¼Òs

ÀÌÁ¦ /etc/ppp/ppp.conf¶ó´Â ¼³Á¤ÆÄÀÏÀ» ¸¸µé¾î¾ß ÇÕ´Ï´Ù. ¾Æ¸¶ ¾Æ·¡ÀÇ ¿¹Á¦¿Í ºñ½ÁÇÏ°Ô µÉ °ÍÀÔ´Ï´Ù.

Note: : ·Î ³¡³­ ÁÙÀº ¹Ù·Î ù ¹øÂ° ¿­(column)¿¡¼­ ½ÃÀÛ µÇ¾î¾ß ÇÑ´Ù´Â °Í°ú, ±× ¹ÛÀÇ ÁÙÀº ºóÄ­À̳ª ÅÇÀ¸·Î µé¿©¾²±â°¡ µÇ¾î¾ß ÇÑ´Ù´Â Á¡À» ÁÖÀÇÇϽʽÿÀ.

    1     default:
    2       set device /dev/cuaa0
    3       set speed 115200
    4       set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" ATE1Q0 OK-AT-OK \\dATDT\\TTIMEOUT 40 CONNECT"
    5     provider:
    6       set phone "(123) 456 7890"
    7       set login "TIMEOUT 10 \"\" \"\" gin:--gin: foo word: bar col: ppp"
    8       set timeout 300
    9       set ifaddr x.x.x.x y.y.y.y 255.255.255.0 0.0.0.0
    10      add default HISADDR       
    11      enable dns

ÁÙ ¹øÈ£´Â ³ÖÁö ¸¶½Ê½Ã¿À.ÀÌ´Â ´ÜÁö ¼³¸íÀÇ ÆíÀǸ¦ À§ÇÔÀÔ´Ï´Ù.

Line 1:

±âº» ¿£Æ®¸®(default entry)ÀÓÀ» ³ªÅ¸³À´Ï´Ù. ¿©±â¿¡ ÀûÈù ¸í·ÉµéÀº ppp°¡ ½ÇÇàµÉ ¶§ ÀÚµ¿À¸·Î ½ÇÇàµË´Ï´Ù.

Line 2:

¸ðµ©ÀÌ ¿¬°áµÇ¾î ÀÖ´Â ÀåÄ¡¸¦ ¸í½ÃÇÕ´Ï´Ù. COM1 Àº /dev/cuaa0 À̰í, COM2 Àº /dev/cuaa1ÀÔ´Ï´Ù.

Line 3:

¿¬°á¼Óµµ¸¦ Á¤ÇÕ´Ï´Ù. 115200ÀÇ ¼Óµµ·Î ÀÛµ¿ÇÏÁö ¾Ê´Â´Ù¸é, ´ë½Å 38400ÀÇ ¼Óµµ·Î ½ÃµµÇØ º¸½Ê½Ã¿À.

Line 4:

ÀüÈ­°É±â(dial) ½ÇÇà ¹®Àå. »ç¿ëÀÚ ppp´Â chat(8) ÇÁ·Î±×·¥°ú À¯»çÇÑ ´ë±â-ÅëÈ­(expect-send)¹®¹ýÀ» »ç¿ëÇÕ´Ï´Ù. ÀÌ ¾ð¾îÀÇ Æ¯Â¡¿¡ ´ëÇØ ¼­´Â ¸Þ´º¾ó ÆäÀÌÁö¸¦ ÂüÁ¶ÇϽʽÿÀ.

Line 5:

"provider"¶ó°í ¸í¸íµÈ ISP¿¡ ´ëÇÑ ¿£Æ®¸®¸¦ ¸í½ÃÇÕ´Ï´Ù.

Line 6:

ISPÀÇ ÀüÈ­¹øÈ£¸¦ ±âÀÔÇÕ´Ï´Ù. ¿©·¯ °³ÀÇ ÀüÈ­¹øÈ£ÀÎ °æ¿ì¿£ ºÐ·ù±âÈ£·Î (:) ¶Ç´Â (|)¸¦ »ç¿ëÇØ ±âÀÔÇÕ´Ï´Ù. µÎ ºÐ·ù±âÈ£ÀÇ Â÷ÀÌÁ¡Àº ppp(8) ¸Þ´º¾ó ÆäÀÌÁö¿¡ ±â¼úµÇ¾î ÀÖ½À´Ï´Ù. ¿ä¾àÇϸé, ¹øÈ£¸¦ °è¼Ó ¹ø°¥¾Æ °¡¸é¼­ ½ÃµµÇÏ·Á¸é (:)À» »ç¿ëÇϰí, ù½Ãµµ¿¡´Â ²À ù¹øÂ° ¹øÈ£¸¸À» »ç¿ëÇϰí À̰ÍÀÌ ½ÇÆÐÇßÀ» ¶§¸¸ ´Ù¸¥ ¹øÈ£¸¦ ÀÌ¿ëÇÏ·Á ¸é (|)¸¦ »ç¿ëÇÕ´Ï´Ù. À§ÀÇ °æ¿ìó·³ Ç×»ó ¸ðµÎ¸¦ ÀοëºÎÈ£·Î ½Î ÁÖ¾î¾ß ÇÕ´Ï´Ù.

Line 7:

·Î±×ÀÎ ¹®ÀåÀº ÀüÈ­°É±â ¹®ÀåÀ¸·Î chat°ú ºñ½ÁÇÑ ¹®¹ýÀ¸·Î µÇ¾î ÀÖ½À´Ï´Ù. ÀÌ ¿¹Á¦ ¹®ÀåÀº ·Î±×ÀÎ ¼¼¼ÇÀÌ ´ÙÀ½°ú °°ÀÌ º¸ÀÌ´Â ¼­ºñ½º¿¡¼­ ÀÛµ¿ÇÕ´Ï ´Ù:

    J. Random Provider
    login: foo
    password: bar
    protocol: ppp

À§ ¿¹Á¦ÀÇ ³»¿ëÀ» ¿©·¯ºÐ¿¡°Ô ¸Â°Ô º¯°æÇÏ¸é µË´Ï´Ù.

PAP ³ª CHAP¸¦ »ç¿ëÇÏ´Â °æ¿ì ÀÌ ÁöÁ¡¿¡¼­ ·Î±×ÀÎÀ» ÇÏÁö ¾Ê±â ¶§¹®¿¡ ·Î±×ÀÎ ¹®ÀåÀ» ºñ¿öµÑ ¼ö ÀÖ½À´Ï´Ù. ´õ ÀÚ¼¼ÇÑ °ÍÀº PAP ¿Í CHAP ÀÎÁõ À» º¸½Ê½Ã¿À.

Line 8:

¿¬°á½Ã ±âº» ŸÀӾƿô(timeout)À» ÃÊ´ÜÀ§·Î Á¤ÇÕ´Ï´Ù. ¿¹Á¦ÀÇ °æ¿ì, 300ÃÊ ÈÄ¿¡´Â ÀÚµ¿À¸·Î ¿¬°áÀÌ ²÷¾îÁý´Ï´Ù. ŸÀӾƿôÀ» ¼³Á¤ÇÏÁö ¾ÊÀ¸·Á¸é, °ªÀ» 0À¸·Î ¼³Á¤ÇØ ÁÝ´Ï´Ù.

Line 9:

ÀÎÅÍÆäÀ̽ºÀÇ ÁÖ¼Ò¸¦ Á¤ÇÕ´Ï´Ù. ¹®Àå x.x.x.x ´Â ISP¿¡¼­ Á¦°øÇÑ IPÁÖ¼Ò·Î ¹Ù²Ù¾î¾ß ÇÕ´Ï´Ù. ¹®Àå y.y.y.y´Â ISP¿¡¼­ °ÔÀÌÆ®¿þÀÌ¿¡ ¸í½ÃÇÑ IPÁÖ¼Ò·Î ¹Ù²Ù¾î¾ß ÇÕ´Ï´Ù. ISP¿¡¼­ °ÔÀÌÆ®¿þÀ̸¦ Á¦°øÇÏÁö ¾Ê¾Ò´Ù¸é, 10.0.0.2/0¸¦ »ç¿ëÇϽʽÿÀ. "guessed" ÁÖ¼Ò¸¦ »ç¿ëÇØ¾ß ÇÑ´Ù¸é, PPP and Dynamic IP addresses¿¡ µû¶ó /etc/ppp/ppp.linkup ¿¡ ¿£Æ®¸®¸¦ ¸¸µé¾ú´ÂÁö È®ÀÎÇϽýÿÀ. ¸¸¾à ºüÁ³´Ù¸é, ppp ´Â -auto ȤÀº -dynamic¸ðµå·Î ½ÇÇàµÉ ¼ö ¾ø½À ´Ï´Ù.

Line 10:

ISPÀÇ °ÔÀÌÆ®¿þÀÌ¿¡ ±âº» ¶ó¿ìÆ®(route)¸¦ Ãß°¡ÇÕ´Ï´Ù. ƯÀÌÇÑ ´Ü¾î HISADDRÀº 9¹øÂ° ÁÙ¿¡ »ó¼úÇÑ °ÔÀÌÆ®¿þÀÌ ÁÖ¼Ò·Î Ä¡ ȯµË´Ï´Ù. Áß¿äÇÑ Á¡À» ÀÌ ÁÙÀÌ 9¹øÂ° ÁÙ ÀÌÈÄ·Î ³ª¿Í¾ß ÇÑ´Ù´Â Á¡ÀÔ´Ï´Ù. ±×·¸°Ô ÇÏÁö ¾ÊÀ¸¸ç HISADDRÀº ÃʱâÈ­ µÇÁö ¾Ê½À´Ï´Ù.

Line 11:

PPP°¡ ISP¿¡°Ô ³×ÀÓ¼­¹ö ÁÖ¼ÒµéÀÌ ¿Ã¹Ù¸¥Áö È®ÀÎÇϱ⸦ ¿äûÄÉÇÕ´Ï´Ù. ISP°¡ ÀÌ·¯ÇÑ ±â´ÉÀ» Áö¿øÇϸé, PPP´Â ¿Ã¹Ù¸¥ ³×ÀÓ¼­¹ö ¿£Æ®¸®·Î /etc/resolv.conf¸¦ °»½ÅÇÒ¼ö ÀÖ½À´Ï´Ù.

°íÁ¤ IPÁÖ¼Ò¸¦ »ç¿ëÇÑ´Ù¸é, ¿¬°áÇϱâ Àü¿¡ ÀÌ¹Ì ¶ó¿ìÆÃ Å×ÀÌºí ¿£Æ®¸® (routing table entry)°¡ ¿Ã¹Ù¸£±â ¶§¹®¿¡ ppp.linkup ¿¡ ¿£Æ®¸®¸¦ Ãß°¡ÇÒ Çʿ䰡 ¾ø½À´Ï´Ù. ±×·¯³ª, ¿¬°áÈÄ ÇÁ·Î±×·¥À» È£ÃâÇÏ´Â ¿£Æ®¸®¸¦ ¸¸µé°íÀÚ ÇÒ ¼öµµ Àִµ¥, ÀÌ °æ¿ì´Â sendmail ¿¹Á¦¿Í ÇÔ²² ÈÄ¿¡ ¼³ ¸íÇϰڽÀ´Ï´Ù.

¼³Á¤ ¿¹Á¦ ÆÄÀÏÀº /usr/share/examples/ppp µð·ºÅ丮 ¿¡ ÀÖ½À´Ï´Ù.

15.2.1.5.2. PPP ¿Í µ¿Àû IPÁÖ¼Ò

ISP¿¡¼­ °íÁ¤ IPÁÖ¼Ò¸¦ Á¦°øÇÏÁö ¾ÊÀº °æ¿ì, ppp ´Â Áö¿ª(local)°ú ¿ø°Ý(remote)ÁÖ¼Ò¸¦ °áÁ¤ÇÒ ¼ö ÀÖµµ·Ï ¼³Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. À̰ÍÀº IPÁÖ¼Ò¸¦ "ÃßÃø"ÇÔÀ¸·Î½á ¿¬°áÈÄ¿¡ IP¼³Á¤ ÇÁ·ÎÅäÄÝ( IP Configureation Protocol)À» »ç¿ëÇÏ¿© ppp°¡ ¿Ã¹Ù·Î ¼³Á¤µÇµµ·Ï ÇÔÀ¸·Î½á ÇØ°áµË´Ï´Ù. ppp.confÆÄÀÏÀÇ ¼³ Á¤Àº ´ÙÀ½°ú °°Àº Â÷À̰¡ ÀÖÁö¸¸, ³ª¸ÓÁö´Â PPP¿Í °íÁ¤ IPÁÖ¼Ò¿Í µ¿ÀÏÇÕ´Ï´Ù:

    9      set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0

´Ù½Ã ¸»ÇÏÁö¸¸, ÁÙ¹øÈ£¸¦ ³ÖÁö ¸¶½Ê½Ã¿À. ÀÌ´Â ´ÜÁö ¼³¸íÀÇ ÆíÀǸ¦ À§ÇÑ °ÍÀÔ´Ï´Ù. ±×¸®°í, Àû¾îµµ ÇÑ Ä­À» µé¿©½á¾ß ÇÕ´Ï´Ù.

Line 9:

/¹®ÀÚ µÚÀÇ ¼ýÀÚ´Â ppp°¡ °­Á¦ÇÏ´Â ÁÖ¼ÒÀÇ ºñÆ®(bit)¼ö ÀÔ´Ï´Ù. »óȲ¿¡ ¸ÂÃß¾î ´õ¿í ÀûÀýÇÑ IPÁÖ¼Ò¸¦ ¹Ù¶ö ¼öµµ ÀÖÁö¸¸, À§ÀÇ ¿¹Á¦¸¸À¸·Îµµ ÃæºÐÇÕ´Ï´Ù.

¸¶Áö¸· ÀÎÀÚ(0.0.0.0)´Â ppp°¡ 10.0.0.1º¸´Ù´Â 0.0.0.0¸¦ »ç¿ëÇØ¼­ ¼ÒÅëÇϵµ·Ï ÇÕ´Ï´Ù. set ifaddr¸¦ ¼³Á¤Çϱâ À§ÇØ 0.0.0.0 ¸¦ ù¹øÂ° ÀÎÀÚ·Î »ç¿ëÇÏÁö ¸¶½Ê½Ã¿À. ÀÌ´Â ppp°¡ -auto ¸ðµå¿¡¼­ Ãʱ⠶ó¿ìÆ®¸¦ ¼³Á¤ÇÏ´Â °ÍÀ» ¸·¾ÆÁÝ´Ï´Ù.

¹öÀü 1.x´ëÀÇ ppp¸¦ »ç¿ëÇÏ´Â °æ¿ì ¶ÇÇÑ/etc/ppp/ppp.linkup ¿¡ ¿£Æ®¸®¸¦ Á¦ÀÛÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù. ppp.linkupÀº ¿¬ °áÀÌ ¿Ï·áµÈ ÈÄ¿¡ »ç¿ëµË´Ï´Ù. À̶§, ppp´Â ¾î¶² IPÁÖ¼Ò°¡ Á¤¸»·Î »ç¿ëµÇ´ÂÁö ¾Ë°ÔµË´Ï´Ù. ´ÙÀ½ÀÇ ¿£Æ®¸®´Â Á¸ÀçÇÏ´Â °¡Â¥ ¶ó¿ìÆ®¸¦ Á¦°ÅÇϰí, ¿Ã¹Ù¸¥ °ÍÀ» »ý¼ºÇÕ´Ï´Ù:

    1     provider:
    2      delete ALL
    3      add 0 0 HISADDR

Line 1:

¿¬°á½Ã ppp´Â ´ÙÀ½ÀÇ ¹æ¹ýÀ¸·Î ppp.linkupÀ» »ìÆìº¼ °ÍÀÔ´Ï´Ù: ù°·Î ppp.conf¿¡¼­ »ç¿ëµÈ °Í°ú °°Àº Ç¥½Ä(label) ÀÌ ÀÖ´ÂÁö ã¾Æº¾´Ï´Ù. À̰ÍÀÌ ½ÇÆÐÇϸé, °ÔÀÌÆ®¿þÀÌÀÇ IPÁÖ¼Ò¿¡ ´ë ÇÑ ¿£Æ®¸®¸¦ »ìÆìº¾´Ï´Ù. ÀÌ ¿£Æ®¸®´Â 4¿ÁÅÝ(4-octet, 8ºñÆ®) IP ½ºÅ¸ ÀÏ Ç¥½ÄÀÔ´Ï´Ù. À̰ÍÀ¸·Îµµ ãÀ» ¼ö°¡ ¾ø´Ù¸é, MYADDR ¸¦ ã¾Æº¾´Ï´Ù.

Line 2:

¿©±â¿¡¼­´Â ppp°¡ ¾òÀº tun ÀÎÅÍÆäÀ̽º¿¡ Á¸ÀçÇÏ´Â ¸ðµç ¶ó¿ìÆ®¸¦ Á¦°ÅÇÕ´Ï´Ù(Á÷Á¢ ¶ó¿ìÆ® ¿£Æ®¸® Á¦¿Ü).

Line 3:

¿©±â¿¡¼­´Â ppp°¡ HISADDR ¸¦ °¡¸®Å°´Â ±âº»¶ó¿ìÆ®¸¦ Ãß°¡Åä·Ï ÇÕ´Ï´Ù. HISADDR ´Â IPCP·Î ±³·ùÇϸ鼭 °ÔÀÌÆ®¿þÀÌÀÇ IPÁּҷΠġȯµË´Ï´Ù.

´õ ÀÚ¼¼ÇÑ ¿¹Á¦´Â /usr/share/examples/ppp/ppp.conf.sample °ú /usr/share/examples/ppp/ppp.linkup.sampleÆÄÀÏÀÇ pmdemand¿£Æ®¸® ¸¦ ÂüÁ¶ÇϽʽÿÀ.

PPP ¹öÀü 2¿¡¼­´Â "sticky routes"¸¦ ¼Ò°³Çϰí ÀÖ½À´Ï´Ù. MYADDRÀ̳ª HISADDRÀ» Æ÷ÇÔÇϰí ÀÖ ´Â ¸ðµç add³ª delete ÇàµéÀ» ±â¾ï ÇØµÎ°í, MYADDRÀ̳ª HISADDRÀÇ ½ÇÁ¦ °ªÀÌ ¹Ù²î´Â ½ÃÁ¡¿¡¼­ ¶ó¿ìÆ®´Â ÀçÀû¿ëµË´Ï´Ù. À̰ÍÀº ppp.linkup ÀÇ ¹Ýº¹µÇ´Â ÇàÀ» Á¦°ÅÇϴµ¥ ÇÊ¿äÇÕ´Ï´Ù.

15.2.1.5.3. Receiving Incoming Calls

When you configure ppp to receive incoming calls on a machine connected to a LAN, you must decide if you wish to forward packets to the LAN. If you do, you should allocate the peer an IP number from your LAN's subnet, and use the command enable proxy in your /etc/ppp/ppp.conf file. You should also confirm that the /etc/rc.conf file contains the following:

    gateway="YES"
15.2.1.5.3.1. ¾î¶² getty¸¦ »ç¿ëÇÒ °ÍÀΰ¡?

Configuring FreeBSD for Dial-up ServicesÀº getty¸¦ ÀÌ¿ëÇØ ȸ¼± ¼­ºñ½º¸¦ »ç¿ëÇÏ´Â °Í¿¡ ´ëÇØ ÀÚ¼¼È÷ ¼³¸íÇϰí ÀÖ½À´Ï´Ù.

gettyÀÇ ´ë¾ÈÀº Àüȭȸ¼±¿¡ ¸Â°Ô µðÀÚÀÎµÈ ´õ¿í ±ò²ûÇÑ mgetty ÀÔ´Ï´Ù.

mgetty¸¦ »ç¿ëÇÏ´Â ÀÕÁ¡Àº ¸ðµ©°ú ²÷ÀÓ¾ø´Â Åë½ÅÀ» ÇÑ´Ù´Â Á¡Àε¥, ÀÌ´Â /etc/ttys ¿¡¼­ Æ÷Æ®°¡ ´ÝÇôÁ® ÀÖ´Ù¸é ¸ðµ©ÀÌ ÀüÈ­¸¦ ¹ÞÁö ¾Ê°Ô µÈ´Ù´Â °ÍÀ» ÀǹÌÇÕ´Ï´Ù.

mgettyÀÇ »õ¹öÀü(0.99beta ÀÌÈÄ) ¶ÇÇÑ ¼­¹ö¿¡ Ŭ¶óÀÌ¾ðÆ®°¡ ½ºÅ©¸³Æ®(script-less)¾øÀÌ Á¢±ÙÇÏ´Â °ÍÀ» Çã¿ëÇϸ鼭 PPP ½ºÆ®¸²(stream)À» ÀÚµ¿À¸·Î ŽÁöÇÏ´Â °ÍÀ» Áö¿øÇÕ´Ï´Ù.

mgettyÀÇ ´õ ÀÚ¼¼ÇÑ °ÍÀº Mgetty¿Í AutoPPP¸¦ ÂüÁ¶ÇϽʽÿÀ.

15.2.1.5.3.2. PPP 񀀥

ppp´Â º¸Åë »ç¿ëÀÚid 0À¸·Î ½ÇÇàµÇ¾î¾ß ÇÏÁö¸¸, command must normally be run as user id 0. If however, you wish to allow ppp to run in server mode as a normal user by executing ppp as described below, that user must be given permission to run ppp by adding them to the network group in /etc/group.

You will also need to give them access to one or more sections of the configuration file using the allow command:

    allow users fred mary

If this command is used in the default section, it gives the specified users access to everything.

15.2.1.5.3.3. PPP Shells for Dynamic-IP Users

Create a file called /etc/ppp/ppp-shell containing the following:

    #!/bin/sh
    IDENT=`echo $0 | sed -e 's/^.*-\(.*\)$/\1/'`
    CALLEDAS="$IDENT"
    TTY=`tty`
    
    if [ x$IDENT = xdialup ]; then
            IDENT=`basename $TTY`
    fi
    
    echo "PPP for $CALLEDAS on $TTY"
    echo "Starting PPP for $IDENT"
    
    exec /usr/sbin/ppp -direct $IDENT

This script should be executable. Now make a symbolic link called ppp-dialup to this script using the following commands:

    # ln -s ppp-shell /etc/ppp/ppp-dialup

You should use this script as the shell for all of your dialup users. This is an example from /etc/password for a dialup PPP user with username pchilds (remember don't directly edit the password file, use vipw).

    pchilds:*:1011:300:Peter Childs PPP:/home/ppp:/etc/ppp/ppp-dialup

Create a /home/ppp directory that is world readable containing the following 0 byte files:

    -r--r--r--   1 root     wheel           0 May 27 02:23 .hushlogin
    -r--r--r--   1 root     wheel           0 May 27 02:22 .rhosts

which prevents /etc/motd from being displayed.

15.2.1.5.3.4. PPP shells for Static-IP Users

Create the ppp-shell file as above and for each account with statically assigned IPs create a symbolic link to ppp-shell.

For example, if you have three dialup customers fred, sam, and mary, that you route class C networks for, you would type the following:

    # ln -s /etc/ppp/ppp-shell /etc/ppp/ppp-fred
    # ln -s /etc/ppp/ppp-shell /etc/ppp/ppp-sam
    # ln -s /etc/ppp/ppp-shell /etc/ppp/ppp-mary

Each of these users dialup accounts should have their shell set to the symbolic link created above (i.e., mary's shell should be /etc/ppp/ppp-mary).

15.2.1.5.3.5. Setting up ppp.conf for dynamic-IP users

The /etc/ppp/ppp.conf file should contain something along the lines of:

    default:
      set debug phase lcp chat
      set timeout 0
    
    ttyd0:
      set ifaddr 203.14.100.1 203.14.100.20 255.255.255.255
      enable proxy
    
    ttyd1:
      set ifaddr 203.14.100.1 203.14.100.21 255.255.255.255
      enable proxy

Note: The indenting is important.

The default: section is loaded for each session. For each dialup line enabled in /etc/ttys create an entry similar to the one for ttyd0: above. Each line should get a unique IP address from your pool of IP addresses for dynamic users.

15.2.1.5.3.6. Setting up ppp.conf for static-IP users

Along with the contents of the sample /usr/share/examples/ppp/ppp.conf above you should add a section for each of the statically assigned dialup users. We will continue with our fred, sam, and mary example.

    fred:
      set ifaddr 203.14.100.1 203.14.101.1 255.255.255.255
    
    sam:
      set ifaddr 203.14.100.1 203.14.102.1 255.255.255.255
    
    mary:
      set ifaddr 203.14.100.1 203.14.103.1 255.255.255.255

The file /etc/ppp/ppp.linkup should also contain routing information for each static IP user if required. The line below would add a route for the 203.14.101.0 class C via the client's ppp link.

    fred:
      add 203.14.101.0 netmask 255.255.255.0 HISADDR
    
    sam:
      add 203.14.102.0 netmask 255.255.255.0 HISADDR
    
    mary:
      add 203.14.103.0 netmask 255.255.255.0 HISADDR

15.2.1.5.4. More on mgetty, AutoPPP, and MS extensions

15.2.1.5.4.1. mgetty and AutoPPP

Configuring and compiling mgetty with the AUTO_PPP option enabled allows mgetty to detect the LCP phase of PPP connections and automatically spawn off a ppp shell. However, since the default login/password sequence does not occur it is necessary to authenticate users using either PAP or CHAP.

This section assumes the user has successfully configured, compiled, and installed a version of mgetty with the AUTO_PPP option (v0.99beta or later).

Make sure your /usr/local/etc/mgetty+sendfax/login.config file has the following in it:

    /AutoPPP/ -     -                     /etc/ppp/ppp-pap-dialup

This will tell mgetty to run the ppp-pap-dialup script for detected PPP connections.

Create a file called /etc/ppp/ppp-pap-dialup containing the following (the file should be executable):

    #!/bin/sh
    exec /usr/sbin/ppp -direct pap$IDENT

For each dialup line enabled in /etc/ttys, create a corresponding entry in /etc/ppp/ppp.conf. This will happily co-exist with the definitions we created above.

    pap:
      enable pap          
      set ifaddr 203.14.100.1 203.14.100.20-203.14.100.40
      enable proxy

Each user logging in with this method will need to have a username/password in /etc/ppp/ppp.secret file, or alternatively add the following option to authenticate users via PAP from /etc/password file.

    enable passwdauth

If you wish to assign some users a static IP number, you can specify the number as the third argument in /etc/ppp/ppp.secret. See /usr/share/examples/ppp/ppp.secret.sample for examples.

15.2.1.5.4.2. MS extensions

It is possible to configure PPP to supply DNS and NetBIOS nameserver addresses on demand.

To enable these extensions with PPP version 1.x, the following lines might be added to the relevant section of /etc/ppp/ppp.conf.

    enable msext
    set ns 203.14.100.1 203.14.100.2
    set nbns 203.14.100.5

And for PPP version 2 and above:

    accept dns
    set dns 203.14.100.1 203.14.100.2
    set nbns 203.14.100.5

This will tell the clients the primary and secondary name server addresses, and a netbios nameserver host.

In version 2 and above, if the set dns line is omitted, PPP will use the values found in /etc/resolv.conf.

15.2.1.5.5. PAP and CHAP authentication

Some ISPs set their system up so that the authentication part of your connection is done using either of the PAP or CHAP authentication mechanisms. If this is the case, your ISP will not give a login: prompt when you connect, but will start talking PPP immediately.

PAP is less secure than CHAP, but security is not normally an issue here as passwords, although being sent as plain text with PAP, are being transmitted down a serial line only. There's not much room for crackers to "eavesdrop".

Referring back to the PPP and Static IP addresses or PPP and Dynamic IP addresses sections, the following alterations must be made:

    7       set login
    ...
    12      set authname MyUserName
    13      set authkey MyPassword

As always, do not include the line numbers, they are just for reference in this discussion. Indentation of at least one space is required.

Line 7:

Your ISP will not normally require that you log into the server if you're using PAP or CHAP. You must therefore disable your "set login" string.

Line 12:

This line specifies your PAP/CHAP user name. You will need to insert the correct value for MyUserName.

Line 13:

This line specifies your PAP/CHAP password. You will need to insert the correct value for MyPassword. You may want to add an additional line, such as:

    15      accept PAP

or

    15      accept CHAP

to make it obvious that this is the intention, but PAP and CHAP are both accepted by default.

15.2.1.5.6. Changing your ppp configuration on the fly

It is possible to talk to the ppp program while it is running in the background, but only if a suitable diagnostic port has been set up. To do this, add the following line to your configuration:

    set server /var/run/ppp-tun%d DiagnosticPassword 0177

This will tell PPP to listen to the specified unix-domain socket, asking clients for the specified password before allowing access. The %d in the name is replaced with the tun device number that is in use.

Once a socket has been set up, the pppctl(8) program may be used in scripts that wish to manipulate the running program.

15.2.1.6. Final system configuration

You now have ppp configured, but there are a few more things to do before it is ready to work. They all involve editing the /etc/rc.conf file.

Working from the top down in this file, make sure the hostname= line is set, e.g.:

    hostname="foo.bar.com"

If your ISP has supplied you with a static IP address and name, it's probably best that you use this name as your host name.

Look for the network_interfaces variable. If you want to configure your system to dial your ISP on demand, make sure the tun0 device is added to the list, otherwise remove it.

    network_interfaces="lo0 tun0" ifconfig_tun0=

Note: The ifconfig_tun0 variable should be empty, and a file called /etc/start_if.tun0 should be created. This file should contain the line:

    ppp -auto mysystem

This script is executed at network configuration time, starting your ppp daemon in automatic mode. If you have a LAN for which this machine is a gateway, you may also wish to use the -alias switch. Refer to the manual page for further details.

Set the router program to NO with following line in your /etc/rc.conf:

    router_enable="NO"

It is important that the routed daemon is not started (it is started by default), as it routed tends to delete the default routing table entries created by ppp.

It is probably worth your while ensuring that the sendmail_flags line does not include the -q option, otherwise sendmail will attempt to do a network lookup every now and then, possibly causing your machine to dial out. You may try:

    sendmail_flags="-bd"

The downside of this is that you must force sendmail to re-examine the mail queue whenever the ppp link is up by typing:

    # /usr/sbin/sendmail -q

You may wish to use the !bg command in ppp.linkup to do this automatically:

    1     provider:
    2       delete ALL
    3       add 0 0 HISADDR
    4       !bg sendmail -bd -q30m

If you don't like this, it is possible to set up a "dfilter" to block SMTP traffic. Refer to the sample files for further details.

Now the only thing left to do is reboot the machine.

All that is left is to reboot the machine. After rebooting, you can now either type:

    # ppp

and then dial provider to start the PPP session, or, if you want ppp to establish sessions automatically when there is outbound traffic (and you have not created the start_if.tun0 script), type:

    # ppp -auto provider

15.2.1.7. Summary

To recap, the following steps are necessary when setting up ppp for the first time:

Client side:

  1. Ensure that the tun device is built into your kernel.

  2. Ensure that the tunX device file is available in the /dev directory.

  3. Create an entry in /etc/ppp/ppp.conf. The pmdemand example should suffice for most ISPs.

  4. If you have a dynamic IP address, create an entry in /etc/ppp/ppp.linkup.

  5. Update your /etc/rc.conf file.

  6. Create a start_if.tun0 script if you require demand dialing.

Server side:

  1. Ensure that the tun device is built into your kernel.

  2. Ensure that the tunX device file is available in the /dev directory.

  3. Create an entry in /etc/passwd (using the vipw(8) program).

  4. Create a profile in this users home directory that runs ppp -direct direct-server or similar.

  5. Create an entry in /etc/ppp/ppp.conf. The direct-server example should suffice.

  6. Create an entry in /etc/ppp/ppp.linkup.

  7. Update your /etc/rc.conf file.