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

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

Related

Linux commands equivalent to ovs add port with vlan

ovs-vsctl add-port hostInterface hostveth tag=9. This command adds hostveth to bridge and also the packets coming out of hostveth are tagged with vlan id 9. I'm looking for similar commands for linux bridge
My setup is
hostInterface(bridge) -> hostvethpair -> ns1vethpair(another namespace)
hostinterface and hostvethpair are is same default namespace but ns1vethpair in different namespace.
I want packets coming out of hostvethpair to be tagged with vlan id and these tagged packets should be sent to bridge. Im able to achieve this with ovs bridge using above command. Is there any command that can do the same in Linux bridge. If so, can you share an example?
Thanks in advance
I think I got the solution for what i'm looking for. It can be done via bridge vlan filtering rules. (bridge vlan add).

Change TXPower of Probe Requests

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.

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.

how two linux embedded device can communicate on ethernet [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
i am a beginer in network things...
I am m trying to make a communication between two linux device(imx-6 boards).
These devices are connected through an ethernet cable. The devive will not be connected to the local LAN.
What i am trying is to make a communication between these two devices using ethernet.
With the Cross cable connected and assigned static IP for both device by
enabling below code in /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.XX
network 192.168.0.0
netmask 255.255.255.0
the ping is NOT happening between device (also the network port lights are also not coming) ,
But when i connected one of this device to laptop (made static IP to laptop) it pings.
am i missing something ???
i am using Timesys Nitrogen 6X board (https://linuxlink.timesys.com/docs/gsg/NITROGEN6X#SECTION00042000000000000000)
# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: Symmetric
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 6
Transceiver: external
Auto-negotiation: on
Link detected: no
PLease suggest me an approach.
Thanks
Connect the devices via a crossover cable, if the NICs don't support Auto-MDIX.
Assign them static IP addresses on the same subnet. Eg:
A: 192.168.100.20 255.255.255.0
B: 192.168.100.30 255.255.255.0
Proceed with your application protocols as you would any other network programming.

Resources