|
|
#1 | |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,134
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
Kindle Networking
http://www.mobileread.com/forums/sho...d.php?t=204450 Conditions: You have already installed the USBnetwork, kindle-usbnet-0.7.N.zip package, as described in the prior thread. The prior thread left you using the telnet to access your Kindle. You made note of the sequence required to start/stop USBnetwork, which is repeated here: Quote:
There are a number of network automation things used by the various Linux distributions, refer to your distribution information on how to set up yours (not here, your distro's help forum). We knew from the prior thread that the networking over the USB cable was working. We knew from the prior thread that telnet over USB was working. Now telnet into the Kindle (telnet 192.168.15.244). The prior thread used the ip utility to display network related information from the Linux host (your PC). The Kindle also has a (limited) version of ip installed as part of the Busybox build. Examine the routing setup on the Kindle: Code:
[root@kindle root]# ip route 192.168.15.0/24 dev usb0 src 192.168.15.244 Code:
[root@kindle root]# ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
6: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether ee:19:00:00:00:00 brd ff:ff:ff:ff:ff:ff
inet 192.168.15.244/24 brd 192.168.15.255 scope global usb0
Code:
[root@kindle root]# iptables -L -v
Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- ppp0 any anywhere anywhere tcp dpt:40317
0 0 ACCEPT tcp -- ppp0 any anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT tcp -- wlan0 any anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT udp -- wlan0 any anywhere anywhere state ESTABLISHED
0 0 ACCEPT udp -- ppp0 any anywhere anywhere state ESTABLISHED
0 0 ACCEPT udp -- ppp0 any anywhere anywhere udp spt:40317
0 0 ACCEPT udp -- ppp0 any anywhere anywhere udp spt:49317
0 0 ACCEPT udp -- ppp0 any anywhere anywhere udp spt:33434
1973 2260K ACCEPT all -- lo any localhost.localdomain anywhere
5224 303K ACCEPT all -- usb0 any anywhere anywhere
0 0 ACCEPT icmp -- any any anywhere anywhere state RELATED,ESTABLISHED
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 3826 packets, 246K bytes)
pkts bytes target prot opt in out source destination
1973 2260K ACCEPT all -- any lo anywhere localhost.localdomain
target : what to do with the matching packet prot : Protocol opt : Options {in,out} : Interface {source, destination} : IP address(es) dpt : Destination port spt : Source port Interfaces shown: ppp0 : 3G (this device does not have 3G - forget about those for this machine) wlan0 : WiFi (got that, but at the moment, its down (airplane mode enabled) ) lo : localhost (IP: 127.0.0.0/8 - every networked machine has one) usb0 : Guess what. ![]() Protocol: icmp - that is, among other things, 'ping packets' All of the firewall rules shown above are in the kernel's dynamic memory. You can add/delete/change them (in memory) with the iptables utility. These rules will be restored from a configuration file in the /etc/sysconfig directory at the next system boot. For the curious, here is what is in the Kpw-5.3.3 /etc/sysconfig directory: Spoiler:
Since you have decided to become your own network admin person by installing this networking package, you need at least a minimum knowledge of the firewalling in Linux. A quick review of the network interface states at the moment: Code:
[root@kindle root]# ip -o link | cut -f 2,9 -d ' ' lo: UNKNOWN usb0: UP First, for this purpose, clean up the listing of the three main chains above (there are other tables, google iptables). Knowing that this machine does not have 3G and that the single output rule is bogus (why? think a bit, lab126 didn't). Code:
** Hand edited for this post **
Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- wlan0 any anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT udp -- wlan0 any anywhere anywhere state ESTABLISHED
1973 2260K ACCEPT all -- lo any localhost.localdomain anywhere
5224 303K ACCEPT all -- usb0 any anywhere anywhere
0 0 ACCEPT icmp -- any any anywhere anywhere state RELATED,ESTABLISHED
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 3826 packets, 246K bytes)
pkts bytes target prot opt in out source destination
Anything FORWARD(ed) or OUTPUT is subject to the default policy of those chains. The states mentioned in the INPUT chain rules: RELATED - a packet inbound that is related to a packet which was output, this is for protocols that use more than one port (such as ftp). ESTABLISHED - A packet inbound that is a reply to a packet that originated on this machine. There is no "RELATED" shown for the udp protocol because such a thing does not exist in the udp protocol. Now you should be able to read your first rule (NOT THE first rule, A first rule). INPUT - default policy: "DROP" - so unless allowed by a rule, this packet is going to the bit bucket. Find the interface usb0 What are the restrictions? (ans: none) What is the target of the packet? (ans: let it in) What about packets forwarded or output to usb0? (ans: only the default policy of the chains apply (no rules) - so let it pass the chain) Now read your second rule (NOT THE second rule, A second rule). Find the interface wlan0 What are the restrictions? (ans: INPUT chain only, only in response to something previously sent by the machine) What is the target of the packet if it meets the restrictions? (ans: let it in) What is the target of the packet if it fails to meet the restrictions? (ans: drop it on the floor) What about packets forwarded or output to wlan0? (ans: only the default policy of the chains apply (no rules) - so let it pass the chain) Got all of that above? Now you are a junior net-admin! That's all you need to get started. Now for your first network administration assignment: What do you need to do to allow ssh over WiFi to your Kindle? THINK! You can answer that assignment question now. Ans: The ssh protocol is identified by the "commonly used port", port number 22. You have to add a rule to the INPUT chain, for the interface wlan0 and the destination port 22. This is your lucky day - the USBnetwork package has that placed under the control of a "flag filename" for you. Just read the README_FIRST.txt file in the package for the directions on using that "flag filename". Question: how to allow some other protocol than ssh over WiFi? Same answer, different port number. Question: how to allow some other protocol than those allowed already over 3G? Same answer, different interface name and port number(s). To have ssh communications with your Kindle, in addition to the networking, you need something to talk to. In the USBnetwork package, that is an application called 'dropbear'. So find out if it is running: Code:
[root@kindle root]# ps -C dropbear PID TTY TIME CMD 20446 ? 00:00:00 dropbear PS: I do not want to ever again read a thread titled: "Connection Refused". Never! Ever! For our next thread in this series, configuring ssh and some of the neat things you can do with it.
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan |
|
|
|
|
|
|
#2 |
|
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,143
Karma: 5328985
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI|K4|K3-3G|DXG|Ematic E6+E8|Rooted Nook Touch|NO K2!!
|
Two buttons...
BLOCK... UNBLOCK... Then the world would be golden.. Oh and a "magically configure" button would be nice for the tricky stuff
__________________
Audiophile and electron bully. My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him. The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,134
Karma: 3854695
Join Date: Feb 2012
Device: Intel 4004
|
It is in the works.
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan |
|
|
|
|
|
#4 |
|
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,143
Karma: 5328985
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI|K4|K3-3G|DXG|Ematic E6+E8|Rooted Nook Touch|NO K2!!
|
__________________
Audiophile and electron bully. My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him. The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Kindle Touch USB Networking/SSH | ChrisKaos | Kindle Developer's Corner | 55 | 02-22-2013 09:53 AM |
| Kindle PW supports 802.1X corporate networking | lyric | Amazon Kindle | 2 | 12-20-2012 08:08 AM |
| Hacks Kindle 3 USB Networking | n10 | Amazon Kindle | 2 | 10-11-2010 09:29 PM |
| K4 Mac or PC How can I browse the internet in Kindle DX through my PC networking ? | meem | Amazon Kindle | 0 | 08-04-2010 04:23 AM |
| Hacks USB networking disabled on Kindle firmware 2.0.3 | hmemcpy | Amazon Kindle | 19 | 05-01-2009 10:51 AM |