Dear All,
I've not got very far trying to install OpenWRT, because I can't get tftp to work. Here's what I've done; if anyone can spot my mistake I'd be very grateful.
I'm using a PC running Debian. It is connected to the WRT54g's #1 LAN port, and I can ping it:
$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=160.3 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.2 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.2 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=1.3 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=1.2 ms
I then remove the power, and try tftp. I've tried both the Debian tftp package, which I think is netkit, and the atftp package, following the instructions from the Wiki installation instructions. They both fail in exactly the same way:
$ atftp --trace --option "timeout 1" --option "mode octet" --put --local-file openwrt-wrt54g-squashfs.bin 192.168.1.1
Trace mode on.
Option timeout = 1
Option mode = octet
sent WRQ <file: openwrt-wrt54g-squashfs.bin, mode: octet <timeout: 1>>
tftp: aborting
It fails immediately. strace reveals this:
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
bind(3, {sa_family=AF_UNSPEC, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 16) = 0
getsockname(3, {sa_family=AF_INET, sin_port=htons(1781), sin_addr=inet_addr("0.0.0.0")}, [16]) = 0
connect(3, {sa_family=AF_UNSPEC, sa_data="\347\267T7\5\10hQ\5\10\0\0\0\0"}, 16) = 0
open("/tmp/openwrt-wrt54g-squashfs.bin", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1573888, ...}) = 0
write(2, "sent WRQ <file: /tmp/openwrt-wrt"..., 76sent WRQ <file: /tmp/openwrt-wrt54g-squashfs.bin, mode: octet <timeout: 1>>
) = 76
sendto(3, "\0\2/tmp/openwrt-wrt54g-squashfs.b"..., 51, 0, {sa_family=AF_INET, sin_port=htons(69), sin_addr=inet_addr("192.168.1.1")}, 16) = -1 EPERM (Operation not permitted)
I get the same when I run atftp as root. man sendto does not mention EPERM as a possible error return value.
I wondered if this was a firewall-like problem, but iptables -L shows that no filters are loaded.
I suspect that I've got something basic wrong, but can't work out what it is. Does anyone have any suggestions for further debugging? Has anyone else suceeded in using tftp from a Debain machine recently?
Cheers,
--Phil.
