=========================================
PPPoE Server 配置=======================================环境搭建:eth2 设为WAN侧网卡,自动获取,如:IP:4.4.4.10/MASK:255.255.255.0/GW:4.4.4.1/DNS:202.96.209.5,210.22.70.3eth3设为LAN侧网卡,手动配置为: IP:11:11:11:1/MASK:255.255.255.0/GW:4.4.4.1/DNS:202.96.209.5,210.22.70.3开始配置:sudo apt-get install vlanmodprobe 8021qvconfig add eth3 35vconfig add eth3 42vconfig add eth3 6echo "1" > /proc/sys/net/ipv4/ip_forwardiptables -t nat -A POSTROUTING -o eth2 -j MASQUERADEiptables -t nat -A POSTROUTING -s 6.6.6.0/24 -o eth2 -j SNAT --to 4.4.4.106iptables -t nat -A POSTROUTING -s 11.11.11.0/24 -o eth2 -j SNAT --to 4.4.4.111iptables -t nat -A POSTROUTING -s 42.42.42.0/24 -o eth2 -j SNAT --to 4.4.4.142iptables -t nat -A POSTROUTING -s 35.35.35.0/24 -o eth2 -j SNAT --to 4.4.4.135killall pppoe-serverpppoe-server -I eth3 -L 11.11.11.1 -R 11.11.11.20 -N 10ifconfig eth3.6 downifconfig eth3.6 6.6.6.1 broadcast 6.6.6.255 netmask 255.255.255.0 uppppoe-server -I eth3.6 -L 6.6.6.1 -R 6.6.6.2 -N 10ifconfig eth3.42 downifconfig eth3.42 42.42.42.1 broadcast 42.42.42.255 netmask 255.255.255.0 uppppoe-server -I eth3.42 -L 42.42.42.1 -R 45.42.42.2 -N 10ifconfig eth3.35 downifconfig eth3.35 35.35.35.1 broadcast 35.35.35.255 netmask 255.255.255.0 uppppoe-server -I eth3.35 -L 35.35.35.1 -R 35.35.35.2 -N 10=================================================DHCP Server 配置================================================环境搭建:eth2 设为WAN侧网卡,自动获取,如:IP:4.4.4.10/MASK:255.255.255.0/GW:4.4.4.1/DNS:202.96.209.5,210.22.70.3eth3设为LAN侧网卡,手动配置为: IP:11:11:11:1/MASK:255.255.255.0/GW:4.4.4.1/DNS:202.96.209.5,210.22.70.3ifconfig eth3 downifconfig eth3 11.11.11.1 broadcast 11.11.11.255 netmask 255.255.255.0 upDHCP server安装1. 安装dhcp3-server sudo apt-get install dhcp3-server2. 备份系统原有的配置文件sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.original3. 配置config文件,打开/etc/dhcp3/dhcpd.conf,在其中添加或修改以下几句ddns-update-style none; #定义所支持的DNS动态更新类型(必选)默认为nonedefault-lease-time 36000; #租约期限,单位为秒max-lease-time 72000;#最大租约期限4. 执行DHCP server/etc/init.d/dhcp3-server restart#设置IP作用域,格式为subnet 子网ID netmask 子网掩码{}subnet 11.11.11.0 netmask 255.255.255.0{ range 11.11.11.100 11.11.11.200; #IP地址池 option routers 11.11.11.1; #指定默认网关 option subnet-mask 255.255.255.0; #指定子网掩码 option broadcast-address 11.11.11.255; #指定广播地址 option domain-name-servers 202.96.209.5,210.22.70.3; #指定DNS服务器 default-lease-time 6000; max-lease-time 72000;}subnet 7.7.7.0 netmask 255.255.255.0{ range 7.7.7.100 7.7.7.200; #IP地址池 option routers 7.7.7.1; #指定默认网关 option subnet-mask 255.255.255.0; #指定子网掩码 option broadcast-address 7.7.7.255; #指定广播地址 option domain-name-servers 202.96.209.5,210.22.70.3; #指定DNS服务器 default-lease-time 6000; max-lease-time 72000;}subnet 8.8.8.0 netmask 255.255.255.0{ range 8.8.8.100 8.8.8.200; #IP地址池 option routers 8.8.8.1; #指定默认网关 option subnet-mask 255.255.255.0; #指定子网掩码 option broadcast-address 8.8.8.255; #指定广播地址 option domain-name-servers 202.96.209.5,210.22.70.3; #指定DNS服务器 default-lease-time 6000; max-lease-time 72000;}subnet 10.10.10.0 netmask 255.255.255.0{ range 10.10.10.100 10.10.10.200; #IP地址池 option routers 10.10.10.1; #指定默认网关 option subnet-mask 255.255.255.0; #指定子网掩码 option broadcast-address 10.10.10.255; #指定广播地址 option domain-name-servers 202.96.209.5,210.22.70.3; #指定DNS服务器 default-lease-time 6000; max-lease-time 72000;}开始配置:sudo apt-get install vlanmodprobe 8021qvconfig add eth3 7vconfig add eth3 8vconfig add eth3 10echo "1" > /proc/sys/net/ipv4/ip_forwardiptables -t nat -A POSTROUTING -o eth2 -j MASQUERADEiptables -t nat -A POSTROUTING -s 7.7.7.0/24 -o eth2 -j SNAT --to 4.4.4.107iptables -t nat -A POSTROUTING -s 8.8.8.0/24 -o eth2 -j SNAT --to 4.4.4.108iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth2 -j SNAT --to 4.4.4.110ifconfig eth3.7 downifconfig eth3.7 7.7.7.1 broadcast 7.7.7.255 netmask 255.255.255.0 upifconfig eth3.8 downifconfig eth3.8 8.8.8.1 broadcast 8.8.8.255 netmask 255.255.255.0 upifconfig eth3.10 downifconfig eth3.10 10.10.10.1 broadcast 10.10.10.255 netmask 255.255.255.0 up/etc/init.d/dhcp3-server restart