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

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.

Related

Windows Ethernet showing "Network cable unplugged" when connected to Linux machine [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 3 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I currently have a Windows 10 machine connected to a Red Hat Enterprise Linux Workstation 6.10 machine by Cat 5 Ethernet cable.
I plug an Ethernet cable from eth2 port on the Linux machine to Ethernet on Windows machine.
I run ifconfig eth2 down on the Linux machine to take down the network connection. The Network Connections window on the Windows Machine show that Ethernet is connected to an Unidentified network. I cannot ping the static ip address for eth2 however.
If I run ifconfig eth2 up on the Linux machine to bring up the network connection Windows shows Ethernet as "Network cable unplugged'. When running ifconfig on the Linux machine the following shows:
eth2 Link encap:Ethernet HWaddr __:__:__:__:__:__
inet addr: 192.168.1.11 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 frame:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:17
If I ping 192.168.1.11 on the Windows machine I get the message Destination Host Unreachable.
What might be causing this?
You don't specify how you configured your interfaces on both sides.
From your ifconfig on Linux side it appears that you configured it with a static IP 192.168.1.11/24. What about Windows side? Is the interface also configured to have some static IP in the same network? E.g. 192.168.1.12 with netmask 255.255.255.0?
BTW, most modern Ethernet interfaces feature automatic polarity detection, so the need to have a crossover cable is quite rare these days.
There is no point to touch IP configuration until you see link is UP
Check if cards are blinking
Try replacing the cable
Try lowering link speed with duplex change with ethtool (windows:network settings GUI)
ethtool -s eth2 speed 10 duplex half autoneg off
Most likely, you need a cross-over cable - an ethernet cable where the receive terminal from one side connects to the transmit terminal on the other, and vice versa. Or just use a modern hub or switch as an intermediary - most automatically switch the direction automatically. Plug both machines into the hub or switch, and they should be able to communicate from their static IPs just fine.
You must use a Cross-Over cable (Pin 1,2 to 3,6 and visavi).
And don't forget to manualy set up your IP configuration (Gateway is not needed) in the same subnetmask. There is now no DHCP server between.

How can I do a http.request using a different gateway?

I have one network connection on my Macbook Pro. It is configured by my ADSL modem by DHCP. That modem is on 192.168.1.1 . I also have a cable modem connected to the network. I switched its DHCP server off. It is on 192.168.1.254 .
How can I connect to a URL using the cable modem?
I think I have to set up a vlan which I then can use by setting the localAddress option of http.request. Am I right?
Ok, I found out that it is not possible with one ethernet interface. So I bought another usb to ethernet adapter. Now one is configured by DHCP. The other is configured by hand. In node I use the localAddress to set which interface to use.

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

Linking Bluetooth and Ethernet packets

If I am listening to Ethernet packets going across a Wi-Fi network using a card in monitor mode, and listening to Bluetooth packets using an Ubertooth, is there any way to link both types of packets to devices? As far as I am aware there no commonality between the Bluetooth BD_ADDR and the Ethernet MAC address of a device.
Essentially: is there a common denominator in Wi-Fi and Bluetooth packets that can be used to link the two?
Edit: just to add, the device in question is a smartphone.

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

Resources