�I�I�I�ש�n�Ө�ק� Linux �����Ѽƪ����`�F�I�b�e���� ������¦ ���`���ڭ̪��D�F�D���n�s�W Internet �ݭn�@�ǥ��T�������ѼƳ]�w�A�o�dz]�w�b Windows �t�ΤW�����ק�h�b �ϰ�������[�c �̭��i��F�����C�b�o�@�������A�ڭ̫h�D�n�H�T�w IP ���]�w�覡�ӭק� Linux �������ѼơA�P�ɡA�]�|���Цp��ϥ� ADSL �������覡�ӤW���A���~�A�]�� Cable modem �ϥΪ̤]���b�ּơA�ҥH�ڭ̤]�����@�U Cable modem �b Linux �U���]�w�覡��I |
1.
����ݤ@�U�֤ߪ����A�]�����P�������Ҳթ�m�����|���P�C
[root@test /root]# uname -r 2.4.20-18.9 �W���O�H Red Hat 9 ���d�ҡA �L���֤߬O 2.4 ����C �@ 2. �֤Ҳժ����|�G [root@test /root]# cd /lib/modules/`uname -r`/kernel/drivers/net �W���O 2.4 �������| [root@test /root]# cd /lib/modules/`uname -r`/net �W���O 2.2 �������|�A�Ш̷ӱz����ڮ֤ߨӬd�ߡC �@ [root@test net]# ls -l via* -rw-r--r-- 1 root root 17892 Sep 7 2001 via-rhine.o �Ӧn�F�I�Q�䴩��O�I |
[root@test
/root]# dmesg | grep eth
divert: allocating divert_blk for eth0 eth0: RealTek RTL8139 Fast Ethernet at 0xc4844000, 00:50:fc:20:f1:4c, IRQ 10 eth0: Identified 8139 chip type 'RTL-8139C' eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 45e1. divert: allocating divert_blk for eth1 eth1: Digital DC21041 Tulip rev 33 at 0xc4852000, 21041 mode, 00:80:C8:5A:87:10, IRQ 9. |
���]�֤ߪ�
Open source �ؿ��� /usr/src/linux-2.4.20-18.9
[root@test root]# cd /usr/src [root@test src]# ln -s linux-2.4.20-18.9 linux |
1. �N�����o��
dlkfet-4.24.tar.gz ��m�� /tmp ���U
[root@test root]# cp dlkfet-4.24.tar.gz /tmp [root@test root]# cd /tmp [root@test tmp]# tar -zxvf dlkfet-4.24.tar.gz [root@test tmp]# cd dlkfet-4.24 �@ 2. �}�l�sĶ�G [root@test dlkfet-4.24]# make �즹����A�|���ͤ@���ɮҲաA�٬��G rhinefet.o [root@test dlkfet-4.24]# cp rhinefet.o \ > /lib/modules/`uname -r`/kernel/drivers/net [root@test dlkfet-4.24]# depmod -a �S�O�d�N�A�W�������|�� 2.4.xx �������֤ߡI�åB�N�ӼҲռg�J�ݩʬۨ��ɮסC |
1. ���J�Ҳժ����աG
[root@test root]# modprobe rhinefet �Ъ`�N�A���n�g���㪺�ɦW�A .o ���ݭn�g�A���� rhinefet �N�O ���sĶ�X�Ӫ� rhinefet.o ���I [root@test root]# lsmod Module Size Used by Tainted: P rhinefet 14208 2 ....(��).... �@ 2. �]�w�}���ɸ��J�Ҳ� [root@test root]# vi /etc/modules.conf # �[�J���U�o�@�� alias eth0 rhinefet �@ 3. �]�i�H���s�}���O�ݬݯ�_���`���ҰʼҲաG [root@test root]# sync; sync; reboot |
[root@test
root]# ifconfig
eth0 192.168.1.2
[root@test root]# ifconfig eth0 Link encap:Ethernet HWaddr 00:10:DC:F1:D8:C5 inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:17 Base address:0xd400 Memory:fb060000-fb060038 �@ lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:41739 errors:0 dropped:0 overruns:0 frame:0 TX packets:41739 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4252360 (4.0 Mb) TX bytes:4252360 (4.0 Mb) �@ [root@test root]# ping 192.168.1.2 -c 3 PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data. 64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.106 ms 64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=0.016 ms 64 bytes from 192.168.1.2: icmp_seq=3 ttl=64 time=0.013 ms --- 192.168.1.2
ping statistics ---
|
[root@test
root]# vi /etc/sysconfig/network
NETWORKING=yes�@�@�@�@�@�@�@<==�O�_�Ұʺ����A���M�O�աI HOSTNAME=test.domain.name�@ <==�D���W�١A�n�T�w��I�i�H�H�ɭק�աI |
[root@test
root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0�@�@�@�@�@�@�@�@<==�]�w�˸m���W�١A�o���n���ɮצW�ٹ����I ONBOOT=yes�@�@�@�@ �@�@�@�@<==�O�_�b�}�������ɭԱҰʺ����d BOOTPROTO=static�@�@�@�@�@ <==�Ұʪ��ɭԪ� IP ���o����w�A�o�̬O�T�w���A �@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�p�G�O Cable ���ܡA�n�令 dhcp �~��C IPADDR=192.168.1.2�@�@�@�@ <==�o�ӴN�O IP �o�I NETMASK=255.255.255.0�@�@�@<==�o�ӴN�O�l�B�n�����o�I NETWORK=192.168.1.0�@�@�@�@<==�o�ӴN�O�Ӻ��q���Ĥ@�� IP �� BROADCAST=192.168.1.255�@�@<==�o�ӴN�O�̫�@�ӦP���q���s����}�o�I GATEWAY=192.168.1.2�@�@�@�@<==�o�ӴN�O�o�������d���q�T�h�o�I #GATEWAYDEV=eth0�@�@�@�@�@�@<==�]�i�H�o��g�I |
[root@test
root]# /etc/rc.d/init.d/network restart <==���s�Ұʺ�������
[root@test root]# ifup �@eth0�@�@<==�Ұ� eth0 �����d [root@test root]# ifdown eth0�@�@<==���� eth0 �����d |
[root@test
root]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:50:FC:22:9C:57 inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5692910 errors:0 dropped:0 overruns:0 frame:0 TX packets:5914804 errors:0 dropped:0 overruns:0 carrier:0 collisions:848 txqueuelen:100 RX bytes:522002571 (497.8 Mb) TX bytes:2498073183 (2382.3 Mb) Interrupt:10 Base address:0x6100 �@ [root@test root]# ping -c 3 192.168.1.2 PING 192.168.1.2 (192.168.1.2) from 192.168.1.2 : 56(84) bytes of data. 64 bytes from 192.168.1.2: icmp_seq=0 ttl=255 time=318 usec 64 bytes from 192.168.1.2: icmp_seq=1 ttl=255 time=213 usec 64 bytes from 192.168.1.2: icmp_seq=2 ttl=255 time=217 usec --- 192.168.1.2
ping statistics ---
|
[root@test
root]# vi /etc/sysconfig/network
NETWORKING=yes HOSTNAME=redhat9.vbird.net |
[root@test
root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.1.13 NETMASK=255.255.255.0 NETWORK=192.168.1.0 BROADCAST=192.168.1.255 GATEWAY=192.168.1.2 |
[root@test
root]# vi /etc/resolv.conf
nameserver 168.95.1.1 nameserver 139.175.10.20 |
[root@test
root]# /etc/rc.d/init.d/network restart
[root@test root]# ifdown eth0 [root@test root]# ifup eth0 |
[root@test
root]# vi /etc/sysconfig/network
NETWORKING=yes HOSTNAME=redhat9.vbird.net |
[root@test
root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 ONBOOT=yes BOOTPROTO=dhcp�@�@<==�o�@��]�w���T�Y�i�I�U�����|�Ӻ����ѼƨS���ΡI �@�@�@�@�@�@�@�@�@�@ �ݭn�d�N���O�A�b Openlinux �̭��A�o�̪��]�w �@�@�@�@�@�@�@�@�@�@ �� DYNAMIC=dhcp ��I IPADDR=192.168.1.13 NETMASK=255.255.255.0 NETWORK=192.168.1.0 BROADCAST=192.168.1.255 |
[root@test
root]# vi /etc/resolv.conf
nameserver 168.95.1.1 nameserver 139.175.10.20 |
[root@test
root]# /etc/rc.d/init.d/network restart
[root@test root]# ifdown eth0 [root@test root]# ifup eth0 |
1. �����w�]�q�T�h
[root@test root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes�@�@�@�@<==�Y�z�ݭn eth0 ���z�إߤ����p������ɡA�o�̥i�H�g�� yes �@�@�@�@�@�@�@�@�@�@ ���Y���ݭn���������ɡA�o�@��Ъ����g�� no �A�ϥ����� �@�@�@�@�@�@�@�@�@�@ ��������d�|�۰ʳQ�ҰʡI BOOTPROTO=static IPADDR=192.168.1.2 NETMASK=255.255.255.0 NETWORK=192.168.1.0 BROADCAST=192.168.1.255 �@ [root@test root]# /etc/rc.d/init.d/network restart |
[root@test
root]# rpm -qa | grep rp-pppoe
rp-pppoe-3.5-2�@�@�@�@<==�ݨӬO�w�g�w�ˤF�I�u�n�����o�I [root@test root]# rpm -e rp-pppoe |
1. �sĶ SRPM�G
[root@test root]# rpm --rebuild rp-pppoe-3.5-1.src.rpm [root@test root]# rpmbuild --rebuild rp-pppoe-3.5-1.src.rpm # ���G�b Red Hat 7.3 �H�e�A rpm �����O�ϥ� rpm �A���O�b Red Hat 8 # �H��A SRPM �����s���O�w�g�W�ߦ� rpmbuild �o�I�ҥH�п�� # �A�X�z�� Linux ������I ......... Wrote: /usr/src/redhat/RPMS/i386/rp-pppoe-3.5-1.i386.rpm ......... �b�sĶ�ɡA�̫᪺���G(�p�G�S�����~)�|��ܤW�����Ӽˤl�I �]�N�O���A�z���sĶ�������ɮ״N��b�W���o�I �@ 2. �w�� rp-pppoe : [root@test root]# cd /usr/src/redhat/RPMS/i386 [root@test i386]# rpm -ivh rp-pppoe-3.5-1.i386.rpm Preparing... ########################################### [100%] 1:rp-pppoe ########################################### [100%] [root@test i386]# rpm -q rp-pppoe rp-pppoe-3.5-1 �o�˴N�w�˧����F�I²��a�I�p�G���۫H�A�i�H�d�߬ݬݡI |
1. �����Y�I
[root@test root]# mv rp-pppoe-3.5.tar.gz /usr/local/src [root@test root]# cd /usr/local/src [root@test src]# tar -zxvf rp-pppoe-3.5.tar.gz �@ 2. �����t�λP�sĶ�����ɡG [root@test src]# cd rp-pppoe-3.5/src [root@test src]# ./configure --prefix=/usr/local [root@test src]# make; make install |
[root@test
root]# /usr/sbin/adsl-setup
>>> Enter your PPPoE user name (default bxxxnxnx@sympatico.ca): T0123456 �o�ӮɭԽп�J�z�b ADSL ���b���A���P�� ISP �����P���]�w�覡��I�ЯS�O�`�N�I a. �p�G�O seednet ���ܡA���Ӧ��I���o��==> T0123456 b. �p�G�O Hinet ���ܡA���Ӧ��I���o��====> yourname@hinet.com.tw(�s�P host �]�n�g) �@ >>> Enter the Ethernet interface connected to the ADSL modem For Solaris, this is likely to be something like /dev/hme0. For Linux, it will be ethn, where 'n' is a number. (default eth0): eth0 �]���ڭ̨ϥ� eth0 �s�u���r�I �@ >>> Enter the demand value (default no): <=���U Enter �Y�i �o�̫� enter ���γ]�w�N�n�F�I >>> Enter the
DNS information here: 168.95.1.1
|
[root@test
root]# adsl-start
....Connect! |
[root@test
root]# ifconfig ppp0
ppp0 Link encap:Point-to-Point Protocol inet addr:211.74.249.38 P-t-P:172.16.11.8 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1 RX packets:8356088 errors:0 dropped:0 overruns:0 frame:0 TX packets:8532063 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:10 |
[root@test
root]# vi /etc/crontab
....... 01-59/3 * * * * root /usr/sbin/adsl-start > /dev/null 2>&1 |
[root@test
root]# more /var/log/messages
May 10 18:02:22 testing pppoe[8527]: Bogus PPPoE length field (50) |
/* Check
length */
if (ntohs(packet.length) + HDR_SIZE > len) { syslog(LOG_ERR, "Bogus PPPoE length field (%u)", (unsigned int) ntohs(packet.length)); return; } |
/* Check length */
if (ntohs(packet.length) + HDR_SIZE > len) { /* syslog(LOG_ERR, "Bogus PPPoE length field (%u)", (unsigned int) ntohs(packet.length)); */ return; } |
if (plen + HDR_SIZE > len) {
syslog(LOG_ERR, "Bogus length field in session packet %d (%d)", (int) plen, (int) len); return; } |
if (plen + HDR_SIZE > len) {
/* syslog(LOG_ERR, "Bogus length field in session packet %d (%d)", (int) plen, (int) len); */ return; } |
cd /usr/local/src/rp-pppoe-3.5/src
./configure make make install |
adsl-stop
adsl-start |
[root@test
root]# vi /etc/hosts
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1�@�@�@localhost.localdomain�@�@�@localhost �q�� IP�@�@�@�@�D���W�١@�@�@�@�@�@�@�@�@ �D���O�W( alias ) |
[root@test
root]# vi /etc/hosts
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1�@�@�@localhost.localdomain�@�@�@localhost 192.168.1.1�@�@linux001 192.168.1.2�@�@linux002 192.168.1.3�@�@linux003 ......... ......... 192.168.1.255�@linux255 |
[root@test
root]# vi /etc/resolv.conf
nameserver 168.95.1.1 nameserver 139.175.10.20 |