装好系统后会默认网卡是DHCP配置网络
(1)编辑/etc/network/interfaces
# 启动系统激活设备.
# Loop回环地址.
auto lo
iface lo inet loopback
# 启动系统激活设备.
# 网卡eth0设置为Static类型.
auto eth0
iface eth0 inet static
# 指定IP地址.子网掩码.广播.网关.
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
# 不要设置网关,这个害得我弄了一个星期都搞不定
#在系统中不要设置默认路由(网关),让ADSL拨号后自动获得
#gateway 192.168.0.1
(2)安装 rp-pppoe
下载最新的版本
解压到/usr/src
然后进到解压后的目录的/src中
#./configure --prefix=/usr/local
#make;make install
安装完成
(3)配置re-pppoe
#pppoe-setup
使挂载的fat32和ntfs分区正常显示中文名
自动加载方式:
编辑/etc/fstab文件,把原来的
/dev/hdb1 /mnt/hda2 vfat auto,umask=0 0 0
/dev/hdb5 /mnt/hda5 vfat auto,umask=0 0 0
改成
/dev/hdb1 /mnt/win_1 vfat iocharset=gb2312,umask=0 0 0
/dev/hdb5 /mnt/win_2 vfat iocharset=gb2312,umask=0 0 0
yemy:/usr/src/rp-pppoe-3.6/src# /usr/local/sbin/pppoe-setup
Welcome to the Roaring Penguin PPPoE client setup. First, I will run
some checks on your system to make sure the PPPoE client is installed
properly...
Looks good! Now, please enter some information:
USER NAME
#输入ADSL帐号的用户名
>>> Enter your PPPoE user name (default bxxxnxnx@sympatico.ca): abcdefg(用户名)
INTERFACE
#ADSL相连的网卡的名字
>>> Enter the Ethernet interface connected to the DSL 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
#demand value不用输入
Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped. If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses. You may have some problems with demand-activated links.
>>> Enter the demand value (default no):
DNS
#DNS服务器的IP,两个
Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
>>> Enter the DNS information here: *.*.*.*
Please enter the IP address of your ISP's secondary DNS server.
If you just press enter, I will assume there is only one DNS server.
>>> Enter the secondary DNS server address here: *.*.*.*
PASSWORD
#密码
>>> Please enter your PPPoE password:
>>> Please re-enter your PPPoE password:
FIREWALLING
#防火墙,设为0
Please choose the firewall rules to use. Note that these rules are
very basic. You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security. If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself. Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc. If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.
The firewall choices are:
0 - NONE: This script will not set any firewall rules. You are responsible
for ensuring the security of your machine. You are STRONGLY
recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
for a LAN
>>> Choose a type of firewall (0-2): 0
** Summary of what you entered **
Ethernet Interface: eth0
User name: abcdefg(用户名)
Activate-on-demand: No
Primary DNS: *.*.*.*
Secondary DNS: *.*.*.*
Firewalling: NONE
#信息正确,输入 y ,完成配置,否则,输入 n 重新输入。
>>> Accept these settings and adjust configuration files (y/n)? y
Adjusting /etc/ppp/pppoe.conf
Adjusting /etc/resolv.conf
(But first backing it up to /etc/resolv.conf-bak)
Adjusting /etc/ppp/pap-secrets and /etc/ppp/chap-secrets
(But first backing it up to /etc/ppp/pap-secrets-bak)
(But first backing it up to /etc/ppp/chap-secrets-bak)
Congratulations, it should be all set up!
Type 'pppoe-start' to bring up your PPPoE link and 'pppoe-stop' to bring
it down. Type 'pppoe-status' to see the link status.
(4)使用pppoe拨号
启动
#pppoe-start
#.Connected!(连接上)
停止
#pppoe-stop
状态
#pppoe-status
(5)测试
检查是否存在ppp0端口和其信息
#ifconfig -a
ppp0 Link encap:Point-to-Point Protocol
inet addr:222.216.23.142 P-t-P:172.0.0.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:8875 errors:0 dropped:0 overruns:0 frame:0
TX packets:8766 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:5545934 (5.2 MiB) TX bytes:1101231 (1.0 MiB)
查看路由表信息
#netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
172.0.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 172.0.0.1 0.0.0.0 UG 0 0 0 ppp0
如果没有默认路由,可以手动增加:
#route add default gw 上面获得的IP地址
如果解析出新浪的IP,说明已经从拨号中正确获得了DNS服务器
#nslookup www.sina.com.cn
最后,使用命令ping某个域名或IP,如果有响应,表示已经大功告成。
555555555~~~~~全世界上网!
(1)编辑/etc/network/interfaces
# 启动系统激活设备.
# Loop回环地址.
auto lo
iface lo inet loopback
# 启动系统激活设备.
# 网卡eth0设置为Static类型.
auto eth0
iface eth0 inet static
# 指定IP地址.子网掩码.广播.网关.
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
# 不要设置网关,这个害得我弄了一个星期都搞不定
#在系统中不要设置默认路由(网关),让ADSL拨号后自动获得
#gateway 192.168.0.1
(2)安装 rp-pppoe
下载最新的版本
解压到/usr/src
然后进到解压后的目录的/src中
#./configure --prefix=/usr/local
#make;make install
安装完成
(3)配置re-pppoe
#pppoe-setup
使挂载的fat32和ntfs分区正常显示中文名
自动加载方式:
编辑/etc/fstab文件,把原来的
/dev/hdb1 /mnt/hda2 vfat auto,umask=0 0 0
/dev/hdb5 /mnt/hda5 vfat auto,umask=0 0 0
改成
/dev/hdb1 /mnt/win_1 vfat iocharset=gb2312,umask=0 0 0
/dev/hdb5 /mnt/win_2 vfat iocharset=gb2312,umask=0 0 0
yemy:/usr/src/rp-pppoe-3.6/src# /usr/local/sbin/pppoe-setup
Welcome to the Roaring Penguin PPPoE client setup. First, I will run
some checks on your system to make sure the PPPoE client is installed
properly...
Looks good! Now, please enter some information:
USER NAME
#输入ADSL帐号的用户名
>>> Enter your PPPoE user name (default bxxxnxnx@sympatico.ca): abcdefg(用户名)
INTERFACE
#ADSL相连的网卡的名字
>>> Enter the Ethernet interface connected to the DSL 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
#demand value不用输入
Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped. If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses. You may have some problems with demand-activated links.
>>> Enter the demand value (default no):
DNS
#DNS服务器的IP,两个
Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
>>> Enter the DNS information here: *.*.*.*
Please enter the IP address of your ISP's secondary DNS server.
If you just press enter, I will assume there is only one DNS server.
>>> Enter the secondary DNS server address here: *.*.*.*
PASSWORD
#密码
>>> Please enter your PPPoE password:
>>> Please re-enter your PPPoE password:
FIREWALLING
#防火墙,设为0
Please choose the firewall rules to use. Note that these rules are
very basic. You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security. If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself. Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc. If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.
The firewall choices are:
0 - NONE: This script will not set any firewall rules. You are responsible
for ensuring the security of your machine. You are STRONGLY
recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
for a LAN
>>> Choose a type of firewall (0-2): 0
** Summary of what you entered **
Ethernet Interface: eth0
User name: abcdefg(用户名)
Activate-on-demand: No
Primary DNS: *.*.*.*
Secondary DNS: *.*.*.*
Firewalling: NONE
#信息正确,输入 y ,完成配置,否则,输入 n 重新输入。
>>> Accept these settings and adjust configuration files (y/n)? y
Adjusting /etc/ppp/pppoe.conf
Adjusting /etc/resolv.conf
(But first backing it up to /etc/resolv.conf-bak)
Adjusting /etc/ppp/pap-secrets and /etc/ppp/chap-secrets
(But first backing it up to /etc/ppp/pap-secrets-bak)
(But first backing it up to /etc/ppp/chap-secrets-bak)
Congratulations, it should be all set up!
Type 'pppoe-start' to bring up your PPPoE link and 'pppoe-stop' to bring
it down. Type 'pppoe-status' to see the link status.
(4)使用pppoe拨号
启动
#pppoe-start
#.Connected!(连接上)
停止
#pppoe-stop
状态
#pppoe-status
(5)测试
检查是否存在ppp0端口和其信息
#ifconfig -a
ppp0 Link encap:Point-to-Point Protocol
inet addr:222.216.23.142 P-t-P:172.0.0.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:8875 errors:0 dropped:0 overruns:0 frame:0
TX packets:8766 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:5545934 (5.2 MiB) TX bytes:1101231 (1.0 MiB)
查看路由表信息
#netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
172.0.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 172.0.0.1 0.0.0.0 UG 0 0 0 ppp0
如果没有默认路由,可以手动增加:
#route add default gw 上面获得的IP地址
如果解析出新浪的IP,说明已经从拨号中正确获得了DNS服务器
#nslookup www.sina.com.cn
最后,使用命令ping某个域名或IP,如果有响应,表示已经大功告成。
555555555~~~~~全世界上网!