IIIשnӨק Linux Ѽƪ`FIbe ¦ `ڭ̪DFDnsW Internet ݭn@ǥTѼƳ]wAodz]wb Windows tΤWקhb ϰ[c ̭iFCbo@Aڭ̫hDnHTw IP ]w觋ӭק Linux ѼơAPɡA]|Цpϥ ADSL 觋ӤWA~A] Cable modem ϥΪ̤]bּơAҥHڭ̤]@U Cable modem b Linux U]w觋I |
1.
ݤ@U֤ߪA]PҲթm|PC
[root@test /root]# uname -r 2.4.20-18.9 WOH Red Hat 9 dҡA L֤߬O 2.4 C @ 2. ֤Ҳժ|G [root@test /root]# cd /lib/modules/`uname -r`/kernel/drivers/net WO 2.4 | [root@test /root]# cd /lib/modules/`uname -r`/net WO 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 ӦnFIQ䴩OI |
[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. No
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. }lsĶ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 SOdNAW| 2.4.xx ֤ߡIåBNӼҲռgJݩʬۨɮסC |
1. JҲժաG
[root@test root]# modprobe rhinefet Ъ`NAng㪺ɦWA .o ݭngA rhinefet NO 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 # [JUo@ alias eth0 rhinefet @ 3. ]iHs}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_ҰʺAMOաI HOSTNAME=test.domain.name@ <==DW١AnTwIiHHɭקաI |
[root@test
root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0@@@@@@@@<==]w˸mW١AonɮצWٹI ONBOOT=yes@@@@ @@@@<==O_b}ɭԱҰʺd BOOTPROTO=static@@@@@ <==ҰʪɭԪ IP owAo̬OTwA @@@@@@@@@@@@@@@pGO Cable ܡAn令 dhcp ~C IPADDR=192.168.1.2@@@@ <==oӴNO IP oI NETMASK=255.255.255.0@@@<==oӴNOlBnoI NETWORK=192.168.1.0@@@@<==oӴNOӺqĤ@ IP BROADCAST=192.168.1.255@@<==oӴNO̫@ӦPqs}oI GATEWAY=192.168.1.2@@@@<==oӴNOodqThoI #GATEWAYDEV=eth0@@@@@@<==]iHogI |
[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@]wTYiIU|ӺѼƨSΡI @@@@@@@@@@ ݭndNOAb Openlinux ̭Ao̪]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]qTh
[root@test root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes@@@@<==Yzݭn eth0 zإߤpɡAo̥iHg yes @@@@@@@@@@ YݭnɡAo@Ъ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@@@@<==ݨӬOwgwˤFIunoI [root@test root]# rpm -e rp-pppoe |
1. sĶ SRPMG
[root@test root]# rpm --rebuild rp-pppoe-3.5-1.src.rpm [root@test root]# rpmbuild --rebuild rp-pppoe-3.5-1.src.rpm # Gb Red Hat 7.3 HeA rpm Oϥ rpm AOb Red Hat 8 # HA SRPM sOwgWߦ rpmbuild oIҥHп # AXz Linux I ......... Wrote: /usr/src/redhat/RPMS/i386/rp-pppoe-3.5-1.i386.rpm ......... bsĶɡA̫᪺G(pGS~)|ܤWӼˤlI ]NOAzsĶɮ״NbWoI @ 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˴Nw˧FI²aIpG۫HAiHd߬ݬݡI |
1. YI
[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λPsĶɡ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ӮɭԽпJzb ADSL bAP ISP P]w觋IЯSO`NI a. pGO seednet ܡAӦIo==> T0123456 b. pGO Hinet ܡAӦIo====> yourname@hinet.com.tw(sP host ]ng) @ >>> 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 surI @ >>> Enter the demand value (default no): <=U Enter Yi o̫ enter γ]wNnFI >>> 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@@@@DW١@@@@@@@@@ DOW( 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 |