You are not logged in.

#1 2013-07-03 01:38:34

bogwog
Member
Registered: 2013-07-02
Posts: 1

Why does this work?

Hi everyone, I'm not entirely sure if this belongs here, but it is primarily about networking so I'm going to post it anyways

**disclaimer** I am a networking noob **disclaimer**

I was trying to set up a Blackberry 10 development environment on my arch setup. It's pretty much barebones and I had everything working except for the usb part for usb debugging on a device. Somehow, after some weird hacks, I got it to work. Since I know next to nothing about networking, I wanted to know why what I did works since I don't know if this was a permanent solution or a temporary one.


..So after some googling, I discovered that the way BB (blackberry) implemented this usb debugging was by using the USB connection as an ethernet connection. The Android tethering article in the wiki says that for tethering (basically the same thing...I think) you need to have the usbnet mod enabled, so I made sure it was. And it was.

Next, I checked to see if there was an interface available when I connected my Blackberry phone in development mode by using "ifconfig -a". And it was, but it was disabled, so I enabled it with

ifconfig usb0 up

.
However, after I did that it didn't have an IP address, among other things.

So my ghetto solution was this:

1. I connected my blackberry to my macbook (where everything is setup and working) and issued the "ifconfig" command to look at all the interfaces.
2. I took note of everything
3. I tried to change as much as possible using ifconfig commands on my arch pc so that it matches what it says on my macbook
4. AND IT WORKS

All I changed where the IP address, netmask, and broadcast address. The phone says that the development IP is "169.254.0.1", but on the macbook it said the ip was "169.254.0.2" and the broadcast was "169.254.0.3", so I set it to those (with netmask "255.255.255.252") and it worked beautifully.

This is the current output of ifconfig:

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 169.254.0.2  netmask 255.255.255.252  broadcast 169.254.0.3
        inet6 fe80::94eb:cdff:fe2f:bf41  prefixlen 64  scopeid 0x20<link>
        ether 96:eb:cd:2f:bf:41  txqueuelen 1000  (Ethernet)
        RX packets 6437  bytes 729467 (712.3 KiB)
        RX errors 5434  dropped 0  overruns 0  frame 0
        TX packets 9716  bytes 1366159 (1.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Now, I haven't turned off my computer because I'm scared that the changes are temporary and this was just dumb luck.

My questions are:
1. If the changes are temporary, then what can I do to make them permanent?
2. The mac address shown on ifconfig (96:eb:cd:2f:bf:41) is not the same mac address that the phone gives me (96:eb:cd:2f:bf:44). I don't know what the hell all that is about
3. Also, the development ip address on the phone says it is "169.254.0.1" (and that is the one I use from the IDE to upload/debug my app), but the ip on ifconfig is "169.254.0.2". I don't know what any of that is about either
4. Why did this get setup automatically on my macbook but not on my arch pc? I didn't do anything special on my mac, I just connected the phone and it worked pretty much automatically. I definitely didn't have to do anything like this. Is there some kind of networking bug or something on arch, or is it like a feature on macs?


I know almost nothing practical about networking. My home network is so messed up and I don't even know how to fix it (actually, the reason I am trying to debug over USB instead of WiFi is because my home network is messed up! tongue). When I saw that error on my IDE disappear I nearly had a heart attack.First successful networking-related thing I had ever done.


Any enlightenment would be greatly appreciated! smile

Last edited by bogwog (2013-07-03 01:39:06)

Offline

#2 2013-07-03 02:16:35

fukawi2
Forum Moderator
From: .vic.au
Registered: 2007-09-28
Posts: 5,304
Website

Re: Why does this work?

I'm not familiar with BB, but my best guesses based on the information you've given....

bogwog wrote:

1. If the changes are temporary, then what can I do to make them permanent?

Yes they are temporary. You can setup a netctl profile to DHCP on this interface to make it 'permanent'. Check the wiki for how to configure netctl profiles.

bogwog wrote:

2. The mac address shown on ifconfig (96:eb:cd:2f:bf:41) is not the same mac address that the phone gives me (96:eb:cd:2f:bf:44). I don't know what the hell all that is about

Mac addresses are per interface; you're probably looking at the MAC address for the phone's WiFi or Bluetooth, which will be different to it's USB pseudo-network interface.

bogwog wrote:

3. Also, the development ip address on the phone says it is "169.254.0.1" (and that is the one I use from the IDE to upload/debug my app), but the ip on ifconfig is "169.254.0.2". I don't know what any of that is about either

IP Addresses are unique for each host; so this is correct. Address 0.1 is your phone, and 0.2 is your computer.

bogwog wrote:

4. Why did this get setup automatically on my macbook but not on my arch pc? I didn't do anything special on my mac, I just connected the phone and it worked pretty much automatically. I definitely didn't have to do anything like this. Is there some kind of networking bug or something on arch, or is it like a feature on macs?

I'm guessing the BB provides a DHCP server on that interface, and the MB does a DHCP configuration of the interface when you connect it. (See #1 for doing the same on Arch)

Offline

Board footer

Powered by FluxBB