Figure out IP address of external device

Issues related to configuring your network
Post Reply
newbieForever
Posts: 5
Joined: 2018/02/26 11:41:26

Figure out IP address of external device

Post by newbieForever » 2018/02/26 11:49:22

Hello everyone

I have an external device (a PCB crate) of which I do not know the IP address. Connected to this device is a PCB that broadcasts its MAC address. Ultimately, I want to know this MAC address.

I can connect to PCB crate with an Ethernet cable. I have two Ethernet cards in my PC, one connected to the outside world (eth0), and one connected to the PCB crate (eth1).

I installed wireshark to see if I get any traffic on eth1, but I don't see anything. Here's the output of ip addr:

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:22:4d:aa:e6:1d brd ff:ff:ff:ff:ff:ff
    inet 128.141.223.194/24 brd 128.141.223.255 scope global eth0
    inet6 fe80::222:4dff:feaa:e61d/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 68:05:ca:26:b7:6f brd ff:ff:ff:ff:ff:ff
    inet6 fe80::6a05:caff:fe26:b76f/64 scope link 
       valid_lft forever preferred_lft forever
4: virbr0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN 
    link/ether 52:54:00:bb:7f:ae brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 500
    link/ether 52:54:00:bb:7f:ae brd ff:ff:ff:ff:ff:ff
I see that eth1 has an IP6 address, but not an IP4 address. I don't know if that is a problem. I tried to assign an IP4 address with

Code: Select all

ifconfig eth1 192.168.0.10 netmask 255.255.255.0
The address gets assigned to eth1, but then it vanishes again. I think this is due to a DHCP running in the background.

I'm a bit stuck now, if I'm going in the right direction or not. How can I figure out what IP address the PCB crate has? How can I communicate with it, such that the MAC address of the PCB will be broadcasted to my Ethernet card? How can I turn off the DHCP for eth1 only?

Any help is much appreciated.

User avatar
TrevorH
Forum Moderator
Posts: 23206
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Figure out IP address of external device

Post by TrevorH » 2018/02/26 12:58:11

I'd fire up tshark -i eth1 -n -nn -l then reboot the attached device and see what you see.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

newbieForever
Posts: 5
Joined: 2018/02/26 11:41:26

Re: Figure out IP address of external device

Post by newbieForever » 2018/02/26 13:15:57

That's exactly what I did. Well, except without -n, -nn and -l. The only output I get is the following:

Code: Select all

0.000000000      0.0.0.0 -> 255.255.255.255 DHCP 342 DHCP Discover - Transaction ID 0xc74e4b34

tunk
Posts: 355
Joined: 2017/02/22 15:08:17

Re: Figure out IP address of external device

Post by tunk » 2018/02/26 13:45:25

No expert on this, but a bit of googling suggests that your device is asking for an IP address from a DHCP server.
Maybe you could connect it to a router, enter the router interface to see which IP address it got assigned.
(BTW, out of curiosity, what's a PCB crate?)

newbieForever
Posts: 5
Joined: 2018/02/26 11:41:26

Re: Figure out IP address of external device

Post by newbieForever » 2018/02/26 13:51:29

Ok, that could be. I was expecting it to have a fix IP already. Need to find a router first, to test this. But thanks for the input, it is much appreciated!

Maybe I'm not using the right terminology. But what I consider a PCB crate can be seen e.g. here:
http://www.hep.ph.ic.ac.uk/calice/elecP ... fCrate.jpg

User avatar
TrevorH
Forum Moderator
Posts: 23206
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Figure out IP address of external device

Post by TrevorH » 2018/02/26 14:01:43

That would appear to be looking for a DHCP server which I presume you don't have on this machine. There should be options to have it display the ethernet header too and that should have the MAC address in it. If tshark can't do that then tcpdump can using the -e switch so try that instead.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

newbieForever
Posts: 5
Joined: 2018/02/26 11:41:26

Re: Figure out IP address of external device

Post by newbieForever » 2018/02/27 07:26:48

Thank you all for your help, it really is much appreciated!

I used tcpdump to get some more information about the traffic on eth1. Here's the verbose output with -e option:

Code: Select all

19:43:23.021080 68:05:ca:26:b7:6f (oui Unknown) > Broadcast, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
    0.0.0.0.bootpc > broadcast.cern.ch.bootps: [udp sum ok] BOOTP/DHCP, Request from 68:05:ca:26:b7:6f (oui Unknown), length 300, xid 0x2a78a956, secs 40, Flags [none] (0x0000)
	  Client-Ethernet-Address 68:05:ca:26:b7:6f (oui Unknown)
	  Vendor-rfc1048 Extensions
	    Magic Cookie 0x63825363
	    DHCP-Message Option 53, length 1: Discover
	    Hostname Option 12, length 29: "cmsuptkhsetup1.dyndns.cern.ch"
	    Parameter-Request Option 55, length 17: 
	      Subnet-Mask, BR, Time-Zone, Classless-Static-Route
	      Domain-Name, Domain-Name-Server, Hostname, YD
	      YS, NTP, MTU, Option 119
	      Default-Gateway, Classless-Static-Route, Classless-Static-Route-Microsoft, Static-Route
	      NTP
I'm a bit puzzled by this output. The only MAC address that I see is my own. I guess what I need to try next is to turn off DHCP. How can I do that for eth1 only? Or how can I do that in general, on a CentOS?

tunk
Posts: 355
Joined: 2017/02/22 15:08:17

Re: Figure out IP address of external device

Post by tunk » 2018/02/27 12:19:29

That could be your eth1 port trying to contact a DHCP server (and not your device).
If you're using Network Manager, use it to check your eth1 settings (I don't use it, so I could be wrong).
If not, look at (or edit) /etc/sysconfig/network-scripts/eth1.
Edit: Are you sure it's a network port? It could be a serial port that needs a DB9 adapter.

newbieForever
Posts: 5
Joined: 2018/02/26 11:41:26

Re: Figure out IP address of external device

Post by newbieForever » 2018/03/02 08:04:00

Okay, it turns out that the external device was not set up correctly. Not sure what exactly the problem was, but connecting to it via USB and walking through a guide to factory reset it, solved all my problems. Thank you all for your help!

Post Reply