免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 2675 | 回复: 10
打印 上一主题 下一主题

fedora core 4 能否架设PPPoE服务器? [复制链接]

论坛徽章:
1
数据库技术版块每日发帖之星
日期:2016-08-04 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-07-09 09:38 |只看该作者 |倒序浏览
请问各位.在FC4下能不能架设PPPoE服务器?  如果能. 指点一下吗? 感谢

盼? 我是linux的一个新手.同时也爱好者.好多地方不懂.请各位指教.

论坛徽章:
0
2 [报告]
发表于 2006-07-09 09:47 |只看该作者
PPPoE是一种接续形式,不是什么服务件组。
不过可以通过Linux做ADSL的路由器并配合iptables提高安全控制,还可以提供DHCP功能。

论坛徽章:
1
数据库技术版块每日发帖之星
日期:2016-08-04 06:20:00
3 [报告]
发表于 2006-07-09 10:08 |只看该作者
原帖由 OhOhMyGirl 于 2006-7-9 09:47 发表
PPPoE是一种接续形式,不是什么服务件组。
不过可以通过Linux做ADSL的路由器并配合iptables提高安全控制,还可以提供DHCP功能。



不太明白你的意思?  现实中的PPPoE Server是怎么回事情呢? 

论坛徽章:
0
4 [报告]
发表于 2006-07-09 10:22 |只看该作者
可以理解成 ISP 提供的供你上 ADSL 的那个服务器

论坛徽章:
0
5 [报告]
发表于 2006-07-09 10:35 |只看该作者

论坛徽章:
1
数据库技术版块每日发帖之星
日期:2016-08-04 06:20:00
6 [报告]
发表于 2006-07-09 15:03 |只看该作者
PPPoE协议我知道呀. 怎样架设一个服务器来支持pppoe拨号呢? 我问的是这个意思.   拜托了

论坛徽章:
0
7 [报告]
发表于 2006-07-09 20:26 |只看该作者
刚好想写教程,虽然还没有写到PPPoE+iptables,但看到你正好问到,就先写一部分。仅供参考。
我的个人网站 www.aoiday.com 教程刚刚写完4章,希望大家来补充。同时希望纠正错误。我是个初学者。


设置好网卡以后
[root@fedora ~]# adsl-setup 
Welcome to the ADSL client setup.  First, I will run some checks on
your system to make sure the PPPoE client is installed properly...


LOGIN NAME

Enter your Login Name (default root): XXXXXXXX ← 显示ISP提供给你的ID

INTERFACE

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 ethX, where 'X' is a number.
(default eth0): eth1 ← eth1回应

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):  ← ENTER

DNS

Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide dynamic 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:  ← ENTER

PASSWORD

Please enter your Password:  ← ISP提供的接续密码
Please re-enter your Password:  ← 确认键入

USERCTRL

Please enter 'yes' (two letters, lower-case.) if you want to allow
normal user to start or stop DSL connection (default yes): no ← no(仅让root进行接续操作)

FIREWALLING

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): 2 ← 2回应

Start this connection at boot time

Do you want to start this connection at boot time?
Please enter no or yes (default no):  ← ENTER

** Summary of what you entered **

Ethernet Interface: eth1
User name:          XXXXXXXX
Activate-on-demand: No
DNS:                Do not adjust
Firewalling:        MASQUERADE
User Control:       no
Accept these settings and adjust configuration files (y/n)? y ← 确认
Adjusting /etc/sysconfig/network-scripts/ifcfg-ppp0
Adjusting /etc/ppp/chap-secrets and /etc/ppp/pap-secrets
  (But first backing it up to /etc/ppp/chap-secrets.bak)
  (But first backing it up to /etc/ppp/pap-secrets.bak)



Congratulations, it should be all set up!

Type '/sbin/ifup ppp0' to bring up your xDSL link and '/sbin/ifdown ppp0'to bring it down.
Type '/sbin/adsl-status /etc/sysconfig/network-scripts/ifcfg-ppp0'to see the link status.

设定DNS
[root@fedora ~]# sed -i '/^nameserver/d' /etc/resolv.conf ← 删除旧的设定

[root@fedora ~]# echo "nameserver XXX.XXX.XXX.XXX" >> /etc/resolv.conf
 ← 设定为ISP提供的地址

[root@fedora ~]# echo "nameserver XXX.XXX.XXX.XXX" >> /etc/resolv.conf
 ← 设定为ISP提供的地址

[root@fedora ~]# cat /etc/resolv.conf | grep nameserver ← 确认
nameserver XXX.XXX.XXX.XXX
nameserver XXX.XXX.XXX.XXX


