Edicar configuración de UniFi desde SSH

Publicado por D3M0N, 01 de Febrero de 2016, 05:34:21 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

D3M0N


Editar archivo de configuración por SSH:

Borrar archivo original:

Código: php
rm /tmp/system.cfg
touch /tmp/system.cfg


Codigo:
Código: php
echo "# bridge" >> /tmp/system.cfg
echo "# connectivity" >> /tmp/system.cfg
echo "# dhcpc" >> /tmp/system.cfg
echo "# ebtables" >> /tmp/system.cfg
echo "# iptables" >> /tmp/system.cfg
echo "# misc" >> /tmp/system.cfg
echo "# netconf" >> /tmp/system.cfg
echo "# ntpclient" >> /tmp/system.cfg
echo "# qos" >> /tmp/system.cfg
echo "# redirector" >> /tmp/system.cfg
echo "# resolv" >> /tmp/system.cfg
echo "# route" >> /tmp/system.cfg
echo "# syslog" >> /tmp/system.cfg
echo "# system" >> /tmp/system.cfg
echo "# ubntroam" >> /tmp/system.cfg
echo "# unifi" >> /tmp/system.cfg
echo "# users" >> /tmp/system.cfg
echo "# vlan" >> /tmp/system.cfg
echo "# wlans (radio)" >> /tmp/system.cfg
echo "aaa.1.br.devname=br0" >> /tmp/system.cfg
echo "aaa.1.devname=ath0" >> /tmp/system.cfg
echo "aaa.1.driver=madwifi" >> /tmp/system.cfg
echo "aaa.1.ssid=vport-0418D686E6C0" >> /tmp/system.cfg
echo "aaa.1.status=disabled" >> /tmp/system.cfg
echo "aaa.2.br.devname=br0" >> /tmp/system.cfg
echo "aaa.2.devname=ath1" >> /tmp/system.cfg
echo "aaa.2.driver=madwifi" >> /tmp/system.cfg
echo "aaa.2.ssid=UniFi-CAMBIO" >> /tmp/system.cfg
echo "aaa.2.status=disabled" >> /tmp/system.cfg
echo "aaa.status=enabled" >> /tmp/system.cfg
echo "bridge.1.devname=br0" >> /tmp/system.cfg
echo "bridge.1.fd=1" >> /tmp/system.cfg
echo "bridge.1.port.1.devname=eth0" >> /tmp/system.cfg
echo "bridge.1.port.2.devname=eth1" >> /tmp/system.cfg
echo "bridge.1.port.3.devname=ath0" >> /tmp/system.cfg
echo "bridge.1.port.4.devname=ath1" >> /tmp/system.cfg
echo "bridge.1.stp.status=disabled" >> /tmp/system.cfg
echo "bridge.status=enabled" >> /tmp/system.cfg
echo "connectivity.status=enabled" >> /tmp/system.cfg
echo "dhcpc.1.devname=br0" >> /tmp/system.cfg
echo "dhcpc.1.status=enabled" >> /tmp/system.cfg
echo "dhcpc.status=enabled" >> /tmp/system.cfg
echo "ebtables.1.cmd=-t broute -A BROUTING --in-interface ath0 --proto 0x888e -j DROP" >> /tmp/system.cfg
echo "ebtables.2.cmd=-t nat -A PREROUTING --in-interface ath1 -d BGA -j DROP" >> /tmp/system.cfg
echo "ebtables.3.cmd=-t nat -A POSTROUTING --out-interface ath1 -d BGA -j DROP" >> /tmp/system.cfg
echo "ebtables.status=enabled" >> /tmp/system.cfg
echo "iptables.status=disabled" >> /tmp/system.cfg
echo "locale.timezone=UTC" >> /tmp/system.cfg
echo "netconf.1.autoip.status=disabled" >> /tmp/system.cfg
echo "netconf.1.devname=br0" >> /tmp/system.cfg
echo "netconf.1.ip=0.0.0.0" >> /tmp/system.cfg
echo "netconf.1.status=enabled" >> /tmp/system.cfg
echo "netconf.1.up=enabled" >> /tmp/system.cfg
echo "netconf.2.autoip.status=disabled" >> /tmp/system.cfg
echo "netconf.2.devname=eth0" >> /tmp/system.cfg
echo "netconf.2.ip=0.0.0.0" >> /tmp/system.cfg
echo "netconf.2.promisc=enabled" >> /tmp/system.cfg
echo "netconf.2.status=enabled" >> /tmp/system.cfg
echo "netconf.2.up=enabled" >> /tmp/system.cfg
echo "netconf.3.autoip.status=disabled" >> /tmp/system.cfg
echo "netconf.3.devname=eth1" >> /tmp/system.cfg
echo "netconf.3.ip=0.0.0.0" >> /tmp/system.cfg
echo "netconf.3.promisc=enabled" >> /tmp/system.cfg
echo "netconf.3.status=enabled" >> /tmp/system.cfg
echo "netconf.3.up=enabled" >> /tmp/system.cfg
echo "netconf.4.autoip.status=disabled" >> /tmp/system.cfg
echo "netconf.4.devname=ath0" >> /tmp/system.cfg
echo "netconf.4.ip=0.0.0.0" >> /tmp/system.cfg
echo "netconf.4.promisc=enabled" >> /tmp/system.cfg
echo "netconf.4.status=enabled" >> /tmp/system.cfg
echo "netconf.4.up=disabled" >> /tmp/system.cfg
echo "netconf.5.autoip.status=disabled" >> /tmp/system.cfg
echo "netconf.5.devname=ath1" >> /tmp/system.cfg
echo "netconf.5.ip=0.0.0.0" >> /tmp/system.cfg
echo "netconf.5.promisc=enabled" >> /tmp/system.cfg
echo "netconf.5.status=enabled" >> /tmp/system.cfg
echo "netconf.5.up=enabled" >> /tmp/system.cfg
echo "netconf.status=enabled" >> /tmp/system.cfg
echo "ntpclient.1.server=0.ubnt.pool.ntp.org" >> /tmp/system.cfg
echo "ntpclient.1.status=enabled" >> /tmp/system.cfg
echo "ntpclient.status=enabled" >> /tmp/system.cfg
echo "qos.status=disabled" >> /tmp/system.cfg
echo "radio.1.ack.auto=disabled" >> /tmp/system.cfg
echo "radio.1.acktimeout=64" >> /tmp/system.cfg
echo "radio.1.ampdu.status=enabled" >> /tmp/system.cfg
echo "radio.1.antenna.gain=6" >> /tmp/system.cfg
echo "radio.1.bcmc_l2_filter.status=enabled" >> /tmp/system.cfg
echo "radio.1.bgscan.status=disabled" >> /tmp/system.cfg
echo "radio.1.channel=1" >> /tmp/system.cfg
echo "radio.1.clksel=1" >> /tmp/system.cfg
echo "radio.1.countrycode=840" >> /tmp/system.cfg
echo "radio.1.cwm.enable=0" >> /tmp/system.cfg
echo "radio.1.cwm.mode=0" >> /tmp/system.cfg
echo "radio.1.devname=ath0" >> /tmp/system.cfg
echo "radio.1.forbiasauto=0" >> /tmp/system.cfg
echo "radio.1.ieee_mode=11nght20" >> /tmp/system.cfg
echo "radio.1.mode=managed" >> /tmp/system.cfg
echo "radio.1.phyname=wifi0" >> /tmp/system.cfg
echo "radio.1.rate.auto=enabled" >> /tmp/system.cfg
echo "radio.1.rate.mcs=auto" >> /tmp/system.cfg
echo "radio.1.reg_obey=enabled" >> /tmp/system.cfg
echo "radio.1.rfscan=disabled" >> /tmp/system.cfg
echo "radio.1.status=enabled" >> /tmp/system.cfg
echo "radio.1.txpower=0" >> /tmp/system.cfg
echo "radio.1.txpower_mode=high" >> /tmp/system.cfg
echo "radio.1.ubntroam.status=disabled" >> /tmp/system.cfg
echo "radio.1.virtual.1.devname=ath1" >> /tmp/system.cfg
echo "radio.1.virtual.1.status=enabled" >> /tmp/system.cfg
echo "radio.countrycode=840" >> /tmp/system.cfg
echo "radio.status=enabled" >> /tmp/system.cfg
echo "redirector.status=disabled" >> /tmp/system.cfg
echo "resolv.host.1.name=UNIFIALIAS" >> /tmp/system.cfg
echo "resolv.nameserver.1.status=disabled" >> /tmp/system.cfg
echo "resolv.nameserver.2.status=disabled" >> /tmp/system.cfg
echo "resolv.status=enabled" >> /tmp/system.cfg
echo "route.status=enabled" >> /tmp/system.cfg
echo "syslog.level=7" >> /tmp/system.cfg
echo "syslog.status=enabled" >> /tmp/system.cfg
echo "system.timezone=UTC" >> /tmp/system.cfg
echo "ubntroam.macaddr=04:18:d6:86:e6:c0" >> /tmp/system.cfg
echo "ubntroam.mcastip=239.254.127.63" >> /tmp/system.cfg
echo "ubntroam.status=enabled" >> /tmp/system.cfg
echo "ubntroam.wiredev=br0" >> /tmp/system.cfg
echo "unifi.cfgcap_info=0x7" >> /tmp/system.cfg
echo "unifi.version=4.7.6" >> /tmp/system.cfg
echo "users.1.name=ubnt" >> /tmp/system.cfg
echo "users.1.password=VvpvCwhccFv6Q" >> /tmp/system.cfg
echo "users.1.status=enabled" >> /tmp/system.cfg
echo "users.status=enabled" >> /tmp/system.cfg
echo "vlan.status=disabled" >> /tmp/system.cfg
echo "wireless.1.addmtikie=disabled" >> /tmp/system.cfg
echo "wireless.1.authmode=1" >> /tmp/system.cfg
echo "wireless.1.autowds=disabled" >> /tmp/system.cfg
echo "wireless.1.devname=ath0" >> /tmp/system.cfg
echo "wireless.1.hide_ssid=true" >> /tmp/system.cfg
echo "wireless.1.is_guest=false" >> /tmp/system.cfg
echo "wireless.1.l2_isolation=disabled" >> /tmp/system.cfg
echo "wireless.1.mac_acl.policy=deny" >> /tmp/system.cfg
echo "wireless.1.mac_acl.status=enabled" >> /tmp/system.cfg
echo "wireless.1.mode=managed" >> /tmp/system.cfg
echo "wireless.1.parent=wifi0" >> /tmp/system.cfg
echo "wireless.1.pureg=1" >> /tmp/system.cfg
echo "wireless.1.puren=0" >> /tmp/system.cfg
echo "wireless.1.schedule_enabled=disabled" >> /tmp/system.cfg
echo "wireless.1.security=none" >> /tmp/system.cfg
echo "wireless.1.ssid=vport-0418D686E6C0" >> /tmp/system.cfg
echo "wireless.1.status=enabled" >> /tmp/system.cfg
echo "wireless.1.uapsd=disabled" >> /tmp/system.cfg
echo "wireless.1.usage=uplink" >> /tmp/system.cfg
echo "wireless.1.vport=enabled" >> /tmp/system.cfg
echo "wireless.1.vwire=disabled" >> /tmp/system.cfg
echo "wireless.1.wds=enabled" >> /tmp/system.cfg
echo "wireless.1.wmm=enabled" >> /tmp/system.cfg
echo "wireless.2.addmtikie=disabled" >> /tmp/system.cfg
echo "wireless.2.authmode=0" >> /tmp/system.cfg
echo "wireless.2.autowds=disabled" >> /tmp/system.cfg
echo "wireless.2.devname=ath1" >> /tmp/system.cfg
echo "wireless.2.hide_ssid=false" >> /tmp/system.cfg
echo "wireless.2.id=56af85c0b710b2afca2c554c" >> /tmp/system.cfg
echo "wireless.2.is_guest=false" >> /tmp/system.cfg
echo "wireless.2.l2_isolation=disabled" >> /tmp/system.cfg
echo "wireless.2.mac_acl.policy=deny" >> /tmp/system.cfg
echo "wireless.2.mac_acl.status=enabled" >> /tmp/system.cfg
echo "wireless.2.mode=master" >> /tmp/system.cfg
echo "wireless.2.parent=wifi0" >> /tmp/system.cfg
echo "wireless.2.pureg=1" >> /tmp/system.cfg
echo "wireless.2.puren=0" >> /tmp/system.cfg
echo "wireless.2.schedule_enabled=disabled" >> /tmp/system.cfg
echo "wireless.2.security=none" >> /tmp/system.cfg
echo "wireless.2.ssid=UniFi-CAMBIO" >> /tmp/system.cfg
echo "wireless.2.status=enabled" >> /tmp/system.cfg
echo "wireless.2.uapsd=disabled" >> /tmp/system.cfg
echo "wireless.2.usage=user" >> /tmp/system.cfg
echo "wireless.2.vport=disabled" >> /tmp/system.cfg
echo "wireless.2.vwire=disabled" >> /tmp/system.cfg
echo "wireless.2.wds=disabled" >> /tmp/system.cfg
echo "wireless.2.wmm=enabled" >> /tmp/system.cfg
echo "wireless.status=enabled" >> /tmp/system.cfg


Guardar y Aplicar + Reboot:
Código: php
cfgmtd -w -f /tmp/system.cfg
reboot