Community discussions

MikroTik App
 
gerencia@e-digitales.com
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Sat Feb 25, 2006 9:01 pm
Location: Sydney Au

Who no Pay don´t Surf !

Sun Apr 30, 2006 2:12 am

This the config for redirect users to a specific web page that no pay the bil...it works fine.

add chain=dst-nat n sr-address(the address of your client, in my case are static), protocol=tcp, src-port=0-65535,
action=dst-nat, to address= 200.30.xxx.xx public Ip of webpage with the message, to ports=8080(my webserver is in 8080port)

i expend about 5 hours to discover it.......
 
savage
Forum Guru
Forum Guru
Posts: 1220
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Sun Apr 30, 2006 5:05 pm

Not really a good idea to redirect *any* tcp connection to a web server. Not all TCP/IP Applications talk in HTTP.

You're much better to just redirect tcp/80 outbound to your web server, and drop any other outgoing connections thereafter...
Regards,
Chris
 
gerencia@e-digitales.com
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Sat Feb 25, 2006 9:01 pm
Location: Sydney Au

Sun Apr 30, 2006 7:42 pm

i´m new in mikrotik, and if i spend 5 hours with this, then i will spend 1 week with that,........
 
e2346437
Frequent Visitor
Frequent Visitor
Posts: 65
Joined: Sun Mar 12, 2006 1:35 am

Re: Who no Pay don´t Surf !

Mon May 01, 2006 5:36 am

This the config for redirect users to a specific web page that no pay the bil...it works fine.

add chain=dst-nat n sr-address(the address of your client, in my case are static), protocol=tcp, src-port=0-65535,
action=dst-nat, to address= 200.30.xxx.xx public Ip of webpage with the message, to ports=8080(my webserver is in 8080port)

i expend about 5 hours to discover it.......
But why does this config not work if you are not using routing and/or NAT, as I am?!? As a transparent bridge, I can't get this type of config to work at all.

Eric
 
gerencia@e-digitales.com
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Sat Feb 25, 2006 9:01 pm
Location: Sydney Au

Tue May 02, 2006 4:59 pm

I´m using NAT masq....and this rules are before the NAT masq......not after.
 
dannyboy
Member Candidate
Member Candidate
Posts: 195
Joined: Fri Sep 16, 2005 4:21 am
Location: Nicaragua/USA
Contact:

Thu May 18, 2006 10:11 pm

Hello,

I tried this
add chain=dst-nat n sr-address(the address of your client, in my case are static), protocol=tcp, src-port=0-65535,
action=dst-nat, to address= 200.30.xxx.xx public Ip of webpage with the message, to ports=8080(my webserver is in 8080port)

but the only difference is that my web server is inside my network and I am using pppoe for my clients to connect. If I put the to address "my server" the user does not get my "No Pay" site. but if I put lets say yahoo.com address, the user gets a yahoo site.

How come this is happening.
 
jo2jo
Forum Veteran
Forum Veteran
Posts: 970
Joined: Fri May 26, 2006 1:25 am

Thu Jun 15, 2006 9:05 am

this is not working for me either..i have the same setup and using dhcp for ips and nat and masq.

just doe not pick up any traffic on the rule.

are you sure you have it posted exactly?

tks
 
User avatar
Mitak
newbie
Posts: 42
Joined: Wed Jun 07, 2006 10:12 am
Location: Bulgaria
Contact:

redirect to google :)

Thu Jun 15, 2006 9:39 am

/ip firewall nat add chain=dstnat src-address=192.168.0.50 protocol=tcp action=dst-nat to-addresses=216.239.57.99 to-ports=80

This will redirect the client to google, or to your webserver - just replace the google`s IP.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24493
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Thu Jun 15, 2006 9:53 am

 
Gotmoh
newbie
Posts: 38
Joined: Fri Jul 15, 2005 8:56 am

Thu Jun 15, 2006 10:04 am

one small think. What if your customer change his ip? He will see web page with "pay your bill!", looks into his ip configuration and try add some numbers to his ip to continue surfing without pays bill. I mean then you must controll all ip in your network. Permitt "legal" ip and drop all other.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24493
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Thu Jun 15, 2006 10:07 am

use ARP binding and he will not change his ip.
 
User avatar
Mitak
newbie
Posts: 42
Joined: Wed Jun 07, 2006 10:12 am
Location: Bulgaria
Contact:

examples...

Thu Jun 15, 2006 10:28 am

Example from: http://www.mikrotik.com/docs/ros/2.8/ap ... g1.content

Convert all dynamic arp entryes to static:
:foreach i in [/ip arp find dynamic=yes interface=ether1] do={
  /ip arp add copy-from=$i
}
And just another good script:

In this example, we will monitor IP address on the ether1 interface, and if it is changed, send an e-mail:
/system script add name="changed-address" source={
  :if ([/system scheduler get check run-count]<=1) do={
    /system script run start-once
    }
  :global temp
  :global b
  :set temp $a
  :set b [ \
    /ip address get \
      [/ip address find interface=ether1] \
      address \
    ]
  :if ($temp != $b) do={
    /tool e-mail send \
      to=example@example.com \
      subject="The dynamic IP gets changed"
    :set a $b
    }
  }

/system script add name="start-once" source={
  :global a
  :set a [ \
    /ip address get \
      [/ip address find interface=ether1] \
      address \
    ]
  }

/system scheduler add name=check interval=1m on-event=changed-address

Who is online

Users browsing this forum: davidki, MSN [Bot], ninja365 and 110 guests