Friday, April 29, 2016

Replacing TM Malaysia provided router for Unifi service

If you plan to replace the router provided by TM Malaysia with your own router, you have to ensure that the replacement router has the option to choose TM Unifi as the ISP or at least allow you to configure the WAN interface with a VLAN tag.

Below is how you can replace the router with a Linux based router for internet access, which is tagged to VLAN 500.

1. Create the VLAN interface 


Run the following command to create a VLAN interface.  Replace the x with your actual interface eg eth0, which will then make the VLAN interface as 'eth0.500'. The '.' is an indication that it is a VLAN interface.

[root@router ~]# vi /etc/sysconfig/network-scripts/ifcfg-x.500

Enter the following details

DEVICE=eth0.500
TYPE="VLAN"
ONBOOT="yes"
BOOTPROTO="none"
VLAN="yes"

2. Create the PPP interface


Run the following command to create the PPP interface

[root@router ~]# vi /etc/sysconfig/network-scripts/ifcfg-ppp0

Enter the following details. Remember to change as needed.

DEVICE=ppp0
TYPE="xDSL"
USERCTL="no"
BOOTPROTO="dialup"
NAME="DSLppp0"
ONBOOT="yes"
PIDFILE="/var/run/pppoe-ppp0.pid"
FIREWALL="NONE"
PING="."
PPPOE_TIMEOUT="80"
LCP_FAILURE="5"
LCP_INTERVAL="20"
CLAMPMSS="1412"
CONNECT_POLL="6"
CONNECT_TIMEOUT="80"
DEFROUTE="yes"
SYNCHRONOUS="no"
ETH="eth0.500"
PROVIDER="DSLppp0"
PEERDNS="yes"
USER="yourusername@unifibiz"

3. Create the PPP password files


Create the password files with the following command, one for CHAP and and one for PAP


[root@router ~]# vi /etc/ppp/chap-secrets

[root@router ~]# vi /etc/ppp/pap-secrets


Enter your username and password as provided by TM for both files.


"yourusername@unifibiz" * "password" *

4. You can now start the PPP interface

[root@router ~]# ifup ppp0


5. Check if the connection is successful


You can check if the connection is successful by running the following command. If the connection is successful, the ppp0 will be up and obtained an IP address

[root@router ~]# ifconfig ppp0
ppp0      Link encap:Point-to-Point Protocol
          inet addr:x.x.x.x  P-t-P:x.x.x.x  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:908071 errors:0 dropped:0 overruns:0 frame:0
          TX packets:397529 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:1039747302 (991.5 MiB)  TX bytes:91079309 (86.8 MiB)




1 comment:

Joseph Mikel said...

This information is meaningful and magnificent, Which you have shared here about the Unifi router service. I couldn't find any knowledge on this matter prior to. I would like to thanks for sharing this article here. Ubiquiti Unifi Ap Thailand