Author Topic: connecting 5600 to internet via usb  (Read 2793 times)

msjones

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • http://
connecting 5600 to internet via usb
« on: March 29, 2004, 03:53:22 pm »
I am pretty new to linux (moving from windows). I was able to set up an ssh connection and a samba connection between my 5600 and linux desktop, but trying to connect to the internet via usb is giving me fits. I have the original sharp rom on my zaurus and Fedora core 1 on my desktop. Many of the how to\'s I come accross seem out of date (older zaurus or older os), sites are down, or are too advanced for me to understand. Having a hard time with masquerading, nat and iptables lingo. I think I can connect with hotplug but not sure how. Can someone give me some tips or point me to a current howto? Thanks.

msjones

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • http://
connecting 5600 to internet via usb
« Reply #1 on: March 30, 2004, 01:09:23 am »
I\'ve worked on it a little more. Here is what I\'ve done in case someone would be kind enough to help me out.

On desktop Created /etc/rc.d/rc.ipmasq:
#!/bin/sh
IPTABLES=/sbin/iptables
#All The lines below are NAT routing
# flush any old rules
$IPTABLES -F -t nat
# turn on NAT (IP masquerading for outgoing packets)
$IPTABLES -A POSTROUTING -t nat -o eth0 -j MASQUERADE
# enable IP forwarding (of incoming packets)
echo 1 ] /proc/sys/net/ipv4/ip_forward


edited /etc/resolv.conf:
nameserver 192.168.129.200

On the Z:
# route add -host 192.168.129.200 usbd0
# route add default gw 192.168.129.200

On desktop in etc/hotplug/usbnet:
#!/bin/bash
typeset -i num
num=`ifconfig | grep usb0 | wc -l`
if [ $num -eq 0 ] ; then
   ifconfig usb0 192.168.129.1 netmask 255.255.255.255 up
   route add -host 192.168.129.201 usb0
fi
iptables  -t nat -F
iptables  -t nat -A POSTROUTING -j SNAT -o eth0 --to MY_IP
echo 1 ] /proc/sys/net/ipv4/ip_forward
exit 0

My network settings on the z are:
LAN-TCP/IP
IP address 192.168.129.201
Subnet Mask 255.255.255.0
Gateway 192.168.129.200
Primary DNS 192.168.129.200

Some of these settings may be wrong, or I need to do something else as well, but I but I don\'t know what. When I open opera and point to a site, opera searches for 20 seconds and then I get \"could not locate remote server\". Any help would be appreciated.

freizugheit

  • Sr. Member
  • ****
  • Posts: 409
    • View Profile
    • http://
connecting 5600 to internet via usb
« Reply #2 on: March 30, 2004, 01:56:03 am »
I presume that you are using PPP to establish link with ISP:

Try amend the following:

/etc/rc.d/rc.ipmasq:
# turn on NAT (IP masquerading for outgoing packets)
$IPTABLES -A POSTROUTING -t nat -o ppp0 -j MASQUERADE

add the following to /etc/resolv.conf:
nameserver ISPNameServerIP

Firstly check whether your Internet connection is up
Secondly,  pinging individual IP.
Thirdly check their route tables.

Then proceed to activate Opera browser on SL-5600

evowan

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://
connecting 5600 to internet via usb
« Reply #3 on: April 05, 2004, 03:59:58 pm »
Hi everyone,

Having a similar problem. After sorting out my WinXP setup, I\'m now having trouble with my linux setup. Okay, here\'s how things are -

PC1 - WinXP, connects to internet via ADSL (so this is the gateway), has ethernet card. Has IP address 192.168.0.1
PC2 - Mandrake 9.2 Linux, connects to PC1 via ethernet card via hub. Has IP for eth0 192.168.0.2 and usbd0 has 192.168.129.1
Zaurus - Connects to PC2 via USB, has IP 192.168.129.201

So the object of my game is to browse the web on the Z. Now I\'ve had this setup working with PC2 running WinXP, so hardware wise everything should be working.

I\'ve followed the instructions at http://www.ruault.com/Zaurus/ethernet-over...-usb-howto.html though I would guess that something has to change with the routing commands for my setup. I can ping PC2\'s 192.168.129.201 and 192.168.0.2 from the Z but not PC1 192.168.0.1, or anything on the web.

I\'m not hot on all this routing stuff, so help is much appreciated!

evowan

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://
connecting 5600 to internet via usb
« Reply #4 on: April 06, 2004, 11:36:18 am »
Okay, got it working now.

I made a stupid mistake of adding the wrong gateway on the Z, putting in the address of PC1 instead of PC2\'s interface to the Z. Now to just get my Wifi card to work now...