Monday, March 16, 2015

Simulasi PPPoE di Mikrotik

Kali ini kita bahas mengenai PPPoE. Ini merupakan simulasi, sebelum diimplementasikan secara real,...dalam kehidupan nyata. (wuih... kata-katanya itu mengerikan...)
Karena materinya cukup panjang, maka dibagi 2 postingan. Posting pertama, hanya akan membahas settingan pada 2 buah perangkat Mikrotik, yang menggunakan service (layanan) PPPoE, seperti pada gambar.
PPPoE Server di Mikrotik

Apa itu PPPoE?
The Point-to-Point Protocol over Ethernet (PPPoE) is a network protocol for encapsulating PPP frames inside Ethernet frames. It appeared shortly after the year 2000, in the context of the boom of the DSL as the solution for tunneling packets over the DSL connection to the ISP's IP network, and from there to the rest of the Internet. A 2005 networking book noted that "Most DSL providers use PPPoE, which provides authentication, encryption, and compression. Typical use of PPPoE involves leveraging the PPP facilities for authenticating the user with a username and password, predominately via the PAP protocol and less often via CHAP. (wikipedia.org)
The PPPoE (Point to Point Protocol over Ethernet) protocol provides extensive user management, network management and accounting benefits to ISPs and network administrators. Currently PPPoE is used mainly by ISPs to control client connections for xDSL and cable modems as well as plain Ethernet networks. (wiki.mikrotik.com).

Ndak ngerti Om, bisa dijelasin dengan bahasa yang sederhana.
Bahasa sederhananya, anda sudah pernah lihat modem ADSL?

A D S L ?
Speedy, speedy... Indiehome...

Ooo, yang itu... iya, iya...gimana itu ?.
Nah di settingan modemnya itu ada settingan PPPoE. Dengan settingan itu, maka PC bisa connect ke internet. 
Dimana tempat ngeliat settingannya itu, Om...?
Ya di dalam modem, ada settingannya...

Mmm ???
Gampang itu. Cari saja cara settingnya di internet. Masa’ smua mesti “disuapin” ?

....
Ok. Lanjut... dan berikut ini prosedur dan konfigurasinya.

PPPoE-Server-Mikrotik
  • Setting interfacenya, dan IP addressnya.
  • Setting 2 buah pool range IP address. Satu range IP untuk user. Dan satu range IP untuk user yang menggunakan pppoe.
  • Setting dhcp server dan dns
  • Setting pppoe-server,
  • Dan terakhir setting firewall nat
/interface ethernet
set 0 auto-negotiation=yes disabled=no name=ether1 speed=100Mbps
set 1 auto-negotiation=yes disabled=no name=ether2 speed=100Mbps
/ip address
add address=192.168.1.1/24 disabled=no interface=ether2 network=192.168.1.0
add address=172.16.1.1/30 disabled=no interface=ether1 network=172.16.1.0

/ip pool
add name=dhcp_pool1 ranges=192.168.1.2-192.168.1.254
add name=pool-pppoe ranges=172.16.22.2-172.16.22.254

/ip dhcp-server
add address-pool=dhcp_pool1 authoritative=after-2sec-delay bootp-support=\
    static disabled=no interface=ether2 lease-time=3d name=dhcp1

/ip dhcp-server config
set store-leases-disk=5m

/ip dhcp-server network
add address=192.168.1.0/24 dhcp-option="" dns-server="" gateway=192.168.1.1 \
    ntp-server="" wins-server=""

/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB \
    max-udp-packet-size=4096 servers=8.8.8.8,8.8.4.4

/interface pppoe-server
add disabled=no name=pppoe-in1 service="" user=""

/ppp profile
set 0 change-tcp-mss=yes name=default only-one=default \
    remote-ipv6-prefix-pool=none use-compression=default use-encryption=\
    default use-ipv6=yes use-mpls=default use-vj-compression=default
add change-tcp-mss=default dns-server=8.8.8.8,8.8.4.4 \
    local-address=172.16.22.1 name=profile1 only-one=default remote-address=\
    pool-ppoe use-compression=default use-encryption=default use-ipv6=yes \
    use-mpls=default use-vj-compression=default

/ppp secret
add caller-id="" disabled=no limit-bytes-in=0 limit-bytes-out=0 name=user1 \
    password=12345 profile=profile1 routes="" service=pppoe

/interface pppoe-server server
add authentication=pap default-profile=default disabled=no interface=ether2 \
    disabled one-session-per-host=yes service-name=Server-PPPoE

/ip firewall nat
add action=masquerade chain=srcnat disabled=no out-interface=ether1 \
    src-address=172.16.22.0/24

/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=172.16.1.2 scope=30 \
    target-scope=10

/system identity
set name=PPPoE-Server-Mikrotik

PPPoE-Client-Mikrotik
  • Setting interface dan ip address. Pada ether 1, setting IP addressnya manual atau dengan dhcp client. Jika menggunakan dhcp-client, opsi “add-default-route=no. Sedangkan ether 2, dibuat manual. (ether 2 sebagai gateway untuk user di bawahnya).
  • Setting pppoe-client. Opsi “add-default-route=yes.
  • Setting firewall nat.
/interface ethernet
set 0 arp=enabled disabled=no full-duplex=yes name=ether1 speed=100Mbps
set 1 arp=enabled disabled=no full-duplex=yes name=ether2 speed=100Mbps

/ip address
add address=192.168.10.1/24 disabled=no interface=ether2 network=192.168.10.0

/ip dhcp-client
add add-default-route=no disabled=no interface=ether1 use-peer-dns=yes \
    use-peer-ntp=yes

/interface pppoe-client
add ac-name="" add-default-route=yes allow=pap,chap,mschap1,mschap2 \
    dial-on-demand=no disabled=no interface=ether1 \
    name=pppoe-out1 password=12345 profile=default \
    service-name="" use-peer-dns=no user=user1

/ip firewall nat
add action=masquerade chain=srcnat disabled=no out-interface=pppoe-out1

/system identity
set name=PPPoE-Client-Mikrotik
      
Ok, beres, mari kita lihat hasilnya. Seharusnya di PPPoE-Client-Mikrotik, akan ada tambahan interface dan IP address.
[admin@PPPoE-Client-Mikrotik] > ip address print
Flags: X - disabled, I - invalid, D - dynamic
 #   ADDRESS            NETWORK         INTERFACE    
 0 D 192.168.1.254/24   192.168.1.0     ether1       
 1 D 172.16.22.254/32   172.16.22.1     pppoe-out1   
 2   192.168.10.1/24    192.168.10.0    ether2       

[admin@PPPoE-Client-Mikrotik] /interface> print
Flags: D - dynamic, X - disabled, R - running, S - slave
 #     NAME                        TYPE               MTU L2MTU  MAX-L2MTU
 0  R  ether1                      ether             1500
 1  R  ether2                      ether             1500
 2  R  pppoe-out1                  pppoe-out         1480
 3     pptp-out1                   pptp-out       

Lihat juga status interface pppoe-out1. Jika berhasil akan ada status running dan connected pada bagian bawah, seperti gambar ini.
Status interface pppoe-out1

No comments:

Post a Comment