LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to create a route to a usb0 interface? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-create-a-route-to-a-usb0-interface-389038/)

cmisip 12-04-2005 12:46 AM

How to create a route to a usb0 interface?
 
I have a zaurus 5600 connected to one of the machines on my LAN. I can access it with that machine but cannot access it from the other machines in my network.

My network is 192.168.0.0/24.
My zaurus's IP is 192.168.129.201.
It is connected to the machine with IP of 192.168.0.2 hostname mymythtv.
I have a gateway to the internet at 192.168.0.1 hostname mylivingroom.

mymythtv can ping and connect to the zaurus,but no other machine in the network can. The zaurus can access all the other machines and the internet.

I thought it was a simple matter of adding a route on each of the other machines to point to mymythtv:

route add -host 192.168.129.201 gw 192.168.0.2 <interface>

but this does not work.

route add -net 192.168.129.0 netmask 255.255.255.0 gw 192.168.0.2 <interface>

does not work as well.

Any help is appreciated.

ilikejam 12-04-2005 02:46 AM

Hi.

You'll have to enable IP forwarding:
Code:

echo "1" > /proc/sys/net/ipv4/ip_forward
Dave

cmisip 12-04-2005 04:06 PM

Yes, I have that enabled already. But still no go.

I am tempted to connect the zaurus cradle to 192.168.0.1 which is the default gw for the lan. Hopefully it will know where to send the packets for the zaurus. However, it should be possible with 192.168.0.2 as well.

Here is my route info from mymythtv (192.168.0.2)

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
mykitchen mykitchen 255.255.255.255 UGH 0 0 0 ipsec0
mylivingroom mylivingroom 255.255.255.255 UGH 0 0 0 ipsec0
192.168.129.0 * 255.255.255.0 U 0 0 0 usb0
192.168.0.0 * 255.255.255.0 U 0 0 0 ath0
192.168.0.0 * 255.255.255.0 U 0 0 0 ipsec0
169.254.0.0 * 255.255.0.0 U 0 0 0 usb0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default mylivingroom 128.0.0.0 UG 0 0 0 ipsec0
128.0.0.0 mylivingroom 128.0.0.0 UG 0 0 0 ipsec0
default mylivingroom 0.0.0.0 UG 0 0 0 ath0


Thanks

ilikejam 12-04-2005 09:24 PM

What do the routing tables look like on the other machines?

Dave

cmisip 12-06-2005 09:37 AM

Here is the route info from mylivingroom which is the lan gateway to the internet, ipmasq and vpn server.

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
mykitchen mykitchen 255.255.255.255 UGH 0 0 0 ipsec0
mymythtv mymythtv 255.255.255.255 UGH 0 0 0 ipsec0
mylaptop mylaptop 255.255.255.255 UGH 0 0 0 ipsec0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 ipsec0
12.218.208.0 * 255.255.248.0 U 0 0 0 eth0
12.218.208.0 * 255.255.248.0 U 0 0 0 ipsec1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 12-218-208-1.cl 0.0.0.0 UG 0 0 0 eth0


like I said in the earlier post, adding a route to the 192.168.129.0 network via gateway 192.168.0.2 and interface ipsec0 gets accepted as a valid route command but still I cannot access the zaurus connected to 192.168.0.2 from 192.168.0.1 (mylivingroom).

Other info: All my lan machines communicate wirelessly and have vpn via freeswan. They will only accept vpn connections from the wireless network (through shorewall) but will accept any connections from wired ethernet and usb interfaces.

Chris

ilikejam 12-06-2005 10:32 AM

Hi again.

How are the machines on the LAN connected together? If it's through a switch (e.g.an ADSL router with multiple ports), then you'll have to set up a static route on the switch which points packets for the 192.168.129 network to 192.168.0.2, otherwise packets for the 192.168.129 network will be dropped at the switch.

Dave

cmisip 12-06-2005 10:53 AM

I have mylivingroom with two ethernet interfaces : eth0 connects to the cable modem, eth1 connects to a netgearwireless router via ethernet cable.

mymythtv connects wirelessly to the netgear router. It has a connecetion to the zaurus via usb.

I thought I added a static route already but I did not reboot the router. I will try that.

cmisip 12-06-2005 11:01 AM

Static Routes on the Netgear Wireless router

# Active Name Destination Gateway
1 Yes zaurus 192.168.129.201 192.168.0.2

I rebooted it but still no go.

Everything seems to be still working.

zaurus can ping mylivingroom and mymythtv and access the internet ( so ipv4 forwarding is working)
mymythtv can ping zaurus and mylivingroom
mylivingroom can ping mymythtv -- but not the zaurus

Chris

cmisip 12-06-2005 11:08 AM

Here is the routing table in mylivingroom with the route to 192.168.129.0 via gw mymythtv:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
mykitchen mykitchen 255.255.255.255 UGH 0 0 0 ipsec0
mymythtv mymythtv 255.255.255.255 UGH 0 0 0 ipsec0
mylaptop mylaptop 255.255.255.255 UGH 0 0 0 ipsec0
192.168.129.0 mymythtv 255.255.255.0 UG 0 0 0 ipsec0
192.168.129.0 mymythtv 255.255.255.0 UG 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 ipsec0
12.218.208.0 * 255.255.248.0 U 0 0 0 eth0
12.218.208.0 * 255.255.248.0 U 0 0 0 ipsec1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 12-218-209-111. 0.0.0.0 UG 0 0 0 eth0

