SOLVED How to reconnect to a box with unknown Ethernet config?

Status
Not open for further replies.

toolforger

Explorer
Joined
Aug 8, 2017
Messages
60
Hi all,

I need to recover from a classic networking self-defeat:
- Freenas box and my Linux laptop were connected with a direct Ethernet cable
- Both sides had a static IP address&network mask
- I recorded the address on the Linux side, but for some reason it's not working. (Do I have to set any specific options in Network Manager to make a direct connection work?)
- Normally I'd just hook up a keyboard and monitor, but the only video output is VGA, and - surprise! - I have no VGA monitor available.

Pretty proficient with bash and ssh, but my network lore is pretty rusty - I know what arp etc. are but am not too familiar with them.

Any pointers appreciated!

ANSWER:
The best option seems to be packet sniffing while the box comes up, just record incoming packets and see what IP address they come from.
This is not going to be helpful if the network configuration is broken for some reason. For me, it was because I had installed Freenas using a VM (because no monitor for the real hardware), and the VM driver was different than the driver for the real hardware so the network interface name was different and the network config wouldn't work. Lesson to take home: You cannot install Freenas on a headless box, keyboard and monitor are REQUIRED. (And there's general aversion to do anything about this, with the usual arguments: Too much work for a corner case, there's already feature creep. I.e. this won't change quickly.)
 
Last edited:

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
- Both sides had a static IP address&network mask

