Change TXPower of Probe Requests - linux

Setup: Kali Linux, VMWare Fusion, Mac OSX Host, TPLinkWN772 or ALFA.
I am aiming to reduce the TXPower of a wireless interface in order to assess the impact that it has upon RSSI values. When connected to a network it is easy enough
iwconfig wlan0 txpower 10
However if I am not connected to a network the power will not change. Does something else govern the minimum level that is used for probe requests?

I think your wireless card must be down to do that. So, you must do:
ifconfig wlan0 down
iwconfig wlan0 txpower 10
ifconfig wlan0 up
Some cards doesn't support that.

Related

Two NICs on the machine, bind them to the separate interfaces assigned by OS

I'm currently doing a project with my Raspberry Pi 3 and now I'm having some trouble with it.
I have two NICs (one internal NIC on the SOC and one external NIC) on the RPi and configure the two interfaces (wlan0 and wlan1) to have different functionalities. But since the external NIC CANNOT do the job which the internal NIC can do, I want the NICs and the interfaces assigned by OS to be bound (e.g., internal NIC with wlan0 and external NIC with wlan1) every time I boot up my RPi.
Is there any ways to reach my requirement? Great thanks for any tips or advices!
The OS running on my RPi is Raspbian and the Linux kernel version is 4.1.19.
I am not certain what you want, but I think you want to ensure that the right name is assigned to each NIC on your Raspberry Pi. If so, you need to set up a udev rule that sets the interface name according to the NIC's unique MAC address. You would use sudo to edit /etc/udev/rules.d/70-persistent-net.rules and make it like this:
# interface with MAC address "aa:bb:cc:dd:ee:ff" will be assigned "eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="aa:bb:cc:dd:ee:ff", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# interface with MAC address "mm:nn:oo:pp:qq:rr" will be assigned "eth1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="mm:nn:oo:pp:qq:rr", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
I guess you are searching for creating a bond between both your NICs, right?
Don't know about Raspian but in pure Debian is quite simple (did this for a wi-fi USB dongle and a bridged interface in virtualbox without much of a problem):
/etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.10
gateway 192.168.1.254
netmask 255.255.255.0
auto eth1
iface eth1 inet manual
bond-master bond0
bond-primary eth0
auto eth2
iface eth2 inet manual
bond-master bond0
auto bond0
iface bond0 inet dhcp
bond-miimon 100
bond-slaves none
Still you need to take care for setting the WPA configuration (in the same file works), here are some URLs that will help there:
https://wiki.debian.org/Bonding
http://ubuntuforums.org/showthread.php?t=1626536

IP Multicast - would this work on my dual homed embedded Linux device?

I am working on an embedded Linux project. It has a cell modem that comes up as ppp0 and a single Ethernet interface eth0 that may or may not be connected. The cable could be unplugged at any time from eth0 or may never be plugged in.
Is it possible to setup multicasting so that it could intelligently send the outgoing traffic over eth0 if it's up, otherwise over ppp0? If so I would be very interested on how to do this.
Thanks,
Fred

Why are external NICs not working on my server (running on Debian 7)?

I have a server running Debian 7. The eth0 interface is configured to use the on-board ethernet card. This is basically used to connect to the internet. As it happens, I had to connect this server to some PCs through a switch, obviously on a different series of IPs. for this, I installed an external NIC in the PCI slot but, strangely it didn't seen to work. The configurations were alright. I checked them more times than I can imagine. So, I disabled my eth0 interface and connected eth1 (external NIC) to the internet. If for the same settings, the on-board card worked, so should the external one. But, it didn't. When I tried to ping some servers like 8.8.8.8, it gives me Destination Host Unreachable and on termination shows, 0 packets "transmitted" and 0 packets received, which is baffling, to say the least. The PCI slot is working because I checked if the drivers were being recognised or not. The NIC itself is working (checked with another machine running Debian 6). Any help/sugesstions would be appreciated.
P.S The NIC in question is D-Link System DGE-530T Gigabit Ethernet Adapter (rev 11)
You need to check to see if the card is being listed in lspci or not. Second, is this a virtual machine?
I would also check to see if the BIOS is handling IRQ's in auto or are they specifically assigned.

Disable a network interface in Arch Linux

I have the following problem. My PC is very old and it has a built in ethernet port that doesn't work, not due to a misconfiguration, I think it's physically damaged. It didn't work in either Ubuntu or even on Windows. I have an ethernet PCI card which is the one I use. The problem is, for some odd reason, the card that does works sometimes changes from eth0 to eth1 and I have to run dhcpd as I don't always get an IP via DHCP. Now, the actual question is, is there some way to disable the card that doesn't work using its MAC address or something? I can't disable either eth0 or eth1 as I'm sure it's not always "pointing" to the same card.
Are they the same kind of chipset or different ones?
If they are differnt then probably the simplest solution would be to just blacklist the modules for that Ethernet chipset.
You will first need to find the module name (this is for eth0):
dmesg | grep eth0
See if you have something like the following:
[ 2.209295] r8169 0000:05:00.0: eth0: RTL8168d/8111d at 0xffffc90000c6e000, 00:24:1d:11:b6:64, XID 081000c0 IRQ 44
In my case 'r8169' is the module name. You can also see a list of currently loaded modules with 'lsmod' so check that it appears in there.
Next you need to black list the module. There is an entry on the Arch wiki for that.
Fellow archer here; I have a method I use to disable my nVidia graphic card's HDMI port audio chip based on its hardware pci id; perhaps you could apply the same approach to your nic:
Find the ethernet's pci id:
$ lspci | grep Eth
00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network Connection (rev 05)
Find the corresponding directory:
$ find /sys/devices -name *00:19.0
/sys/devices/pci0000:00/0000:00:19.0
There should be a file named "remove" in that directory.
You can disable the device at startup by editing /etc/rc.local
echo 1 > /sys/devices/pci0000:00/0000:00:19.0/remove
On second thought; this may not work in your case if modules get loaded prior to /etc/rc.local finishing... it would do you little good to have /dev/eth0 and /dev/eth1 assigned in the "wrong" order and then have /etc/rc.conf disable one of them... you could still end up with your prefered nic as eth1. This used to be a problem with alsa on multiple sound cards so methods were devised to assign the numbering of the cards via module parameters. Perhaps the module itself allows this?
I'm gathering from your description this in an onboard NIC. The best solution would be to disable it in the motherboard BIOS rather than the OS. The method for this varies by manufacturer but I'm sure you could find a manual for your model online somewhere.
I'm confused it didn't show up: In case you don't need the low level solution proposed by cjpembo, you can just use
ip link set dev <interface name> down
You get them via ip link show.

Unable to read packets captured from wifi network using wireshark

I am connected to my home wifi network using Ubuntu 10.10. The protection is WPA2-auto.
I want to capture packets from it.
$ sudo iwconfig wlan0 mode monitor
$ sudo wireshark
I try to capture from wlan0.
Am connected to the wifi network with an android phone and browsing websites.
However I am unable to see unencrypted http packets.
I select Edit|Preferences|Capture|Protocols
and select 802.11 and set the checkbox to yes for 'decrypt packets'.
Still nothing.
Solution: run airmon-ng from the aircrack-ng project to set the wireless card into monitor mode. (this was pointed out by a Wireshark developer on the mailing lists). Apparently iwconfig does not work properly as it has issues on Ubuntu.
airmon-ng start wlan0
This will set it into monitor mode and create interface mon0.
After this, I was able to capture off the mon0 interface using Wireshark.
You must capture the association sequence to be able to decrypt the traffic.
If you start your capture when the phone is already connected then Wireshark
cannot decrypt the packets.

Resources