Community discussions

 
User avatar
donjames
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Fri Mar 14, 2008 7:07 pm
Location: Henderson, Texas
Contact:

[SOLVED] RB411 as a wireless access point

Mon Mar 25, 2013 3:06 am

I am trying to make my RB411 act as a wireless access point. The RouterOS is level 4. The following script configures the RB411 as a router and starts with the router in the reset mode with the default settings removed:
/ip address
add address=192.168.1.201/24 disabled=no interface=ether1 
add address=192.168.0.1/24 disabled=no interface=wlan1 
/ip pool
add name=dhcp_pool1 ranges=192.168.1.2-192.168.1.254
add name=dhcp_pool2 ranges=192.168.0.2-192.168.0.254
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=ether1 lease-time=3d name=dhcp1
add address-pool=dhcp_pool2 disabled=no interface=wlan1 lease-time=3d name=dhcp2
/ip dhcp-server config
set store-leases-disk=5m
/ip dhcp-server network
add address=192.168.0.0/24 dns-server=4.2.2.2 gateway=192.168.0.1
/system ntp client
set enabled=yes mode=unicast primary-ntp=50.19.122.125
/interface wireless
set wlan1 band=2ghz-b/g default-authentication=yes disabled=no mode=ap-bridge
/ip firewall nat
add chain=srcnat out-interface=ether1 action=masquerade  src-address=192.168.0.0/24 to-addresses=0.0.0.0
/ip neighbor discovery
set wlan1 discover=yes
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=255 target-scope=10
/ip dhcp-server config
set store-leases-disk=5m
/ip dhcp-server network

I would like to know how to modify this script to make the RB411 a wireless access point. It will be connected to my local area network: 192.168.1.0/24. I would like for wireless clients to be able to connect to the RB411 with an address of 192.168.1.x. The RB411 would have only one IP address on the local area network. It would be just a simple wireless access point.

I have searched on wiki.mikrotik.com, but have been unable to find complete examples that tell how to do this.

Can someone give me a clue where to start?

Thanks,

donjames
Last edited by donjames on Wed Mar 27, 2013 12:15 am, edited 1 time in total.
 
User avatar
cbrown
Trainer
Trainer
Posts: 1840
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Re: RB411 as a wireless access point

Mon Mar 25, 2013 2:35 pm

You don't need that script. You just need to bridge ether1 and wlan1 together, put a dhcp-client on the bridge, and configure the wlan interface.
C.Brown

cbrown[at]ravenrocknetworks.com
MTCNA - MTCRE - MTCWE - MTCTCE
MTCSE - TRAINER-0179

Next Training
https://www.cbrown.co/2019/04/08/mtcna-june2019-wv/
 
User avatar
donjames
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Fri Mar 14, 2008 7:07 pm
Location: Henderson, Texas
Contact:

Re: RB411 as a wireless access point

Mon Mar 25, 2013 5:14 pm

Right.

I need a SPECIFIC example.

Thanks,

donjames
 
w0lt
Member
Member
Posts: 484
Joined: Wed Apr 02, 2008 2:12 pm
Location: Minnesota USA

Re: RB411 as a wireless access point

Mon Mar 25, 2013 6:35 pm

See if this works for you:


#
/interface bridge
add l2mtu=1526 name=Loopback protocol-mode=rstp

/interface bridge port
add bridge=Loopback interface=ether1
add bridge=Loopback interface=wlan1

/interface wireless security-profiles
add authentication-types=wpa-psk,wpa2-psk eap-methods=passthrough \
management-protection=allowed mode=dynamic-keys name="put name here" \
supplicant-identity="" wpa-pre-shared-key="put password here" wpa2-pre-shared-key=\
"put password here"

# this is for 5GHz interface, change to whatever you want (2 or 5)

/interface wireless
set 0 disabled=no frequency=5300 l2mtu=2290 mode=ap-bridge security-profile=\
"name from security profile" ssid="put name here" wireless-protocol=802.11
/ip dhcp-server
add disabled=no interface=wlan1 lease-time=1h name=dhcp1


/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1 use-peer-ntp=yes use-peer-dns=yes

/ip dns
set allow-remote-requests=yes
/ip hotspot ip-binding


-tp
MTCNA - 2011

" The Bitterness of Poor Quality Remains Long After the Sweetness of Low Price is Forgotten "

Image
 
User avatar
donjames
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Fri Mar 14, 2008 7:07 pm
Location: Henderson, Texas
Contact:

Re: RB411 as a wireless access point

Wed Mar 27, 2013 12:13 am

Here is the solution:
# jun/26/2014 23:47:50 by RouterOS 6.13
# This script configures an RB411AR to be a wireless access point.
# My local area network is 192.168.1.0/24.
# Change this to be compatible with your local area network.
# After running this script, access the router with Winbox and
# be sure that the wireless is on.  Set the ssid.
# The admin password is blank.  Be sure to set your admin password.
# This configuration enables NTP.  The script will set the time if internet
# access is available.
# Let me know if this works.
#
/interface bridge
add l2mtu=1526 name=bridge1
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g disabled=no l2mtu=2290 mode=\
    ap-bridge ssid=rb411ar-wap
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa-psk,wpa2-psk eap-methods="" \
    mode=dynamic-keys wpa-pre-shared-key=1234567890 wpa2-pre-shared-key=\
    1234567890
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m \
    mac-cookie-timeout=3d
/port
set 0 name=serial0
/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=wlan1
/ip address
add address=192.168.1.225/24 comment="default configuration" interface=\
    bridge1 network=192.168.1.0
