Community discussions

MikroTik App
 
happydaddy
Member Candidate
Member Candidate
Topic Author
Posts: 145
Joined: Thu May 24, 2007 12:18 am

only pppoe users allowed

Wed Apr 22, 2009 2:07 am

Hi

I have a pppoe server running and works great with usermanager.mikrotik server is 192.168.0.254. User uses pppoe to dail up, gets and ip and gateway, lets say 192.168.0.1 and gateway 192.168.0.254. Problem is if i use manually ip address like lets say 192.168.0.2 and gateway 192.168.0.254 i am able to access my internet with out pppoe dial up. Any way to block this?

Thanks
 
User avatar
skillful
Trainer
Trainer
Posts: 552
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: only pppoe users allowed

Wed Apr 22, 2009 2:12 am

Remove the IP Address on the PPPOE interface.
 
AliAmini
just joined
Posts: 5
Joined: Wed Apr 15, 2009 7:17 pm
Location: IR-Tehran
Contact:

Re: only pppoe users allowed

Wed Apr 22, 2009 11:04 am

create a different ip pool and assign to pppoe clients. and only use NAT for pppoe pool.
 
happydaddy
Member Candidate
Member Candidate
Topic Author
Posts: 145
Joined: Thu May 24, 2007 12:18 am

Re: only pppoe users allowed

Wed Apr 22, 2009 12:25 pm

Hi
Remove the IP Address on the PPPOE interface.
if i try this i cant use pppoe it gives me username and password invalid.
create a different ip pool and assign to pppoe clients. and only use NAT for pppoe pool.
Ive created a different ip pool and nated it, so now i have and ip pool for 192.168.0.1-192.168.0.254 which is not on pppoe and 192.168.9.1-192.168.9.254 which is. So how does this prevent someone from getting internet access if they use a manual ip and gateway of the router. below is a layout of network

Modem----Ether1--Ether2-------Lan clients

Ether2 has pppoe server on it

thanks
 
thadem
Member Candidate
Member Candidate
Posts: 115
Joined: Fri Apr 18, 2008 1:40 am

Re: only pppoe users allowed

Wed Apr 22, 2009 12:57 pm

only allow pppoe-encapsulated traffic on the bridge on your pppoe-server, simple as that :-)


add action=accept chain=forward comment="" disabled=no in-bridge=bridge_pppoe mac-protocol=0x8863 out-bridge=bridge_pppoe
add action=accept chain=forward comment="" disabled=no in-bridge=bridge_pppoe mac-protocol=0x8864 out-bridge=bridge_pppoe
add action=drop chain=forward comment="" disabled=no in-bridge=bridge_pppoe out-bridge=bridge_pppoe

by that you only allow pppoe-authentication and encapsulated traffic and drop everything else.
 
happydaddy
Member Candidate
Member Candidate
Topic Author
Posts: 145
Joined: Thu May 24, 2007 12:18 am

Re: only pppoe users allowed

Wed Apr 22, 2009 1:34 pm

only allow pppoe-encapsulated traffic on the bridge on your pppoe-server, simple as that :-)


add action=accept chain=forward comment="" disabled=no in-bridge=bridge_pppoe mac-protocol=0x8863 out-bridge=bridge_pppoe
add action=accept chain=forward comment="" disabled=no in-bridge=bridge_pppoe mac-protocol=0x8864 out-bridge=bridge_pppoe
add action=drop chain=forward comment="" disabled=no in-bridge=bridge_pppoe out-bridge=bridge_pppoe

by that you only allow pppoe-authentication and encapsulated traffic and drop everything else.
Image

Think I'm doing something wrong

Thanks
 
User avatar
skillful
Trainer
Trainer
Posts: 552
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: only pppoe users allowed

Wed Apr 22, 2009 3:39 pm

What you want can be easily done by removing the IP Address from the PPPOE interface. My network is setup that way and it works.

1. Remove the IP address from the PPPoE Interface
2. Disable DHCP Server for the PPPoE Interface
3. make sure PPP is set to use radius
/ppp aaa set use-radius=yes
 
happydaddy
Member Candidate
Member Candidate
Topic Author
Posts: 145
Joined: Thu May 24, 2007 12:18 am

Re: only pppoe users allowed

Wed Apr 22, 2009 3:58 pm

What you want can be easily done by removing the IP Address from the PPPOE interface. My network is setup that way and it works.

1. Remove the IP address from the PPPoE Interface
2. Disable DHCP Server for the PPPoE Interface
3. make sure PPP is set to use radius
/ppp aaa set use-radius=yes
1.i disabled the lan ip
2.i dont have a dhcp server
3.ppp is set to radius

Pc cannot connect to pppoe server. also, i am using usermanager.
 
User avatar
skillful
Trainer
Trainer
Posts: 552
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: only pppoe users allowed

Wed Apr 22, 2009 5:19 pm

You have to add the loopback IP Address to radius and user-manager list of routers
/tool user-manager router
add comment="" disabled=no ip-address=127.0.0.1 log="" name=router_name shared-secret=your_secret subscriber=admin
/radius
add accounting-backup=no accounting-port=1813 address=127.0.0.1 authentication-port=1812 called-id="" comment="" disabled=no domain="" realm="" secret=your_secret service=ppp,hotspot,wireless timeout=300ms
Remember to substitute "router-name" and "your-secret" as appropriate
 
happydaddy
Member Candidate
Member Candidate
Topic Author
Posts: 145
Joined: Thu May 24, 2007 12:18 am

Re: only pppoe users allowed

Fri Apr 24, 2009 1:34 am

Thanks works Great. Keep up the good work. :D
 
protechzone
just joined
Posts: 6
Joined: Thu Apr 17, 2008 2:48 am
Location: Lebanon / Beirut
Contact:

Re: only pppoe users allowed

Sun Aug 23, 2009 10:22 pm

More easy and simple way to disallow connecting to the internet using MIKROTIK LAN IP range + Gateway + DNS and Allow internet connection only for connected PPPOE users:

Load winbox console and set the following:
First step:
IP/Pool/Add
Name: PPPOE-Pool
Address: 10.20.30.1-10.20.30.254 ( You can use any range you like )

Second step:
PPP/Profiles/Default
Local address: 192.168.1.1 ( Mikrotik LAN interface IP )
Remote address: PPPOE-Pool

Third step now lets do NAT for PPPOE users only:
IP/Firewall/NAT
Action: masquerade
Chain: srcnat
Src.Address: 10.20.30.1-10.20.30.254
OUT Interface: WAN

Final note:
In this way whatever the client will put ip without connecting to the PPPOE, will not able to use the internet :)

Hope this small short tutorial clear many people mind and specially those who regret to tell me how to do this. God gave us a brain to use it ...

Who is online

Users browsing this forum: DrViliam, TheCat12 and 28 guests