I dont understand it. Packets to 192.168.129.0 network should find their way to that network via mymythtv according to the routing table. I have routes up via eth0 and ipsec0.

Is there a way to figure out in mylivingroom if these packets are getting out? If they are, maybe the problem is in mymythtv not routing them to the usb network.

Chris

ilikejam 12-06-2005 02:55 PM

Hi.

What is the IP address of the usb0 interface on mymythtv?

Try running 'traceroute 192.168.129.201' on mylivingroom. That should let you see how far packets are getting.

Dave

cmisip 12-06-2005 08:37 PM

Trace route doesn't seem to be able to find 192.168.129.201.

I think I have an idea what is happening here. My guess is that there is nothing wrong with the routing table but freeswan is preventing me from going past mymythtv into the usb subnet. All ipsec connections to mymythtv are terminated as host only at the mymythtv end. I think I need to establish an ipsec connection from the other machines to mymythtv that is a host to subnet type. I will test this tomorrow and post results.

cmisip 12-07-2005 01:41 PM

I was right :) Adding this host to subnet connection in ipsec.conf

in mymythtv:

conn mylaptop-to-mymythtvnet
left=192.168.0.2 # Local vitals
leftid="/C=US/ST=IN/O=MYPCNET/CN=MYMYTHTV"
leftsubnet=192.168.129.0/24
leftcert=mymythtvcert.pem
right=192.168.0.100 # Remote vitals
rightid="/C=US/ST=IN/O=MYPCNET/CN=MYLAPTOP"
rightcert=mylaptopcert.pem
auto=add
pfs=yes


in mylaptop:

conn mylaptop-to-mymythtvnet
left=192.168.0.100 # Local vitals
leftid="/C=US/ST=IN/O=MYPCNET/CN=MYLAPTOP"
leftcert=mylaptopcert.pem
right=192.168.0.2 # Remote vitals
rightid="/C=US/ST=IN/O=MYPCNET/CN=MYMYTHTV"
rightsubnet=192.168.129.0/24
rightcert=mymythtvcert.pem
auto=start
pfs=yes

allowed mylaptop to ping the zaurus connected to mymythtv.

It was a vpn issue after all. The reason why the zaurus could access the internet was because I had a host to subnet connection between mymythtv (host) and mylivingroom(subnet) in which the subnet was specified as 0.0.0.0/0. Indeed, connecting the zaurus cradle to mylivingroom would not have necessitated creation of additional connections since 192.168.129.0/24 would fall within the more general 0.0.0.0/0. To do the opposite, connect to the zaurus from elsewhere means that the subnets attached to mymythtv ( usb0 and company) need to be made accessible via a host(otherpc) to subnet(mymythtv) vpn tunnel.

I can see clearly now.

Thanks for your time and effort in assisting me to troubleshoot this.

Chris

ilikejam 12-07-2005 01:50 PM

Cool. That makes sense. I've bookmarked this in case I have to deal with this sort of thing myself.

I'm glad it's working for you.

Cheers.

Dave

izquierdista 03-01-2007 11:07 PM

I am extremely frustrated. and I am happy to see that someone got a Zaurus SL5600 connected to their linux computer.

I have SUSE linux 9.3 installed on my computer and have tried all sorts of things to get my SL5600 to connect to my laptop so that I can sync.

Unfortunately as much as I try I cant get it to work.

can you please tell me step by step how you did this?? I have the zaurus SL5600 cradle and have tried following the instructions in this website:

http://easynews.dl.sourceforge.net/s...conf-1.0.1.pdf

but think I am doing something wrong.

becuase I see:

Code:

linux:/home/chacmool # tail -f /var/log/messages
Mar  1 21:49:08 linux SuSEfirewall2: Firewall rules set to CLOSE.
Mar  1 21:49:08 linux SuSEfirewall2: Warning: ip6tables does not support state matching. Extended IPv6 support disabled.
Mar  1 21:49:08 linux SuSEfirewall2: Setting up rules from /etc/sysconfig/SuSEfirewall2 ...
Mar  1 21:49:08 linux SuSEfirewall2: Firewall rules successfully set
Mar  1 21:49:37 linux kernel: ohci_hcd 0000:00:02.2: wakeup
Mar  1 21:49:37 linux kernel: usb 1-1: new full speed USB device using ohci_hcd and address 3
Mar  1 21:49:38 linux kernel: usb 1-1: USB disconnect, address 3
Mar  1 21:49:38 linux kernel: usb 1-1: new full speed USB device using ohci_hcd and address 4
Mar  1 22:07:15 linux su: (to root) chacmool on /dev/pts/9
Mar  1 22:08:06 linux su: (to root) chacmool on /dev/pts/9

instead of what I am suppossed to see:

Code:

Jan 24 09:42:57 waddler kernel: usb 2-1: new full speed USB device using address 2
Jan 24 09:42:57 waddler kernel: usb 2-1: Product: SL-5600
Jan 24 09:42:57 waddler kernel: usb 2-1: Manufacturer: Sharp
Jan 24 09:43:04 waddler kernel: usb0: register usbnet at usb-0000:00:11.3-1, Sharp Zaurus, PXA-2xx based
Jan 24 09:43:04 waddler kernel: usbcore: registered new driver usbnet
Jan 24 09:43:25 waddler kernel: usb0: no IPv6 routers present



All times are GMT -5. The time now is 03:56 PM.