FAQ Database Discussion Community


how to get Ethernet adapter name from IP in c in centos

c++,c,linux,network-interface
have two ethernet adapters, so i have two different ip addresses. Now I ant to find the name of the adapter with the respective ip. Like, I have intel card with ip 192.168.10.1. How to retrieve this adapter name in centos(linux) using C or C++ without any third party installation?...

Scapy - sniffing 2 interfaces out of three

python,scapy,network-interface
I'm using Scapy 2.2.0 and Python 2.6 to sniff on Windows 7. I know that you can supply the iface parameter to the sniff function. for example: sniff(count=5,iface = 'eth0', prn=lambda p:p.show()) If you don't supply this parameter, it sniffs in all interfaces. But is there a way to choose...

Bash script to configure network interfaces

linux,bash,unix,network-programming,network-interface
I'm a network and OS student, and I have to make a script that does the following: It can be called with or without parameters. If called with parameters, it must recieve the name of a network interface (e.g: eth0) and a "name of a configuration profile". Well, I am...

Python Scapy - Meaningful Interfaces Name

python,scapy,network-interface
I'm building a sniffer with python 2.6 and Scapy on windows 7. When the user wants to start a sniff I give him the option to choose the interface he wants to sniff in, this gives me the interfaces - def get_interfaces(): """returns a list of available network interfaces""" interfaces...

Bash - Script that reads .txt file and stores the info in variables to be used later

bash,shell,unix,network-programming,network-interface
I'm working on a bash script that must be able to create "network interface profile configurations", store them in any kind of file (.txt I guess) and then, if called with parameters, eg: ./myscript eth0 myprofile must execute the commands in myprofile.txt to configure that network interface. So, right now,...

how to change wlan0mon network interface to mon0 on linux [closed]

linux,network-interface
I have problem in my Kali-Linux operating system , in the normal situation when I run this command airmon-ng start wlan0 I get a new interface named "mon0" , but now I get new interface named "wlan0mon" , and I want to go back to the normal situation . So...

NetworkInterface.isUp() returns false

android,network-interface
I've the problem that on one of my Android test tablets (running Android 4.4.2) has NetworkInterface.isUp() returning false. Also, NetworkInterface.getInetAddresses() returns an empty Enumeration<InetAddress>. Strangely, I have access to the Internet and when I look at the Wifi network details, the device has obtained an IP address. On another device...

Bash - Display menu with network interfaces as options

linux,bash,network-interface
I am a total bash newbie, and I need to make a script that has a menu where each of the options is one of the available network interfaces of the system. The user must choose one of the options. So basically, I am looking for something like this (when...

Two ethernet adapter [closed]

networking,ping,network-interface,network-connection
I have mounted two ethernet adapter on my pc and each of them has connected to a seperate network. The problem is that only one of them is active at a same time. In other verb I can ping only through one of them at the same time and if...

Using C from Python

python,c,ctypes,network-interface
I want to know the names of the NetworkInterfaces from python, but it seems it's not possible from python so I'm using this C code: #include <Python.h> #include <windows.h> #include <iphlpapi.h> #include <stdio.h> #pragma comment(lib, "iphlpapi.lib") PyObject* GetInterfaces (PyObject* self){ ULONG buflen = sizeof(IP_ADAPTER_INFO); IP_ADAPTER_INFO *pAdapterInfo = (IP_ADAPTER_INFO *)malloc(buflen); if...