http://blog.namran.net/2011/01/30/setting-up-ipv6-network-via-tm-unifi-on-centos-5/
currently not able to connect to vlan pppoe using centos.
i have this but not sure how to use:
http://home.abubakar.net/gitpub/?p=unifi_pppoe;a=commitdiff_plain
this article about creating vlan interface:
http://www.cyberciti.biz/tips/howto-configure-linux-virtual-local-area-network-vlan.html
exploring. pls wait for successfull stories :p
UPDATES (2):
i have a problem with PADO (no receive response from server)
http://wiki.mikrotik.com/wiki/Manual:Interface/PPPoE
further search i think there maybe bugs with my pppd
http://thomashw.github.io/blog/2012/09/06/rp-pppoe-and-pppd-lcp-timeout-sending-config-requests/
UPDATES (1):
http://www.tunnelbroker.net/forums/index.php?topic=951.0;wap2
found unifi dialer:
http://home.abubakar.net/gitpub/?p=unifi_pppoe;a=summary
#! /bin/sh
#
# unifi-pppoe Script to run PPPOE/VLAN for Telekom Malaysia
# UniFi Broadband Internet Service.
# chkconfig: 345 10 90
# description: UniFi service provides Internet and IPTV service
# over VLANs. This script sets your system to
# connect to the IP Network. It also sets up a
# bridged device to connection to the set top box
# via another NIC.
### BEGIN INIT INFO
# Provides: unifi-pppoe
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: PPPoE/VLAN for UniFi
### END INIT INFO
# Settings:
USER=user@unifi
PASS=unifipassword
WANIFACE=eth1
INETVLAN=500
IPTVIFACE=eth2
IPTVVLAN=600
# INSTRUCTIONS:
#
# (1) Install this script
#
# Copy it to /etc/init.d/unifi-pppoe. Make sure it is owned by
# root and set the permission for it to 700.
#
# don't forget to install the following packages:
# yum install vconfig rp-pppoe ppp bridge-utils [CentOS]
# sudo apt-get install vlan pppoe ppp bridge-utils [Ubuntu]
#
# Set it to run on startup automatically using:
# chkconfig unifi-pppoe on [CentOS]
# update-rc.d unifi-pppoe defaults [Ubuntu]
#
# (2) Edit the settings above
# Set USER to your UniFi user-id, PASS to your internet password.
# WANIFACE is the interface from which you connect your PC to the
# BTU.
# If you are using a vlan-tagging switch (e.g. mikrotik RB250GS or
# equivalent), set INETVLAN to blank. If your PC is connected
# directly to the BTU, set it to 500.
# Added a patch from Stanley Seow/rizvanrp for IPTV Vlan. You would
# need to set IPTVIFACE to the ethernet that your set top box is
# connected to, and IPTVVLAN to 600. If you don't have IPTV (e.g.
# UniFi BIZ), leave both settings blank.
# Example connection:
#
# +---------+ +-------------------+
# |Fiber BTU|---------|eth0 Linux PC |
# +---------+ | |
# | eth1 eth2 |
# +-------------------+
# +------+ | |
# | IPTV |----------------+ +--------- (LAN PCs)
# +------+
#
# (3) Test it using:
# /etc/init.d/unifi-pppoe start [to start]
# /etc/init.d/unifi-pppoe stop [to stop]
# Note: If you're planning to run this for more than a few minutes,
# make sure you setup a firewall on your system. Also, you
# may share the internet connection with other PCs via
# another interface. You can accomplish both of these using
# the excellent arno-iptables-firewall script. Install this
# from the website (for CentOS) or "sudo apt-get install
# arno-uptables-firewall" on ubuntu and follow the instructions.
# Written by shahada abubakar <shahada AT abubakar.net>
#
# Copyright (c) 2011, Shahada Abubakar.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
start_vpn() {
if [ -e /var/run/ppp-unifi.pid ]; then
PID=`head -1 /var/run/ppp-unifi.pid`
GOT=`ps xa | grep "$PID" | grep -v grep | wc -l`
if [ "$GOT" -ne 0 ] ; then
echo "unifi-pppoe is already running..."
return 1
fi
fi
if [ "$INETVLAN" != "" ] ; then
ifconfig $WANIFACE up 0.0.0.0
modprobe 8021q
vconfig set_name_type DEV_PLUS_VID_NO_PAD 2>&1 > /dev/null
vconfig add $WANIFACE $INETVLAN 2>&1 > /dev/null
# see contents of /proc/net/vlan/config for current status
PPPOEDEV=$WANIFACE.$INETVLAN
else
PPPOEDEV=$WANIFACE
fi
ifconfig $PPPOEDEV up 0.0.0.0
if [ "$INETVLAN" != "" -a "$IPTVVLAN" != "" -a "$IPTVIFACE" != "" ] ; then
vconfig add $WANIFACE $IPTVVLAN
ifconfig $WANIFACE.$IPTVVLAN up 0.0.0.0
ifconfig $IPTVIFACE up 0.0.0.0
brctl addbr iptv-bridge
brctl addif iptv-bridge $WANIFACE.$IPTVVLAN
brctl addif iptv-bridge $IPTVIFACE
# from stanleyseow AT gmail.com
# Up the bridge interface named iptv-bridge
ifconfig iptv-bridge up 0.0.0.0
fi
logger "Starting UniFi PPPoE session"
# note: add UniFi specific routes and post-up commands to
# /etc/ppp/ip-up.local
/usr/sbin/pppd pty \
"/usr/sbin/pppoe -p /var/run/pppoe-unifi.pid -I $PPPOEDEV -T 80 -U -m 1412" \
noipdefault noccp noauth hide-password usepeerdns mtu 1492 \
defaultroute mru 1492 noaccomp nodeflate nopcomp novj novjccomp \
user $USER lcp-echo-interval 20 lcp-echo-failure 3 \
password $PASS debug maxfail 0 persist \
linkname unifi ipparam unifi
}
status_vpn () {
if [ -e /var/run/ppp-unifi.pid ]; then
PID=`head -1 /var/run/ppp-unifi.pid`
GOT=`ps xa | grep "$PID" | grep -v grep | wc -l`
if [ "$GOT" -ne 0 ] ; then
echo "unifi-pppoe is running..."
return 1
else
echo "unifi-pppoe is dead but pid file exists"
return 0
fi
else
echo "unifi-pppoe is not running..."
return 0
fi
}
stop_vpn () {
if [ -e /var/run/ppp-unifi.pid ] ; then
PID=`head -1 /var/run/ppp-unifi.pid`
kill $PID
ifconfig $WANIFACE up 0.0.0.0
if [ "$INETVLAN" != "" ] ; then
if [ "$IPTVVLAN" != "" ] ; then
ifconfig iptv-bridge down
brctl delif iptv-bridge eth2
brctl delif iptv-bridge $WANIFACE.$IPTVVLAN
brctl delbr iptv-bridge
vconfig rem $WANIFACE.$IPTVVLAN
fi
vconfig rem $WANIFACE.$INETVLAN
fi
else
echo "unifi-pppoe is not running..."
return 0
fi
}
case "$1" in
start)
start_vpn;
RETVAL=$?
;;
stop)
stop_vpn;
RETVAL=$?
;;
restart)
stop_vpn;
sleep 1;
start_vpn
RETVAL=$?
;;
status)
status_vpn;
RETVAL=$?
;;
*)
echo "Usage: unifi-pppoe start|stop|restart|status"
exit 1
esac
exit $RETVAL
No comments:
Post a Comment