Hot answers tagged

54

There no single command or argument, but you can easily do it. To upgrade all of the packages, LEDE recommends, opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade There are other less efficient ways where people use AWK and such. An important caveat often follows with extensive use of LEDE / OpenWRT's opkg Since LEDE firmware stores the base ...


32

iwconfig (and its wireless extension API) is deprecated (it's in "maintenance only mode" and "no new features will be added"). Use iw instead. This requires a moderately recent kernel (e.g. >= 3.0) with support for nl80211. using iw dev wlan0 scan, you can figure out the protocol used: If there are Supported rates below 11mbps (except 6), there might be ...


28

I think that what you're looking for is -T as documented in man dmesg: -T, --ctime Print human readable timestamps. The timestamp could be inaccurate! The time source used for the logs is not updated after system SUSPEND/RESUME. So, for example: [ 518.511925] usb 2-1.1: new low-speed USB device number 7 using ehci-pci [ 518.615735] usb ...


15

The version of tar on OpenWRT is a smaller one than the one on full-blown systems, designed to fit small devices (it's BusyBox.) To keep small, it lacks features such as the automatic detection of compressed archives. Try declaring the compression format manually with the -z option: tar -xvzf ejdk-8u65-linux-arm-sflt.tar.gz Support for gzip in the tar ...


15

For a NAT to work properly both the packets from client to server and the packets from server to client must pass through the NAT. Note that the NAT table in iptables is only used for the first packet of a connection. Later packets related to the connection are processed using the internal mapping tables established when the first packet was translated. ...


8

No tool other than iw can give you more information. iw already gives all information that the network driver gives. If some information is missing, update your network driver (that mean your kernel) and/or iw. An example of an up-to-date iw output: BSS 42:42:42:42:42:42 (on w0) TSF: 4922636642679 usec (56d, 23:23:56) freq: 2437 beacon interval:...


8

This answer applies to OpenSSH. OpenWRT includes Dropbear by default, so you would need to need to replace it, as per this link (basically, install openssh-server and disable dropbear). With OpenSSH, what you'd like is possible using two possible mechanisms: Separate sshd configurations for your LAN and WAN interfaces. This will only work well if you have ...


8

On OpenWRT, date is busybox, which has limitations, but this is not strictly one of them. The underlying problem is that the libc (uClibc) does not support this GNU strftime extension. (Though neither does glibc, more on that below.) You should have lua by default, but that won't help without some other non-default modules. hwclock calls gettimeofday() for ...


7

Check out the OPKG Package Manager documentation section on the install argument (under the heading "Package manipulation") opkg can install package files from both remote and local locations, as in: opkg install http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/hiawatha_7.7-2_ar71xx.ipk opkg install /tmp/hiawatha_7.7-2_ar71xx.ipk The latter is ...


7

The initramfs OpenWRT/LEDE kernel builds are including the rootfs image into initramfs, attaching it to the kernel so it will put the filesystem in a ramdisk during bootup and utilize it as /. You don't need such builds if the regular flash-based storage works for you, as it won't allow any persistent configuration by default. Such a configuration is useful ...


6

1) These rules afaik completely USELESS, I'm sure about this, so there is no real question regarding this, at least a "fixme". No, these rules are useful. I'll tell you why if you tell me why you think they're useless. Ok, I'm kidding, I'll tell you whether you want it or not. The purpose of these rules are to keep the design simple. Simplicity is not ...


6

[TL,DR: use the urlencode_grouped_case version in the last code block.] Awk can do most of the job, except that it annoyingly lacks a way to convert from a character to its number. If od is present on your device, you can use it to convert all characters (more precisely, bytes) into the corresponding number (written in decimal, so that awk can read it), ...


5

/etc/init.d/network reload source: http://wiki.openwrt.org/doc/techref/netifd


5

With SSH unavailable (and possibly no UNIX/Linux machine the FTP server runs on, you could use netcat otherwise, too), the following might work: Using curl, you can upload from STDIN to a file via FTP this way: tcpdump -w - | curl -u FTPUSER:FTPPASS ftp://ftpserver/where/ever/dump.pcap -T - where tcpdump outputs raw packets (compare this question) and ...


5

No. For so many reasons. One obvious one: 802.11 = 2.4, 3.6, or 5 GHz while: X band = 8–12 GHz Ku band = 12–18 GHz K band = 18–27 GHz Ka band = 26.5–40 GHz Layman's explanation of the above: The router cannot “tune” to the needed frequencies. (Then there's the DSSS vs burst detection, etc, etc, etc...)


