RB2011: error importing script

I have a simple script to setup my RB2100 as a router connected to the public internet.

When I try to set up the router by importing from the command line, I get this:

[admin@MikroTik] >  import file=router-pubstaticip.rsc 
Opening script file router-pubstaticip.rsc

Script file loaded successfullyfailure: such login name already exists

When I copy the script from a text editor and paste it into a terminal window, it works right.

I am running RouterOS version 6.0rc12.

Can someone give me a clue about what is going on here?

Thanks,

donjames

Check the file by opening it in a text editor like notepad. I would suspect that you will find that it is trying to create a user that is already in the system as the error indicates. Remove the user from either the router or the script and try again.

Here is the script I am using:

# jan/01/2002 01:17:01 by RouterOS 6.0rc12
# software id = 4IWD-IB27
#
/interface bridge
add l2mtu=1598 name=bridge1 protocol-mode=rstp
/interface wireless
set 0 band=2ghz-b/g disabled=no l2mtu=2290 mode=ap-bridge ssid=\
    mikrotik tx-power=30 tx-power-mode=all-rates-fixed \
    wireless-protocol=802.11
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa-psk,wpa2-psk eap-methods=\
    passthrough management-protection=allowed mode=dynamic-keys \
    supplicant-identity=mikrotik-rb2011 wpa-pre-shared-key=xxxxx \
    wpa2-pre-shared-key=xxxxx
add authentication-types=wpa-psk,wpa2-psk eap-methods=passthrough \
    management-protection=allowed mode=static-keys-required name=profile1 \
    static-algo-0=40bit-wep static-key-0=aaaaaaaaaa supplicant-identity=""
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m
/ip pool
add name=dhcp_pool2 ranges=192.168.0.2-192.168.0.254
/ip dhcp-server
add address-pool=dhcp_pool2 disabled=no interface=bridge1 name=dhcp2
/tool user-manager customer
add backup-allowed=yes disabled=no login=admin password="" \
    paypal-accept-pending=no paypal-allowed=no paypal-secure-response=no \
    permissions=owner signup-allowed=no time-zone=-00:00
/interface bridge port
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=ether5
add bridge=bridge1 interface=ether6
add bridge=bridge1 interface=ether7
add bridge=bridge1 interface=ether8
add bridge=bridge1 interface=ether9
add bridge=bridge1 interface=ether10
add bridge=bridge1 interface=wlan1
/ip address
add address=100.100.100.10/24 interface=ether1 network=100.100.100.0
add address=192.168.0.1/24 interface=wlan1 network=192.168.0.0
/ip dhcp-server network
add address=192.168.0.0/24 dns-server=192.168.0.1 gateway=192.168.0.1
/ip firewall filter
add action=reject chain=input src-address=60.12.251.5
add action=reject chain=input src-address=122.194.113.155
add action=reject chain=input src-address=211.166.59.90
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1 to-addresses=0.0.0.0
/ip route
add distance=1 gateway=100.100.100.1 scope=255
/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 wlan1 disabled=yes display-time=5s
set bridge1 disabled=yes display-time=5s
set sfp1 disabled=yes display-time=5s
set ether1 disabled=yes display-time=5s
set ether2 disabled=yes display-time=5s
set ether3 disabled=yes display-time=5s
set ether4 disabled=yes display-time=5s
set ether5 disabled=yes display-time=5s
set ether6 disabled=yes display-time=5s
set ether7 disabled=yes display-time=5s
set ether8 disabled=yes display-time=5s
set ether9 disabled=yes display-time=5s
set ether10 disabled=yes display-time=5s
/system ntp client
set enabled=yes primary-ntp=50.19.122.125

The public IP, 100.100.100.10, is a fictitious address. The user is expected to substitute the public IP assigned to him by his ISP.

As I said before, it works with copy and paste but not with:

import file=router-publicstatip.rsc

Do you see anything obvious errors?

Thanks,

Don James

I don’t see anything. I have never used the user manager features though and I wonder if removing them would allow the import to be successful. If it then you’d at least have something to go on.

If that doesn’t help then I’d split out small chunks of the config and import them until I found out what was causing the issue.

I’m not sure how to remove the user manager features.

I will try breaking the script up into chunks and try to locate the error.

Thanks for the help.

Sincerely,

donjames

I was referring to removing the following from the script:

/tool user-manager customer
add backup-allowed=yes disabled=no login=admin password="" \
    paypal-accept-pending=no paypal-allowed=no paypal-secure-response=no \
    permissions=owner signup-allowed=no time-zone=-00:00

I tried removing that from the script and still get the same error message.

I will keep trying various chunks of the setup script until I find out what part is causing it to not work right.

Thanks for the help.

Don James