连接网络
[root@fedora ~]# vi /etc/rc.d/init.d/adsl 
#!/bin/bash
#
# adsl                     This script starts or stops an ADSL connection
#
# chkconfig: 2345 99 01
# description: Connects to ADSL provider
#
# LIC: GPL
#
# Copyright (C) 2000 Roaring Penguin Software Inc.  This software may
# be distributed under the terms of the GNU General Public License, version
# 2 or any later version.

# Source function library if it exists
test -r /etc/rc.d/init.d/functions && . /etc/rc.d/init.d/functions

# From AUTOCONF
prefix=/usr
exec_prefix=/usr

# Paths to programs
START=/sbin/ifup
STOP=/sbin/ifdown
STATUS=/usr/sbin/adsl-status

# Paths to config
IFCFG=/etc/sysconfig/network-scripts/ifcfg-ppp*

start() {
    echo -n "Bringing up ADSL link"
    for cfg in `ls $IFCFG`
    do
        DEVICE=`grep DEVICE $cfg|cut -d = -f 2`
        $START $DEVICE
        if [ $? -ne 0 ]; then
            echo_failure
            exit
        fi
    done
    touch /var/lock/subsys/adsl
    echo_success
    echo ""
}

stop() {
    echo -n "Shutting down ADSL link"
    for cfg in `ls $IFCFG`
    do
        DEVICE=`grep DEVICE $cfg|cut -d = -f 2`
        PIDFILE=`grep PIDFILE $cfg|cut -d = -f 2`
        if [ -f $PIDFILE ]; then
            ps `cat $PIDFILE` > /dev/null 2>&1
            if [ $? -eq 0 ]; then
                $STOP $DEVICE > /dev/null 2>&1
                if [ $? -ne 0 ]; then
                    echo_failure
                    exit
                fi
            fi
        fi
    done
    rm -f /var/lock/subsys/adsl
    echo_success
    echo ""
}

case "$1" in
    start)
        start
        ;;

    stop)
        stop
        ;;

    restart)
        stop
        start
        ;;

    status)
        for cfg in `ls $IFCFG`
        do
            $STATUS $cfg
        done
        ;;

    *)
        echo "Usage: adsl {start|stop|restart|status}"
        exit 1
esac

exit 0

[root@fedora ~]# chmod +x /etc/rc.d/init.d/adsl ← 赋予权限

[root@fedora ~]# /etc/rc.d/init.d/adsl start ← 启动ADSL
Bringing up ADSL link                                      [  OK  ]

[root@fedora ~]# chkconfig --add adsl ← 追加

[root@fedora ~]# chkconfig adsl on ← ADSL自动启动设定为ON

[root@fedora ~]# chkconfig --list adsl ← 确认
adsl            0ff   1ff   2n    3n    4n    5n    6ff ← 确认2~5为on

论坛徽章:
0
8 [报告]
发表于 2006-07-10 04:55 |只看该作者
原帖由 qruntime 于 2006-7-9 09:38 发表
请问各位.在FC4下能不能架设PPPoE服务器?  如果能. 指点一下吗? 感谢
盼? 我是linux的一个新手.同时也爱好者.好多地方不懂.请各位指教.


http://linux.chinaunix.net/doc/netconf/2005-02-03/1072.shtml

可以参考上面那篇。但是注意的是 rp-pppoe 与 mysql 在该发行版本已经纳入,package 安装上即可,不要再 tarball 安装。

==

论坛徽章:
0
9 [报告]
发表于 2006-07-10 08:23 |只看该作者
/etc/ppp/pppoe-server-options

  1. # PPP options for the PPPoE server
  2. # LIC: GPL
  3. +pap
  4. +chap
  5. -mschap
  6. login
  7. lcp-echo-interval 10
  8. lcp-echo-failure 2
  9. ms-dns 202.106.46.151
  10. ms-dns 202.106.0.20
复制代码



/etc/ppp/chap-secrets

  1. # Secrets for authentication using CHAP
  2. # client        server          secret                  IP addresses
  3. "platinum"      *               "pppoe-test"            *
复制代码



启动方法:在/etc/rc.local中添加

  1. /sbin/modprobe pppoe
  2. /sbin/pppoe-server -I eth0 -C PLATINUM -S LAN-ADSL -L 10.1.1.254 -R 10.1.1.1 -k -u -r
复制代码

论坛徽章:
1
数据库技术版块每日发帖之星
日期:2016-08-04 06:20:00
10 [报告]
发表于 2006-07-10 10:42 |只看该作者
哦.谢谢. 找时间我测试一下.这个问题一直困惑着我. 一有结果我马上完答哈.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP