Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-28-2013, 12:56 PM   #16
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by fry@pocketbook View Post
For example:
Code:
fry@notebook~: ssh root@kindle-ip
Do nothing with the small PC with Ubuntu it should only be a "Connector".
The term is "Router" not "Connector"
knc1 is offline   Reply With Quote
Old 05-28-2013, 01:36 PM   #17
hawhill
Wizard
hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.
 
hawhill's Avatar
 
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
Well, what should work already is connecting from the computer the Kindle is attached to (via SSH or telnet). At least the IP/route combination cited above indicates so.

If other computers on the (W)LAN should be able to connect to the Kindle like this:

[LAN/WLAN station (1)] ----> [USB Host PC for Kindle (2)] --USB--> [Kindle (3)]

Then the station (1) must be aware that it can reach the Kindle via station (2). More than one way to make that work:
a) A corresponding route on station(1)
b) Port forwarding on station (2), other stations like (1) will then connect to (2) which forwards to (3).
c) ARP proxying on station (2), will possibly need different route combination on (1) nevertheless

In addition, the station (2) must do IP forwarding and masquerading (NAT).


The way
[Kindle (1)] --USB--> [USB Host PC for Kindle (2)] ----> [LAN/Wifi router] -> Internet

also needs IP forwarding and masquerading on (2), and a properly set route on (1). That's what most discussion at the start of the thread was about.

However, while this way looks like it is fit for using the Browser on the Kindle, that wouldn't work. That's because of the 3G / "online test" behaviour I tried to explain in my contributions above.
hawhill is offline   Reply With Quote
Advert
Old 05-28-2013, 03:06 PM   #18
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Two (or more) physical networks

In the case where you have two (or more) physical networks that you want to work as if a single physical network:
Code:
echo 1 > /proc/sys/net/ipv4/conf/all/proxy_arp
echo 1 > /proc/sys/net/ipv4/ip_forward
(What h.h. mentioned.)

If "all" is not suitable for your physical configuration -
explore the file tree below /proc/sys/net/ipv4/**
You have fairly fine-grained controls in that tree.

A worked example (Here wan0 is the NIC on the physical cabling to the wireless networking equipment, lan0 is the NIC on the physical cabling to the wired equipment, mod0 is the cabling to the modem):

Using 'ip' - which your Kindle probably does not have unless you installed the build of 'ip' that twobob posted - -
(Your address ranges will be different, but principles are the same. These NICs are renamed from the kernel default names in udev rules.)

Code:
# Local lan - 1Gbs cabling
/bin/ip address flush dev lan0
/bin/ip -f inet  address add 169.254.0.4/22 brd + dev lan0
#
# plus the HP printer link - (this could be the Kindle or any single-address device)
/bin/ip -f inet  address add 169.254.0.4 peer 169.254.57.36 dev lan0
/bin/ip link set up dev lan0

# Local wireless - cabling to access points
/bin/ip address flush dev wan0
# Dynamically assigned ip range for wireless connects
/bin/ip -f inet  address add 169.254.0.225/27 dev wan0
# Scattering of point-to-point control panel links
# wrt160
/bin/ip -f inet  address add 169.254.0.225 peer 169.254.0.40 dev wan0
# dwl900
/bin/ip -f inet  address add 169.254.0.225 peer 169.254.0.50 dev wan0
# befw11s5
/bin/ip -f inet  address add 169.254.0.225 peer 169.254.0.70 dev wan0
/bin/ip link set up dev wan0

# World - is on another NIC, to an adsl modem, config'd as a media bridge only
/bin/ip address flush dev mod0
# put up the aDSL control panel
/bin/ip -f inet  address add 169.254.2.2 peer 169.254.2.1 dev mod0
# crank up the firewall on World
/etc/network/dhcp.bash
#
/bin/ip link set up dev mod0

# ask Tel-Co for an IPv4 address (dhcp client)
/sbin/dhclient -4 -v -pf /var/run/dhclient.mod0.pid -lf /var/lib/dhcp/dhclient.mod0.leases mod0
# that should move to the background once it is done

# None of the equipment running in the "Wifi range" is allowed to contact Amazon here:
# Put a full block on Chatty Kathy's attempts to call home (note: will not work on a Kindle, kernel isn't configured for this):
/bin/ip rule add from 169.254.0.225/27 to 207.171.160.0/19 prohibit
/bin/ip rule add from 169.254.0.225/27 to 107.20.0.0/14 prohibit
/bin/ip rule add from 169.254.0.225/27 to 184.72.0.0/15 prohibit
/bin/ip rule add from 169.254.0.225/27 to 204.246.160.0/19 prohibit
/bin/ip rule add from 169.254.0.225/27 to 205.251.192.0/18 prohibit
/bin/ip rule add from 169.254.0.225/27 to 72.21.192.0/19 prohibit
/bin/ip rule add from 169.254.0.225/27 to 50.16.0.0/14 prohibit
/bin/ip rule add from 169.254.0.225/27 to 23.0.0.0/12 prohibit

# my gateway machine runs some local network services/servers:
# Start local services after network setup

SERVICES="bind9 ssh ntp"

for i in $SERVICES; do
 [ -x /etc/init.d/"$i" ] && /etc/init.d/"$i" start >/dev/null 2>&1

# Ok - its soup.
# Does all of that work ?
# root@Microknoppix:/etc# uptime
# 19:04:56 up 431 days,  3:37,  3 users,  load average: 0.00, 0.01, 0.05

# ah, yeah, it works.
knc1 is offline   Reply With Quote
Old 05-28-2013, 07:51 PM   #19
fry@pocketbook
Member
fry@pocketbook began at the beginning.
 
Posts: 21
Karma: 10
Join Date: May 2011
Device: Kindle DXi
YES, IT WORKS!

I was thinking to complicate...this steps I have to do:
@Kindle
Code:
mntroot rw
route add -net 192.168.1.0/24 gw 192.168.2.1
@Ubuntu
Code:
nano /etc/network/interfaces
 
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 192.168.1.201
    netmask 255.255.255.0
    gateway 192.168.1.1

auto usb0
iface usb0 inet static
    address 192.168.2.1
    netmask 255.255.255.0
    up echo 1 > /proc/sys/net/ipv4/ip_forward
    up iptables -P FORWARD ACCEPT
    up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.2.0/24 
    down echo 0 > /proc/sys/net/ipv4/ip_forward
    down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.2.0/24
sudo /etc/init.d/networking restart
@my WLAN-Router(ddwrt)
Under the Point Advanced Routing:
Code:
Destination: 192.168.2.0
Subnet: 255.255.255.0
Gateway: 192.168.1.201
Now, Kindle browser problem
fry@pocketbook is offline   Reply With Quote
Old 05-28-2013, 10:31 PM   #20
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
You could simplify that by opening up your netmask to span 192.168.0 .. 192.168.2 ...

I.E: a network mask of 255.255.252.0 will give you a /22 network
(192.168.0.0 .. 192.168.3.255)
A /23 network would not encompass any of the 192.168.2.x sub-net.

Now that gives you a /22 bit network instead of the /24 bit network, which encompasses all of the address you are using in the posts.

No nat or masquerade required on the local network, only at the point which you exit the local network to the world.

Since you have more than one physical network - -
Then enable the arp proxy service as shown at the top of my post.

Three more hints if you want "simple" -

* Your ubuntu install has the ip set of utilities - stop using the many decades old ones you are using.

* Stop trying do the setup in the /etc/network/interfaces file (used for ifup and ifdown) - just script it in bash.

* Since Network manager tries to "manage" the same file, put an end to that also by adding:
Code:
[ifupdown]
managed=false
To the /etc/NetworkManager/NetworkManager.conf file.

Next question -
Where is the physical connection to the world being made?
On the machine running ddwrt ?
If so, use that machines IP address as the "Gateway" address on everything else.
No special entries under ddwrt - with the /22 network, everything will "just work".

If you really want "simple" - - then stop trying to (mis-)use all of the complicated stuff.
knc1 is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help setting up usb networking bennyb Kindle Developer's Corner 10 02-22-2013 12:27 PM
Setup USB Networking K3 nathansuchy Kindle Developer's Corner 3 11-14-2012 03:37 PM
USB Networking on Mac OS? DairyKnight Kindle Developer's Corner 19 07-02-2012 04:19 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
Firmware Update USB networking for 2.5? dd_engi Amazon Kindle 9 05-09-2010 06:45 AM


All times are GMT -4. The time now is 11:21 AM.


MobileRead.com is a privately owned, operated and funded community.