5

The configs are generally stored in the directory arch/$(ARCH)/configs so that the default x86 config is arch/x86/configs/i386_defconfig and the default x86_64 config is arch/x86/configs/x86_64_defconfig where all paths are relative to the linux src root. To find any default config for any arch, you can example the top level Makefile and find include ...


5

If you have a C compiler on it and can't find anything else, this will report, e.g. > millitime && sleep 1 && millitime 14/11/2014 9:39:49:364 14/11/2014 9:39:50:368 #include <errno.h> #include <stdio.h> #include <string.h> #include <sys/time.h> #include <time.h> int main (void) { struct timeval now; ...


5

Use sed '/#start/,/#end/replace_command' For example, if the file is called myconfig, and you want to replace "allow" with "deny" in that section, you could say sed '/#start/,/#end/s/allow/deny/' myconfig That would leave the file untouched, and display on the standard output what the file would look like after the modification.  You should probably do ...


5

The target "-j MARK --set-mark 2" will set the mark 2 on the packet, whatever the previous value was. If you want to avoid your mark to be erased, you can simply end the packet path in the chain with -j ACCEPT. For example : iptables -t mangle -A POSTROUTING -p tcp --dport 80 -j MARK --set-mark 10 iptables -t mangle -A POSTROUTING -p tcp --dport 80 -j ...


5

I have created a little script called opkg-upgrade to deal with upgrading in a better way. It is available on github: https://github.com/tavinus/opkg-upgrade It will make upgrading as easy as: opkg-upgrade Curl / Wget installation instructions here! As mentioned on the readme.md file, there may be problems with upgrading though. Possible ...


5

No. Discovering neighbours requires traffic. IPv6 introduced something like a broadcast ping, which can discover the IPv6 addresses of neighbours.[*] This may be useful, if your hosts allow it. I found reports of Windows not responding to multicast ping, including on Windows 7 and 8.1. Even if it did, Windows Firewall blocks ping unless you have set the ...


4

With iptables firewall this works (Openwrt also uses iptables): iptables -t nat -A PREROUTING -s 192.168.1.0/24 -p udp --dport 53 -j DNAT --to 192.168.1.1 iptables -t nat -A PREROUTING -s 192.168.1.0/24 -p tcp --dport 53 -j DNAT --to 192.168.1.1 On your router use Opendns servers. 192.168.1.1 is the Openwrt router ip. 192.168.1.0/24 is the LAN network ...


4

The filesystem is mounted read only, you need to change how it is mounted. But most embedded system don't work that way, and in those cases you need to modify the image you flashed the device with so it is correct from the start.


4

If you need to guard against malicious damage, then MD5 is the fastest hash which is secure enough (although it does have known weaknesses and so SHA2 is strongly preferred). If you just want to guard against accidental damage, then a CRC checksum will be faster and good enough. The standard cksum utility can be used to calculate this.


4

your version of dmesg is obviously not the full-fledged one from util-linux but instead is provided by busybox. busybox provides the basics of a multitude of utilities, but it doesn't provide all their nifty features. if you want to use the -T flag as (rightly) suggested by terdon, you will need to use the dmesg binary provided by util-linux me@server:/...


4

OpenWrt stores config in the directory target/linux/<target system>/<subtarget>/profiles You can set target system and subtarget with command make menuconfig: In my case: target system = ar71xx subtarget = generic So the directory would be: target/linux/ar71xx/generic/profiles In this directory, you will find some predefine profiles, ...


4

You have to indicate what to kill: kill -9 $(ps | grep "server1" | grep -v grep | awk '{ print $1 }') You can also use the trick: kill -9 $(ps | grep "server[1]" | awk '{ print $1 }')


4

In the purest form, you can use pkill server1 That assumes server1 is actually the process name, not just somewhere in the command line - otherwise add an -f. pkill -f server1CommandArgument But wait! You can test what pkill will match and kill with the command pgrep - which is technically almost the same. The difference it: instead of killing, it ...


4

Based on yeti's solution, there is another possibility, that might be faster. Instead of computing the size with du for the files in the list file, we can use the declared size in the control file. Something like my little opkg_sizes script cd /usr/lib/opkg/info for i in *.control do echo `grep Size "$i" | cut -f 2 -d :` "${i%.control}" done If you want ...


Only top voted, non community-wiki answers of a minimum length are eligible