/ip dhcp-relay
add dhcp-server=192.168.1.1 disabled=no interface=bridge1 name=relay1
/ip dhcp-server network
add address=192.168.1.0/24 dns-server=192.168.1.1,8.8.8.8,8.8.4.4 gateway=\
    192.168.1.1 netmask=24
/ip dns
set servers=192.168.1.1
/ip route
add distance=1 gateway=192.168.1.1 pref-src=192.168.1.225
/ip upnp
set allow-disable-external-interface=no
/system clock
set time-zone-name=America/Chicago
/system lcd
set contrast=0 enabled=no port=parallel type=24x4
/system lcd page
set time disabled=yes display-time=5s
set resources disabled=yes display-time=5s
set uptime disabled=yes display-time=5s
set packets disabled=yes display-time=5s
set bits disabled=yes display-time=5s
set version disabled=yes display-time=5s
set identity disabled=yes display-time=5s
set bridge1 disabled=yes display-time=5s
set wlan1 disabled=yes display-time=5s
set ether1 disabled=yes display-time=5s
/system ntp client
set enabled=yes primary-ntp=174.36.71.205 secondary-ntp=129.250.35.251
/system ntp server
set enabled=yes
/system scheduler
add interval=1h name=SetNtpServers on-event=SetNtpServers policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
    start-date=jun/01/2014 start-time=00:00:00
/system script
add name=SetNtpServers policy=\
    ftp,reboot,read,write,policy,winbox,password,sniff,sensitive,api source="#\
    \_http://forum.mikrotik.com/viewtopic.php\?f=9&t=56225&hilit=ntp\r\
    \n# SetNtpServers - Check and set NTP servers from NTP pool\r\
    \n# v1.2 Tested and Developed on ROS v5.7\r\
    \n#\r\
    \n# Change the following line as needed as progName should match script na\
    me \r\
    \n:local progName \"SetNtpServers\";\r\
    \n\r\
    \n# Array of NTP pools to use (check www.pool.ntp.org) one or a maximum of\
    \_two, a primary & secondary\r\
    \n# Modify the following line and array variable based on your locale (def\
    ault is north america).\r\
    \n:local arrNtpSystems (\"0.north-america.pool.ntp.org\", \"1.north-americ\
    a.pool.ntp.org\");\r\
    \n# Alternatively the US related pool below can be used.  \r\
    \n#:local arrNtpSystems (\"0.us.pool.ntp.org\", \"1.us.pool.ntp.org\");\r\
    \n#\r\
    \n# No modification is necessary beyond this line.\r\
    \n:put \"\$progName: Running...\";\r\
    \n:log info \"\$progName: Running...\";\r\
    \n:set arrNtpSystems [ :toarray \$arrNtpSystems ];\r\
    \n:if (( [ :len \$arrNtpSystems ] < 1 ) or ( [ :len \$arrNtpSystems ] > 2 \
    )) do={ \r\
    \n    :put \"\$progName: ERROR NTP Systems array (\\\$arrNtpSystems) must \
    be either one or two DNS names.\";\r\
    \n    :log info \"\$progName: ERROR NTP Systems array (\\\$arrNtpSystems) \
    must be either one or two DNS names.\";\r\
    \n} else={\r\
    \n    :local arrRosNtpSetting (\"primary-ntp\", \"secondary-ntp\");\r\
    \n    :local i 0;\r\
    \n    :foreach strNtpSystem in (\$arrNtpSystems) do={\r\
    \n        :local ipAddrNtpSystem [ :resolve \$strNtpSystem ];\r\
    \n        :local strRosNtpSetting [ :pick \$arrRosNtpSetting \$i ];\r\
    \n        :local strCurrentNtpIp [ /system ntp client get \$strRosNtpSetti\
    ng ];\r\
    \n        :put \"\$progName: NTP server DNS name \$strNtpSystem resolves t\
    o \$ipAddrNtpSystem.\";\r\
    \n        :log info \"\$progName: NTP server DNS name \$strNtpSystem resol\
    ves to \$ipAddrNtpSystem.\";\r\
    \n        :put \"\$progName: Current \$strRosNtpSetting setting is \$strCu\
    rrentNtpIp.\";\r\
    \n        :log info \"\$progName: Current \$strRosNtpSetting setting is \$\
    strCurrentNtpIp.\";\r\
    \n        :if ( [ :toip \$ipAddrNtpSystem ] != [ :toip \$strCurrentNtpIp ]\
    \_) do={\r\
    \n            :put \"\$progName: Changing \$strRosNtpSetting setting to \$\
    ipAddrNtpSystem.\";\r\
    \n            :log info \"\$progName: Changing \$strRosNtpSetting setting \
    to \$ipAddrNtpSystem.\";\r\
    \n            :local strCommand [ :parse \"/system ntp client set \$strRos\
    NtpSetting=\\\"\$ipAddrNtpSystem\\\"\"  ];\r\
    \n            \$strCommand;\r\
    \n        } else={\r\
    \n            :put \"\$progName: No changes were made for the \$strRosNtpS\
    etting NTP setting.\";\r\
    \n            :log info \"\$progName: No changes were made for the \$strRo\
    sNtpSetting NTP setting.\";\r\
    \n        }\r\
    \n        :set i (\$i + 1);\r\
    \n    }\r\
    \n}\r\
    \n:put \"\$progName: Done.\";\r\
    \n:log info \"\$progName: Done.\";\r\
    \n\r\
    \n"


################## end of configuration ###################
Thanks for the help.

donjames

Who is online

Users browsing this forum: No registered users and 4 guests