If it was working before and it isn't anymore something has changed on your network configuration, otherwise you wouldn't be having problems. Other than connect a monitor (that you can't now) to check and change the network configuration, the only other thing I'd try would be connect to a router of some sort to see if it will get an IP from DHCP.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Not all routers do, but my router will list all the devices on the network, even if they were statistic address.

Sent from my SAMSUNG-SGH-I537 using Tapatalk
 

toolforger

Explorer
Joined
Aug 8, 2017
Messages
60
@melloa I know it's configured for a static IP, so it won't get an IP from DHCP. That's exactly the problem I'm having: I forgot to reconfigure from static to DHCP before putting the box into the new network.

@Chris Moore my router doesn't, probably because Freenas is on a different subnet than what the router was configured for.
I tried using a direct port-to-port connection between Laptop and Freenas, which *should* have worked because that's how the machines were connected before, but it didn't work so I guess I didn't faithfully restore the laptop config.
So the question now is: How do I discover the static configuration in the Freenas box, given just an Ethernet cable and a Laptop?
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
If you sort of remember the network address, but you don't remember the specific node (last set of digits in the IP address), then you could set up your laptop to connect to its network and then try using PING to determine the node number by pinging all the possible addresses - trial and error. It might be a little tedious to do this, but not impossible.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
If you sort of remember the network address, but you don't remember the specific node (last set of digits in the IP address), then you could set up your laptop to connect to its network and then try using PING to determine the node number by pinging all the possible addresses - trial and error. It might be a little tedious to do this, but not impossible.
There are software packages that will do that automatically.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Chris Moore said:
There are software packages that will do that automatically.
Like nmap

I couldn't see where you confirmed that it has ever worked with that setup... makes me wonder if you're using a crossover cable or a straight one... if you're just using a normal/straight ethernet cable between two computers, you are connecting the send to send and receive to receive at each end, so will not work. A switch handles this automatically and swaps them over if needed, but regular NICs don't as far as I know. if you connect the boxes to the same switch, you should be able to find each other regardless of other things going on on that switch (unless you've done something with VLANs, but you should know that if you did it).
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Connect your laptop and run a packet sniffer. Look at the source IP or ARP packets.
 

toolforger

Explorer
Joined
Aug 8, 2017
Messages
60
Yes, it did work. Direct connection from laptop to Freenas box, standard cable (no crossover). I guess that at least one of the boxes was smart enough in its network hardware to do the crossover - I heard in other threads that it would usually work.

nmap and ping don't seem to work, I'm not getting any responses from Freenas even if I set up the same subnet as the one that I recorded as "that's my Freenas ipv4 config".
Though I'm not sure how a direct-connection network should be configured - IP address and netmask are straightforward (same 255.255.255.0 netmask, same upper three bytes, different lower byte), but what gateway should I use on the Linux side?
I did enter a the Freenas box as the gateway but route wouldn't tell me any route. Which may be either because there's no real route behind Freenas (it's just a two-computer network anyway), or because it's really not communicating - I don't know enough to interpret the result. (A situation that has been coming up far too often in my current situation, I must say.)
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Like nmap

I couldn't see where you confirmed that it has ever worked with that setup... makes me wonder if you're using a crossover cable or a straight one... if you're just using a normal/straight ethernet cable between two computers, you are connecting the send to send and receive to receive at each end, so will not work. A switch handles this automatically and swaps them over if needed, but regular NICs don't as far as I know. if you connect the boxes to the same switch, you should be able to find each other regardless of other things going on on that switch (unless you've done something with VLANs, but you should know that if you did it).

Pretty certain all gigabit ports are auto cross-over.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Just run a packet sniffer in promiscuous mode. I have been done this path many times. If SMB is enabled, its chatty enough to let you know its there.
EDIT: otherwise you could do an APCI shutdown (just press the power button once) and power back on while sniffing. I'm sure it will at lease do an ARP announcement.
 

toolforger

Explorer
Joined
Aug 8, 2017
Messages
60
Does Freenas send its static configuration during boot?
Because I don't see any reason why it should. It has a static network configuration, I'd expect it to simply use that without further ado.
I tried nmap and it came up empty (100% packet loss). I suspect it's useless because there's no route (route sure comes up empty, and that's my problem: the machines don't connect and I need to find out how to make them connect).

Let me sum up my current knowledge; please correct me where I'm wrong, or add new ideas to fill gaps.

- arp -a. I know it will give me MAC addresses (I have tried that earlier). I do not expect it to give me the netmask, or what I need to put into the ipv4 "gateway" setting.
- Run tcpdump (or Wireshark) and see what happens while the Freenas box boots. Since the Freenas box does not run a DHCP client I do not expect that to give me much, unless there are other things than DHCP that talk about ipv4 settings over the wire.
- nmap. Useless if it assumes an existing connection.

Is there really no tool that just inspects the local network and gives me IP address of every device, regardless of whether it has a connection or not? I'd have expected network discovery to be one of the basic tools in the network administrator's standard toolbox.
tcpdump is living at a pretty low abstraction level, i.e. I'll likely drown in technical detail, which is doable but will require a lot of time, and I won't know when to stop because I cannot distinguish between "this approach does not lead anywhere" and "I haven't looked at the right data packets yet".
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Pretty certain all gigabit ports are auto cross-over.
Probably all the modern ones, but I remember having to make crosover cables back in the late 90s and early 2000s because they didn't do it then.
I remember getting the first switch that would auto negotiate that and thinking how nice it was going to be, not needing crosover cables.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Does Freenas send its static configuration during boot?
If it sends ANYTHNIG over TCP/IP it will be broadcasting its address. You know, like checking for updates, SMB announcements, general ARP announcements... This is how TCP/IP works.
EDIT: I know ARP is not IP but still, you get the idea.
if you can get the MAC, you can use address resolution protocol (ARP) to get the IP.
EDIT: Assuming that FreeNAS responds to ARP and it should!
unless there are other things than DHCP that talk about ipv4 settings over the wire.
No need. If its talking on the network, it is broadcasting its IP as the return address if not over APR.
Is there really no tool that just inspects the local network and gives me IP address of every device, regardless of whether it has a connection or not?
Think about it. If you call someone from a phone (phone number is the MAC address) and you don't say anything when the other person answers, will they know your name? (your name is the IP address). If they know the number is yours (because you told them either during the call or beforehand) then they might assume its you.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Does Freenas send its static configuration during boot?
Not that it broadcasts something. The idea was that if you had a sniffer on the line when the system booted, it might catch the ARP request that FreeNAS probably sends out asking for information on what else is out there. FreeNAS is wants to know what else is out there by default, but we don't really know what all changes you may have made.
Speaking of which, we don't know what hardware you are using either. Please post the full rundown according to the forum rules:

Updated Forum Rules 4/11/17
https://forums.freenas.org/index.php?threads/updated-forum-rules-4-11-17.45124/

I tried nmap and it came up empty (100% packet loss). I suspect it's useless because there's no route (route sure comes up empty, and that's my problem: the machines don't connect and I need to find out how to make them connect).
If they are on different subnets, there will be no way for them to talk without a router to translate the data between the two 'networks'. I know it may sound counter intuitive that if the two devices are directly connected to each other on a single wire, but if they are on different subnets, the way IP networking is designed to work, they will ignore each other even if they are on the same physical wire. Same with vlan separation. You must get a system on the same subnet with the FreeNAS system or have a router that will translate the package from one network to the other.
The 'easy' way to find the FreeNAS is to plug a monitor into it.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
tcpdump/wireshark are definitely a part of the "standard tool box";)
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Probably all the modern ones, but I remember having to make crosover cables back in the late 90s and early 2000s because they didn't do it then.
I remember getting the first switch that would auto negotiate that and thinking how nice it was going to be, not needing crosover cables.

Were they gigabit ports tho?

...

Did a little bit more research. Auto-MDI-X was specified as part of the 1000baseT standard (which uses all 4 pairs), but it is an optional part.

https://en.wikipedia.org/wiki/Medium-dependent_interface#Auto_MDI-X
 
Last edited:

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Were they gigabit ports tho?
Now that I think about it, I was dealing with 10/100 back then. It was when we went to 1gig that we started getting the devices advertised as being able to do auto crossover.
 

toolforger

Explorer
Joined
Aug 8, 2017
Messages
60
It's one of those Proliant gen8 microservers.
I don't have more details readily available, but the hardward is bog-standard, the only thing I did with it was adding two HDDs and an USB stick for booting.

Oh. Right. I could pull out the stick, plug it into Linux, and check the configuration.
I should have thought about that that option earlier.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Oh. Right. I could pull out the stick, plug it into Linux, and check the configuration.
I should have thought about that that option earlier.
That may not work because all the configuration information is stored in the config.db and many of the files you might look in will be unconfigured. Also, it is ZFS, but that is not too bad because you can make a Linux system mount ZFS by installing OpenZFS on it.
Those things have a "HP iLO Management" port on them for their HP proprietary remote management interface. Have you used that at all? It should default to getting an address from DHCP. Then you can remote into the iLO and I believe it gives you a KVM over IP function.
 
Status
Not open for further replies.
Top