Jump to content

Александр Рыжов

Moderators
  • Posts

    1227
  • Joined

  • Last visited

  • Days Won

    25

Posts posted by Александр Рыжов

  1. 19 минут назад, bbaslican сказал:

    is there any way to format usb disk and re install opkg  and entware remotely ?

    Nope:( Unless you've got two partitions for Entware deployment and ability to switch between them.

    • Confused 1
  2. DNS-O-Matic provides you a free and easy way to announce your dynamic IP changes to multiple services with a single update. Using DNS-O-Matic allows you to pick and choose what Dynamic DNS services you want to notify, all from one easy to use interface.

    This is helpful if Keenetic does not support your Dynamic DNS provider directly.

    1. Create a DNS-O-Matic account

    2. Configure it to start sending the updates with your preferred Dynamic DNS provider

    3. In the Keenetic Web interface, open Domain Name » DDNS and configure a custom profile:

      • Service: Another

      • DDNS service provider URL: https://updates.dnsomatic.com/nic/update

      • Domain name: (DDNS domain name that is configured in DNS-O-Matic, such as example.ddns.net)

      • User name: (DNS-O-Matic user name)

      • Password: (DNS-O-Matic password)

      • Automatically detect my IP address: uncheck

      • For connections: select your connection

    4. Click "Save".

    Check that your current IP address is shown in https://dnsomatic.com/ account status.

  3. There is a quick and easy solution to deploy traffic accounting on your Keenetic. The external USB storage is required. The same storage can be used for the other Keenetic applications at the same time.

    What is darkstat

    Darkstat is a traffic accounting software that allows you to monitor the activity of all network hosts in your home network.

    Скрытый текст

    screen-graphs.png

    screen-hosts.png

    screen-ports.png

     

    How to install

    • Create the "install" directory on a USB drive, and put the attached file in there
    • Make sure you have installed the Open Package support
    • Connect the USB drive to the Keenetic
    • Enable OPKG, select your USB drive and save settings.

    How to use

    Open http://my.keenetic.net:667 in your browser.

    How to remove

    • Unmount your USB disk from the Applications menu
    • Remove "etc" and "bin" directories

    darkstat_mipsel.tgz

    • Thanks 1
  4. How to remove ads from web pages and Android apps.

    Before:

    4d262a31311et.jpg

    After:

    5643795dd011t.jpg

    Installation

    Install necessary packages:

    opkg install dnsmasq-full iptables ndmq

    Create a netfilter hook /opt/etc/ndm/netfilter.d/010-intercept-dns.sh:

    #!/bin/sh
    
    [ "$table" != "nat" ] && exit 0
    
    lan_ip=$(ndmq -p 'show interface Bridge0' -P address)
    
    iptables -t nat -I PREROUTING -p udp -m udp --dport 53 -j DNAT --to-destination $lan_ip:65053
    iptables -t nat -I PREROUTING -p tcp -m tcp --dport 53 -j DNAT --to-destination $lan_ip:65053
    

    Make it executable:

    chmod +x /opt/etc/ndm/netfilter.d/010-intercept-dns.sh

    Add the following lines to the /opt/etc/dnsmasq.conf:

    no-resolv
    server=77.88.8.88#1253
    server=77.88.8.2#1253
    port=65053
    

    Download your favorite blacklist to /opt/etc/hosts. For example:

    wget -O /opt/etc/hosts http://winhelp2002.mvps.org/hosts.txt

    Done! Reboot your router for the changes to take effect.

    Troubleshooting

    1. Make sure you have not configured custom DNS servers in the Internet Connection properties.

    2. Flush your operating system DNS cache (in Windows — ipconfig /flushdns)

    3. Close and open your web browser.

    Notes

    Notes

    The iptables rules redirect all DNS requests to the dnsmasq. The dnsmasq uses /opt/etc/hosts as an exception list. Yandex.DNS anti-ad servers are used for the unlisted hostnames. You can replace Yandex.DNS with Norton ConnectSafe or AdGuard public servers.

  5. Chat with your Keenetic CLI via Telegram like a pro!:)

    b92d38f5d243.png

    • Install necessary Entware packages:
      opkg install bash curl dtach
       

       

    • Download the bash-script, which serving as Telegram bot:
      curl --output /opt/bin/bashbot.sh --insecure https://raw.githubusercontent.com/ryzhovau/telegram-bot-bash/master/opt/bin/bashbot.sh
      curl --output /opt/bin/JSON.sh --insecure https://raw.githubusercontent.com/ryzhovau/telegram-bot-bash/master/opt/bin/JSON.sh
      curl --output /opt/etc/init.d/S51bashbot  --insecure https://raw.githubusercontent.com/ryzhovau/telegram-bot-bash/master/opt/etc/init.d/S51bashbot
      chmod +x /opt/bin/bashbot.sh
      chmod +x /opt/bin/JSON.sh
      chmod +x /opt/etc/init.d/S51bashbot
       

       

    • Ask @BotFather to create a new boot and remember auth token for it.
    • Write down this token to TOKEN='' string at /opt/bin/bashbot.sh.
    • Replace following string in /opt/bin/bashbot.sh
      *) msg="$MESSAGE";;
       

      to

      *) msg=$(ndmq -p "$MESSAGE" -x);;
       

       

    • Start bot buy typing /opt/etc/init.d/S51bashbot start. This bot will start automatically on every boot.

    Please, keep in mind security question like authorisation, which is outside of this How-To. This is just proof-of-concept, which you can edit for your needs.

    Bot log can be found at /opt/var/log/bashbot.log.

     

    • Thanks 2
  6. You may use Debian 8.11 "Jessie" , Debian 9.13 "Stretch" , Debian 10.13 "Buster" , Debian 11.11 "Bullseye" , Debian 12.12 "Bookworm" or Debian 13.1 "Trixie" right on your Keenetic router.

    http://files.keenopt.ru/ is a good example of working Debian on Keenetic Giga III.

    ! Dropping mips architecture

    ! Dropping mipsel architecture

    ! Debian 12.3 image release delayed

    Requirements

    Installation

               ( for KN-2011 or KN-2111 - debian-jessie-8_11-mips.tar.gz or debian-stretch-9_13-mips.tar.gz or debian-buster-10.13-mips.tar.gz ),

               ( for KN-2710 - debian-buster-10.13-aarch64.tar.gz or debian-bullseye-11.11-aarch64.tar.gz or debian-bookworm-12.12-aarch64.tar.gz or                     debian-trixie-13.1-aarch64.tar.gz)

    • Open OPKG page, pick your USB drive and hit "Apply".

    Give your Keenetic a couple of minutes to unpack necessary files, you''ll see following syslog messages if all went fine:

    [I] Jul 19 13:24:28 ndm: Opkg::Manager: disk is set to: fb4e34d1-3cab-fd19-b96d-4bb3a2d5ec84:
    [I] Jul 19 13:24:28 ndm: Opkg::Manager: init script reset to default: /opt/etc/initrc.
    [I] Jul 19 13:24:28 ndm: kernel: EXT4-fs (sda1): re-mounted. Opts: (null)
    [I] Jul 19 13:24:28 ndm: Opkg::Manager: /tmp/mnt/FIT8GB/ mounted to /tmp/mnt/FIT8GB/.
    [I] Jul 19 13:24:28 ndm: Opkg::Manager: /tmp/mnt/FIT8GB/ mounted to /opt/.
    [I] Jul 19 13:24:28 npkg: inflating "debian-keenetic.tar.gz".
    [I] Jul 19 13:24:28 ndm: Core::ConfigurationSaver: saving configuration...
    [I] Jul 19 13:26:10 ndm: Opkg::Manager: /tmp/mnt/FIT8GB/ initialized.
    [I] Jul 19 13:26:10 ndm: Core::ConfigurationSaver: configuration saved.
    [I] Jul 19 10:26:10 root: Starting Debian services...
    [W] Jul 19 13:26:11 ndm: kernel: Algorithmics/MIPS FPU Emulator v1.5
    [I] Jul 19 13:26:11 ndm: Opkg::Manager: /opt/etc/initrc: Starting OpenBSD Secure Shell server: sshd.
    [I] Jul 19 13:26:11 ndm: Opkg::Manager: /opt/etc/initrc: Done.
    [I] Jul 19 10:26:11 sshd[448]: Server listening on 0.0.0.0 port 22.
    [I] Jul 19 10:26:11 sshd[448]: Server listening on :: port 22.
    
    Spoiler
    ...
    [I] Feb 19 12:26:45 ndm: Opkg::Manager: disk is set to: debian:/.
    [I] Feb 19 12:26:45 ndm: kernel: EXT4-fs (sde): re-mounted. Opts: (null)
    [I] Feb 19 12:26:45 ndm: Opkg::Manager: /tmp/mnt/bc2a2eb6-f889-4366-83ba-2cc3b93646f9 mounted to /tmp/mnt/bc2a2eb6-f889-4366-83ba-2cc3b93646f9.
    [I] Feb 19 12:26:45 ndm: Opkg::Manager: /tmp/mnt/bc2a2eb6-f889-4366-83ba-2cc3b93646f9 mounted to /opt/.
    
    [I] Feb 19 12:26:45 npkg: inflating "debian-stretch-9_8-mipsel.tar.gz".
    
    [I] Feb 19 12:27:13 ndm: Opkg::Manager: /tmp/mnt/bc2a2eb6-f889-4366-83ba-2cc3b93646f9 initialized.
    [I] Feb 19 12:27:13 ndm: Opkg::Manager: init script reset to default: /opt/etc/initrc.
    [I] Feb 19 12:27:13 ndm: Core::ConfigurationSaver: saving configuration...
    [I] Feb 19 12:27:13 ndm: Dns::Manager: RPC-only mode enabled.
    [I] Feb 19 12:27:13 ndnproxy: ndnproxy stopped.
    
    [I] Feb 19 09:27:13 0: Starting Debian services...
    [I] Feb 19 09:27:14 sshd[8096]: Server listening on 0.0.0.0 port 222.
    [I] Feb 19 12:27:14 ndm: Opkg::Manager: /opt/etc/initrc: Starting OpenBSD Secure Shell server: sshd.
    [I] Feb 19 12:27:14 ndm: Opkg::Manager: /opt/etc/initrc: Done.
    [I] Feb 19 09:27:14 sshd[8096]: Server listening on :: port 222.
    
    [I] Feb 19 12:27:15 ndnproxy: ndnproxy 1.3.0b22 started.
    [I] Feb 19 12:27:15 ndnproxy: PID file: /var/ndnproxymain.pid.
    [I] Feb 19 12:27:15 ndnproxy: stats. file: /var/ndnproxymain.stat.
    [I] Feb 19 12:27:17 ndm: Core::ConfigurationSaver: configuration saved.
    
    [I] Feb 19 09:27:55 sshd[8308]: Connection closed by 192.168.1.60 port 48314 [preauth]
    [I] Feb 19 09:28:34 sshd[8476]: Accepted password for root from 192.168.1.60 port 48318 ssh2
    [I] Feb 19 09:28:34 sshd[8476]: pam_unix(sshd:session): session opened for user root by (uid=0)
    [E] Feb 19 09:28:34 sshd[8476]: pam_env(sshd:session): Unable to open env file: /etc/default/locale: No such file or directory
    
    [I] Feb 19 09:29:56 chroot: Hello, World!
    
    [I] Feb 19 09:31:13 sshd[8476]: Received disconnect from 192.168.1.60 port 48318:11: disconnected by user
    [I] Feb 19 09:31:13 sshd[8476]: Disconnected from 192.168.1.60 port 48318
    [I] Feb 19 09:31:13 sshd[8476]: pam_unix(sshd:session): session closed for user root
    
    [I] Feb 19 12:31:30 ndm: Opkg::Manager: unmount existing /opt disk: debian:/.
    [I] Feb 19 09:31:30 0: Stopping Debian services...
    [I] Feb 19 09:31:31 sshd[8096]: Received signal 15; terminating.
    [I] Feb 19 12:31:31 ndm: Opkg::Manager: /opt/etc/initrc: Stopping OpenBSD Secure Shell server: sshd.
    [I] Feb 19 12:31:31 ndm: Opkg::Manager: /opt/etc/initrc: Done.
    [I] Feb 19 12:31:31 ndm: Opkg::Manager: disk unmounted.
    
    [I] Feb 19 12:31:31 ndnproxy: ndnproxy stopped.
    [I] Feb 19 12:31:31 ndm: Dns::Manager: RPC-only mode disabled.
    [I] Feb 19 12:31:31 ndm: Opkg::Manager: disk is unset.
    [I] Feb 19 12:31:31 ndm: Opkg::Manager: init script reset to default: /opt/etc/initrc.
    [I] Feb 19 12:31:31 ndm: Core::ConfigurationSaver: saving configuration...
    [I] Feb 19 12:31:33 ndnproxy: ndnproxy 1.3.0b22 started.
    [I] Feb 19 12:31:33 ndnproxy: PID file: /var/ndnproxymain.pid.
    [I] Feb 19 12:31:33 ndnproxy: stats. file: /var/ndnproxymain.stat.
    [I] Feb 19 12:31:34 ndm: Core::ConfigurationSaver: configuration saved.
    ...

     

    Using Debian

    Use following SSH credentials to get access to Debian environment:

    • host: my.keenetic.net,
    • port: 222
    • user name: root,
    • password: debian.

    This is it, you've got 10000+ available packages from one of greatest linux community!

    For 64MB RAM devices is highly recommended to turn on Swap-file.

     

    Details

    You see chroot-environment after SSH logon, there's only minimal Busubox outside of it and /opt/etc/initrc script to fire up sandbox, this script starts necessary Debian services on boot and gracefully shut them down on reboot or unmount USB drive:

     

    [I] Jul 19 10:28:36 root: Stopping Debian services...
    [I] Jul 19 10:28:36 sshd[448]: Received signal 15; terminating.
    [I] Jul 19 13:28:36 ndm: Opkg::Manager: /opt/etc/initrc: Stopping OpenBSD Secure Shell server: sshd.
    [I] Jul 19 13:28:36 ndm: Opkg::Manager: /opt/etc/initrc: Done.
    [I] Jul 19 13:28:36 ndm: Opkg::Manager: disk unmounted.

    Also, you'll find /chroot-services.list file, where you can put new services which should be started on boot, please use one name per string, service names can be taken from  /etc/init.d.

    Good luck!

    deb.png

×
×
  • Create New...