Sunday, August 26, 2007

IP address is 169.254.*.* even though it's addressed statically

In my office, I connect to the network 192.168.50.32/27.

Even though I set my IP address statically, when I execute ifconfig:

$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:08:02:D6:FA:FA
inet addr:169.254.147.105 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::208:2ff:fed6:fafa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4287 errors:0 dropped:0 overruns:0 frame:0
TX packets:4414 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3240523 (3.0 MiB) TX bytes:805926 (787.0 KiB)
Interrupt:10 Base address:0x800

That address is a temporary one for when the device cannot get IP address from DHCP server, no?

However, my /etc/network/interfaces has static address...

$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.50.39
netmask 255.255.255.224
gateway 192.168.50.33

And in this situation, I CAN connect to internet.

After restarting /etc/init.d/networking, the address turn to 192.168.50.39, the static address I set.
$ sudo /etc/init.d/networking restart
Password:
* Reconfiguring network interfaces... [ ok ]
jocv@jocv:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:08:02:D6:FA:FA
inet addr:192.168.50.39 Bcast:192.168.50.63 Mask:255.255.255.224
inet6 addr: fe80::208:2ff:fed6:fafa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6978 errors:0 dropped:0 overruns:0 frame:0
TX packets:7132 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5267012 (5.0 MiB) TX bytes:1299465 (1.2 MiB)
Interrupt:10 Base address:0x800
It's causally related to zeroconf.
zeroconf is a tecnology that can let some device connect to network without configuration.
First, zeroconf request an IP address to DHCP server. If the server doesn't exist, zeroconf give an IP address of 169.254.0.0/16 automatically. I uninstalled zeroconf and now everything is fine.

At any rate, even though the result of ifconfig is 169.254.*.*, IP address is absolutely 192.168.50.* because it connected to network...why? I'm no longer able to believe ifconfig?

Saturday, August 25, 2007

Wireless LAN with PCMCIA on Edgy

Generally, there are 2 ways to activate a wireless LAN adapter with PCMCIA on Linux:
However, if you brought an adaper that isn't supported by ndiwrapper, you have to throw it in the garbage bag?
No. If you execute "lspci" command and get a following answer:

03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88w8335 [Libertas] 802.11b/g Wireless (rev 03)

You might be able to use it!

I bought an adaper "Wireless G Adapter PCMCIA(PM150NXT08)" by NEXXT.
Either There are no driver for Linux or support by ndiwrapper but I succeed activate it.

First, we need activate PCMCIA.
Edgy recognize PCMCIA by default. But if your Ubuntu doesn't know PCMCIA is inserted into your PC, install "pcmciautils" for kernel version up to 2.6 or "pcmcia-cs" for other version with Synaptic.

Now we can install driver for Marvell Technology's adaper.
If you've installed ndiswrapper, you nees uninstall it(following packages) through Synaptic or apt-get.
  • ndiswrapper-common
  • ndiswrapper-utils
  • ndiswrapper-utils-1.1
Next, install build-essential and linux-headers of your kernel version through Synaptic or command line interface.
$ sudo apt-get build-essential
$ sudo apt-get install linux-headers-`uname -r`

Create symbolic link:

$ sudo ln -s /usr/src/linux-`uname -r` /lib/modules/`uname -r`/build

Download latest version on Nidswrapper and install it.

$ tar xvzf ndiswrapper-1.38.tar.gz
$ cd ndiswrapper-1.38
$ make distclean
$ make
$ sudo make install
Go to TRENDnet's web site and download a driver that can be alternative driver for your PCMCIA.

Decompress it and now install driver with ndiswrapper.
$ unzip TEW-421PC_b1\\Driver\\Utility_Driver_TEW-421PC_423PI_b1_2.00.zip
$ cd Drivers/Windows\ XP/
$ sudo ndiswrapper -i Mrv8000c.INF

Check install by command "ndiwsrapper -l"

$ ndiswrapper -l
mrv8000c : driver installed
device (11AB:1FAA) present

Activate it!

$  sudo depmod -a
$ sudo modprobe ndiswrapper

Now turn on PWD LED!

Execute iwconfig in passing.

$ iwconfig
:
wlan0 IEEE 802.11b ESSID:off/any
Mode:Managed Frequency:2.437 GHz Access Point: Not-Associated
Bit Rate:1 Mb/s Sensitivity=-200 dBm
RTS thr:2346 B Fragment thr:2346 B
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
Add information into /etc/network/interfaces:
iface wlan0 inet dhcp
wireless-essid [SSID]
wireless-key [WEP key]
auto wlan0

Restart /etc/init.d/networking.

$ sudo /etc/init.d/networking restart

Are you connected to internet now?

Lastly, configure your ndiswrapper for activate your PCMCIA everytime you boot your PC.
$ sudo ndiswrapper -m
adding "alias wlan0 ndiswrapper" to /etc/modprobe.d/ndiswrapper ...

Perfect!

Reference: TRENDnet TEW-421PC H/W:B1 PC Card Wireless Adapter using ndiswrapper Installation

Greeting...

Hello everyone,
I'm a big fan of Ubuntu.

I have a blog about Ubuntu, Ubuntu日記 in Japanese, and now I try to translate it into English by little and little.