How to know which network adapter I’m using?

To know the manufacturer of the network adapter of your computer in Linux, type this command in terminal:

sudo lshw -C network

The output of the command may look something like this:

       *-network               
       description: Wireless interface
       product: BCM4313 802.11b/g/n Wireless LAN Controller
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlan0
       version: 01
       serial: 70:f1:a1:c2:f2:e9
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=brcm80211 driverversion=2.6.38-8-generic firmware=N/A ip=172.17.4.253 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn
       resources: irq:17 memory:f0500000-f0503fff
  *-network
       description: Ethernet interface
       product: AR8152 v1.1 Fast Ethernet
       vendor: Atheros Communications
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: eth0
       version: c1
       serial: b8:ac:6f:67:11:46
       capacity: 100Mbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vpd bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=atl1c driverversion=1.0.1.0-NAPI firmware=N/A latency=0 link=no multicast=yes port=twisted pair
       resources: irq:43 memory:f0400000-f043ffff ioport:2000(size=128)

Check the output closely. It gives information about both Wired and Wireless Network Adapter. No need to specify that one with Wireless Interface describes wireless adapter and one with Ethernet Interface describes Wired Network Adapter. As you can see in the output, I have Broadcom’s wireless adapter and Atheros Ethernet (wired) adapter.

Questions, suggestions and feedbacks are welcomed. If you liked the post then please acknowledge it by liking/voting/commenting on the post. Enjoy :)

How to solve: No wireless networks in Ubuntu 12.04, 11.10 and 11.04

Problem:

Recently I installed Ubuntu 11.04 (wireless was working while installing) on my Dell Inspiron N4010 which uses Broadcom Wireless Adapter (How to know which network adapter you are using?). Wireless networks were even available when I used it for the first time after installing. Then there were message from Ubuntu that restricted drivers are available for Broadcom STA (BCM4311) (why did it ask me to download the wireless drivers when wireless was working on the first hand..??). Any ways, I said, why not? I clicked on the activate button. It installed the driver and asked me to restart the computer. I restarted it and there you go. Wireless is on. But it detects no networks. I know there are wireless networks but Ubuntu is not detecting any wireless networks.

Reason:

The reason what I think is some compatibility issues (it’s probably a bug in 11.04) with this version of Ubuntu and the restricted driver because same driver was working quite well in previous versions of Ubuntu.

Solution:

Here is what you need to do. Use other Broadcom drivers. Download these drivers (from Windows or through wired network or a friend’s computer or from wherever you are reading this article :) ).

For 32 bit: http://ie.archive.ubuntu.com/ubuntu/pool/restricted/b/bcmwl/bcmwl-kernel-source_5.+bdcom-0ubuntu5_i386.deb

For 64 bit: http://ie.archive.ubuntu.com/ubuntu/pool/restricted/b/bcmwl/bcmwl-kernel-source_5.+bdcom-0ubuntu5_amd64.deb

(Don’t know which Ubuntu you are using? Click here: Check you Ubuntu architecture)

Now remove the previous drivers in Ubuntu 11.04 by using: sudo apt-get remove bcmwl-kernel-source

Now install the appropriate driver (you have downloaded from the above links). Restart your computer. If restarting doesn’t work try shut down and then start it (strange…but works). Enjoy :)

Alternate Solution 1:

If you could connect through a wired network, this solution might work for you. (If not then check here). The problem is with STA drivers so better to deactivate/uninstall it.

Alternate Solution 2:

