Community discussions

 
lavi
just joined
Topic Author
Posts: 3
Joined: Tue Jan 02, 2018 2:43 pm

Route all ethernet interface

Tue Jan 02, 2018 2:56 pm

For example, on my device configured with the following config file,

I want to redirect the destination ip address 172.16.0.0/24 to the ether1 port 172.16.0.0/24.

can you help me.

/ip hotspot profile
set [ find default=yes ] http-cookie-lifetime=1d
add dns-name=xyz hotspot-address=10.10.20.1 \
http-cookie-lifetime=1d login-by=cookie,http-chap,http-pap,mac-cookie \
name=xyz radius-interim-update=10m use-radius=yes

/ip hotspot
add disabled=no idle-timeout=1h interface=HOTSPOT keepalive-timeout=1h name=\
x profile=xyz

/ip hotspot user profile
set [ find default=yes ] idle-timeout=1h keepalive-timeout=1h \
mac-cookie-timeout=24h shared-users=2

/ip pool
add name=dhcp1 ranges=10.10.10.10-10.10.10.254
add name=dhcp ranges=10.10.20.10-10.10.20.254

/ip dhcp-server
add address-pool=dhcp1 disabled=no interface=LAN name=dhcp1
add address-pool=dhcp disabled=no interface=HOTSPOT lease-script=":if (\$lease\
Bound = 1) do={\r\
\n :for i from=1 to=6 do={\r\
\n :time {:delay}}\r\
\n :ip hotspot walled-garden add dst-host=:^captive.apple.com src-address\
=\$leaseActIP;\r\
\n} else {\r\
\n :ip hotspot walled-garden remove [/ip hotspot walled-garden find src-ad\
dress~\$leaseActIP dst-host~\"captive.apple.com\"];\r\
\n}" lease-time=36600s name=dhcp

/system logging action
set 3 remote=1.1.1.1 remote-port=1234

/ip dhcp-server network
add address=10.10.10.0/24 dns-server=8.8.8.8,208.67.220.220,208.67.222.222 \
gateway=10.10.10.1
add address=10.10.20.0/24 dns-server=8.8.8.8,208.67.220.220,208.67.222.222 \
gateway=10.10.20.1

/ip dns
set servers=8.8.8.8,208.67.220.220,208.67.222.222

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat comment="masquerade hotspot network" \
src-address=10.10.20.0/24
add chain=dstnat comment=WebProxySplashPage dst-address=1.1.1.1 \
dst-port=80 in-interface=HOTSPOT protocol=tcp
add action=redirect chain=dstnat comment=WebProxy dst-port=80 in-interface=\
HOTSPOT protocol=tcp to-ports=8080




/ip proxy
set enabled=yes

/ip proxy access
add src-address=10.10.20.0/24
add src-address=10.10.10.0/24

/ip route add dst-address=192.168.1.0/24 gateway=172.
16.0.1/24

/radius
add address=1234 secret=buistusuol34! service=hotspot timeout=5s

/system clock
set time-zone-name=Europe/Istanbul

/system identity
set name=xyz

/system logging
add action=remote prefix=xyz topics=web-proxy,account

/system ntp client
set enabled=yes primary-ntp=46.235.147.2 secondary-ntp=62.2.85.186 \
server-dns-names=0.pool.ntp.org,1.pool.ntp.org
 
scampbell
Trainer
Trainer
Posts: 446
Joined: Thu Jun 22, 2006 5:20 am
Location: Wellington, NZ
Contact:

Re: Route all ethernet interface

Tue Jan 02, 2018 10:53 pm

You state you want to redirect the destination ip address (subnet) 172.16.0.0/24 to the ether1 port 172.16.0.0/24.

I beleive in this example ether1 should already have an IP address in the 172.16.0.0/24 network (and not 172,16.0.1/24 presumably) ? If this is the case a dynamic route to the 172.16.0.0/24 subnet will be created by the routing process.

Can you please provide the results for "/ip address export" too please ? This may clarify your config better :-)
MTCNA, MTCWE, MTCRE, MTCTCE, MTCSE, MTCINE, Trainer
___________________
Mikrotik Distributor - New Zealand
http://www.campbell.co.nz
 
lavi
just joined
Topic Author
Posts: 3
Joined: Tue Jan 02, 2018 2:43 pm

Re: Route all ethernet interface

Thu Jan 04, 2018 12:01 am

hi,
ip resault list below. What I want to do is allow internet access to the devices in the network that I am modifying through this device. if it is required to access the internet, it is necessary to verify via hot spot. Our hot spot servers are located in the cloud.

admin@T01F0001S009C001] > /ip address export
# jan/03/2018 23:55:34 by RouterOS 6.35
# software id = IMMR-25G7
#
/ip address
add address=10.10.20.1/24 interface=ether2 network=10.10.20.0
add address=10.10.10.1/24 interface=LAN network=10.10.10.0
 
lavi
just joined
Topic Author
Posts: 3
Joined: Tue Jan 02, 2018 2:43 pm

Re: Route all ethernet interface

Fri Jan 05, 2018 8:42 am

do you have someone to help you?

Who is online

Users browsing this forum: No registered users and 17 guests