做了一个精减的FreeBSD,放在U盘,算上php和nginx仅30M多一点。
但是运行一段时间突然发现拨号不能用,在拨号的网卡上抓包,仅发现DNS解析PPPoE.的数据包:
06:24:45.772633 IP 192.168.128.115.10066 > 114.114.114.114.53: 62728+ A? PPPoE. (23)
很是奇怪,正常应该至少出现PPPoE的发现包。
把配置文件修改了N遍,情况依旧,最后把配置文件放到一台普通的FB上,运行正常,由此推测,是精减的时候出现失误,过度精减了。
找了半天,终于找到是内核模块不足,把所有的/boot/kernel/*.ko复制过来,顺利拨号!
显示一下加载的内核模块:
#kldstat
Id Refs Address Size Name
1 12 0xffffffff80200000 b76038 kernel
2 1 0xffffffff80d77000 2f28 splash_bmp.ko
3 4 0xffffffff81012000 87c4 netgraph.ko
4 1 0xffffffff8101b000 15a8 ng_ether.ko
5 1 0xffffffff8101d000 3270 ng_pppoe.ko
6 1 0xffffffff81021000 1c40 ng_socket.ko
PPPoE需要netgraph模块,这个其实早就知道,没想到竟然在这地方出现失误。
摘录man ppp中的一段:
#man ppp
……
Supports PPP over Ethernet (rfc 2516). If ppp is given a device specifi?
network interface.
On systems that do not support netgraph(4), an external program such as
pppoed(8) may be used.
……
If a PPPoE:iface[:provider] specification is given, ppp will
attempt to create a PPP over Ethernet connection using the given
iface interface by using netgraph(4). If netgraph(4) is not
available, ppp will attempt to load it using kldload(2). If this
fails, an external program must be used such as the pppoed(8)
program available under OpenBSD. The given provider is passed as
the service name in the PPPoE Discovery Initiation (PADI) packet.
If no provider is given, an empty value will be used.
看来没有netgraph的话,用pppoed也可以,不知道用来做客户端是不是可以,有空再测试吧。
如果不想复制那几个模块,那就重新编译内核,加上这几句:
options NETGRAPH
options NETGRAPH_PPPOE
options NETGRAPH_PPP
options NETGRAPH_PPTPGRE
options NETGRAPH_SOCKET
options NETGRAPH_ETHER
下面这些可以选加:
options NETGRAPH_MPPC_ENCRYPTION
options NETGRAPH_ASYNC
options NETGRAPH_BPF
options NETGRAPH_CAR
options NETGRAPH_IFACE
options NETGRAPH_NETFLOW
options NETGRAPH_TCPMSS
options NETGRAPH_TEE
options NETGRAPH_VJC
该贴由hui.chen转至本版2014-11-5 17:04:58