People who cannot solve the problem with the above specified method may want to try this one. Here you go:

  • open the ‘Synaptic Package Manager‘ (if you are using Ubuntu 11.10 then install it first from the software cemter) and search for ‘bcm’
  • uninstall the ‘bcm-kernel-source‘ package
  • make sure that the ‘firmware-b43-installer‘ and the ‘b43-fwcutter‘ packages are installed
  • type into terminal:

    cat /etc/modprobe.d/* | egrep '8180|acx|at76|ath|b43|bcm|CX|eth|ipw|irmware|isl|lbtf|orinoco|ndiswrapper|NPE|p54|prism|rtl|rt2|rt3|rt6|rt7|witch|wl' 

    (you may want to copy this till the end if it is not visible properly) and see if the term ‘blacklist bcm43xx‘ is there

  • if it is, then type cd /etc/modprobe.d/ and then sudo gedit blacklist.conf put a # in front of the line: blacklist bcm43xx then save the file (I was getting error messages in the terminal about not being able to save, but it actually did save properly).
  • reboot
Hopefully this works for you all!
Questions, suggestions and feedbacks are welcomed. A word of thanks is always appreciated. And if you like the article and the blog then please subscribe to stay in touch.

Sources: ubuntuforums, askubuntu

Troubleshooting FreeRADIUS

Recently I was working with FreeRADIUS to do PEAP authentication. I went under a lot of trouble from installing to configuring the FreeRADIUS. Thankfully, I noted down the problems I encountered and the solution I followed. This is not a complete guide for FreeRADIUS installation but provides you with possible solution to a few errors.

1.

While executing radiusd -X, it may throw the following error:

radiusd: error while loading shared libraries:

libfreeradius-radius-2.1.10.so:

cannot open shared object file: No such file or directory

The reason for this error is that the libraries have been installed in a place where dynamic linker cannot find it. To solve this problem use this command:

sudo /sbin/ldconfig -v

2.

While running in debug mode the RADIUS server may give the following error:

Ignoring EAP-Type/tls because we do not have OpenSSL support.

[eap] Request found, released from the list

[eap] EAP NAK

[eap] NAK asked for unsupported type PEAP

[eap] No common EAP types found.

[eap] Failed in EAP select

++[eap] returns invalid

Failed to authenticate the user.

The reason for this error is that open ssl dev library “libssl-dev” is not installed. Install the library (sudo apt-get install libssl-dev) and re-configure (by running configure, make and make install) FreeRADIUS server.

3.

Running the RADIUS server may also result in the following error:

Error: Failed binding to authentication address * port 1812: Address already in use /usr/local/etc/raddb/radiusd.conf[240]: Error binding to port for 0.0.0.0 port 1812

The reason for this error is that another instance of radius is running and has occupied the port.

See which radius process is running:

ps aux | grep radius

And then kill that process:

sudo kill -9 process_id

4.

While running the RADIUS sever it may also throw an error: “no soh-server”. To solve it, copy “soh” file in /usr/local/etc/raddb/sites-available to /usr/local/etc/raddb/sites-enabled.

I hope it helped you. Questions and suggestions are welcomed. Enjoy :)


How to install Windows application (.exe) on Linux / Ubuntu with Wine

As a new Linux user I always miss Windows for some of the applications that are not available on Linux. Booting the computer to go back to Windows just to use some specific software is a real pain. And that made me think how to install Windows programs i.e. .exe files in Linux? This task can be accomplished by the use of Wine application on Linux OS. To use this application you don’t have to be a member of a real wine club 😛

Jokes apart, Wine offers a compatibility layer that allows Linux users to run Windows application on Linux based OS.This tutorial describes the necessary steps to install a Windows application on Linux. The tutorial is based on Ubuntu but similar steps can be followed for other Linux OS as well.

  1. Install Wine application on Ubuntu. You can use Synaptic Package Manager or use this command: sudo apt-get install wine
  2. In this tutorial I am trying to install Rynga, a VoIP application. Download the .exe file of the application. Right click on it and choose properties. In the properties dialogue box go to the Permissions tab. In here check the  Allow executing the file as program box.
  3. Now go to the open with tab and select Wine Windows program loader. Close it.
  4. Now double click the .exe file and follow the usual Next-Next step as in Windows.

I wish this tutorial helped you to install Windows programs in Linux. Questions and suggestions are welcome.

P.S. Compatibility issues may be there with some applications.

How to run or install .bin files in Ubuntu (Unix)

Being a beginner with Unix OS is a painful but interesting experience. I guess I learn almost everyday few things which might be very basic but definitely challenging for a newbie like me. Few days back I wanted to install Adobe Reader on my Ubuntu 10.10. Most of the ready to install packages for Ubntu are in .deb format which can be installed like an executable file in Windows. But this package was in .deb format. Interesting! I thought. This one is not click and install package but it requires no extra terrestrial effort for sure. Following steps should be taken:

  • Open the terminal and go in the directory where the /deb package is saved
  • Change the access rights / permission for the .deb file/package. Most easy way is to give all rights (read, write and execute) to all users by following command: chmod a+x name_of_file.bin
  • Now run the file with the following command: sudo ./name_of_file.bin

How to measure the throughput of a network with ipmt Unix command

ipmt, for IP measurement tools, is a set of tools able to carry out performance measurements on IP networks at the transport layer. tcpmt and udpmt are network performance measurement tools at the transport layer (respectively TCP and UDP). Every second, they generate a throughput report.
By default, they transmit on the discard port of the destination station. This means that, for UDP, the measured throughput at the sender cannot be the effective transmitted throughput since UDP is not reliable.

How to use them :
# tcpmt [-p port] [-s pktsz] [-n pktnb] host
# udpmt [-p port] [-s pktsz] [-n pktnb] host

Where :
port is the destination port number (discard, by default).
pktsz is the size of sent packets (1024 bytes by default) This parameter is only significant in the UDP context.
pktnb is the packet number to send (by default, press Control-C to stop the transmission).
host is the destination address.
A report is generated every second

  • transmission time (in ms since 0h),
  • the number of sent packets during the time interval,
  • the total number of sent packets,
  • the measured throughput during the time interval in kbit/s,
  • the average throughput on the last ten seconds,
  • the average throughput since the beginning.

tcptarget and udptarget are two programs which measure the trhoughput at the destination. Thay can be launched with no argument and they display the port number on which they are listening. We must use the -p option of tcpmt/udpmt in order to specify a port. As soon as tcptarget/udptarget start to receive packets, they display a report every second. This report is easier to understand than the sender report but it is less detailed. It displays the reception time in seconds with a precision around the millisecond and the throughput in kbit/s.

If you want to measure the behavior of concurrent flows sent on the same target station, Tcp/udptarget are the perfect tools since the arrival times are computed on the same station. Thus you can easily compare the packet arrival times of the different flows without having to synchronize the sending stations.

How to manipulate the routing table in Unix

The routing table of a station can be modified or seen thanks to the route command. It may be used to add or remove entries in the table. The routing table can be displayed by “netstat -r” command (For more information on netstat command please follow: http://computerandu.wordpress.com/2011/03/03/how-to-use-netstat-a-unix-networking-command/).

1. Route command presentation:

route add|delete [-net|-host] []

command keywords signification :
add|delete : add will add an entry in the routing table , delete will remove one ;
-net|-host : -net allows to specify an entry towards a network, -host allows to specify an entry towards a host ;
destination : The destination can be a host station address or a network address followed by the subnet mask length, /20 ; The destination may also be the keyword default. In this case, the packet will be sent to the matching router if the destination network address is not specified in the routing table ;
gateway : the router address which relays the packets from one network to another;
netmask : the subnet mask of the destination network.

2. Add a path in a routing table: Use the add option, and specify in the following order : the -net option if you need to enter a network route or -host if it is a host route, the destination IP address (network or station) and the destination internet address (network or station) and the IP address of the router that will relay the traffic. For instance :
# route add -net 192.168.0 192.168.1.2
add net 192.168.0: gateway 192.168.1.2
will add a path in the routing table : to reach the network 192.168.0/24, you must go through the 192.168.1.2 router.

3. Remove an entry in the routing table: Use the delete option and specify host or network options like in the addition process. For instance :
# route delete -net 192.168.0/24
will remove the previous entry added in the routing table.

4. Delete all the routing table entries: The flush command will remove all the entries added with the add command. If you use this command remotely, it may suspend all your current communications with this router and make this station unreachable.

Remark : do not remove the loopback entry, 127.0.0.1 or localhost, which enables the application to communicate localy.

How to install and run Nessus on Ubuntu, Linux or other Unix like OS

installation on UbuntuNessus is a great network security tool but installing it correctly can be a real pain some time even for advance user. I faced few problems and that is why I noted down all the necessary and sufficient steps. The steps below are explained for Ubuntu but I think similar steps can be used for other Unix like OS.

Step1: Download the ubuntu package from the website:http://tenable.com/products/nessus/nessus-download-agreement
and Run it.
Step2: To start nessus, type this command in super user mode: sudo /etc/init.d/nessusd start
Output of this command will result in:

$Starting Nessus : .
takshak@takshak-NB:~$ Missing plugins. Attempting a plugin update…
Your installation is missing plugins. Please register and try again.
To register, please visit http://www.nessus.org/register

Step3. Go on the given link and resgister on the home version, check ur mail get the license and use the command specified in ur mail as super user. It will register the Nessus and will also downlaod the missing plugins.

Step4. Run the nessus by using command: sudo /etc/init.d/nessusd start
Running Nessus command nasl gives an error “nasl : command not found”

(i) Try this command: whereis nessus
output will look something like: nessus: /opt/nessus/bin/nessus

(ii) Check the path see if the mentioned directory is added in the path or not by using command: echo $PATH
If the output of the command is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
then the command is not added to the path

(iii) Add the dirctory to the path by using the command: export PATH=$PATH:/opt/nessus/bin

Step5: Then start nessus by using command: sudo /etc/init.d/nessusd start

Step6: To run a nasl file use: nasl -t target_ip filename.nasl

How to use netstat : A Unix networking command

This command displays the different data structure contents linked to the station network configuration. Here we will only talk about two ways to use netstat, but there are many other information that we can get (sockets status, routing table, multicast ).

Network interface statistics: Use the option -I (interface), and specifythe interface name to observe (em0 for instance), and the option -w 1 to display a report every second. If you do not specify this last option, netstat will only give one report in a different style. We can also specify the option -d.

Theses reports include the following information :
(fxp0) : network interface name.
packets : the received/transmitted packets with no errors ;
errs : the received/transmitted packets with errors ;
bytes : The number of received/transmitted bytes ;
colls : the collisions number ;
drops : the dropped packet numbers (with -d).

For instance :
# netstat -w 1 -I fxp0 -d will display a report of the fxp0 interface every second. We get :

Routing table display: Specify the -r option (routing table). It can be also interesting to specify the -n option and -f inet, to disable the name resolution and only list IPv4 information (use inet6 to display the IPv6 table).

Various fields signification (for a thorough explanation, use man) :
Destination : the destination network of host address ;
Gateway : the router address, the local link or the remote interface address on thelink ;
Flags :
U : Indicates route is ”up” ;
G : Route is to a gateway ;
S : Static route (manual addition) ;
H : Route is to a host and not a network ;
D : Route was created dynamically by a redirect ;
Refs : The ref field gives the current number of active uses of the route ;
Use : The use field provides a count of the number of packets sent using that route. ;
Netif : The interface entry indicates the network interface utilized for the route ;
Expire : The Expire entry is the result of FreeBSD’s unfortunate co-mingling network layer routing information with layer 2 ARP information. The only entries with ”Expire” values are actually ARP entries.

 

Sources: INPG Prof. Olivier