# Starting linux with TCP/IP in listen only mode?

**URL:** <https://boards.straightdope.com/t/starting-linux-with-tcp-ip-in-listen-only-mode/397997>\
**Category:** Factual Questions\
**Created:** [March 29, 2007, 4:52pm UTC](https://boards.straightdope.com/t/starting-linux-with-tcp-ip-in-listen-only-mode/397997 "2007-03-29T16:52:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)\
**Post date:** [March 29, 2007, 4:52pm UTC](https://boards.straightdope.com/t/starting-linux-with-tcp-ip-in-listen-only-mode/397997/1 "2007-03-29T16:52:42Z")

</div>

I am trying to emulate how a particular device works. What I need to do is have a linux box start up without a TCP/IP address, but still be able to listen on the ethernet network. A UDP broadcast message is transmitted on the network, which the linux box needs to be able to receive. One of the things in this UDP packet is the TCP/IP address that the linux box should use, so once I receive this packet I can reconfigure the ethernet interfaces to use that address. But, I need to be able to receive the packet before I do anything.

I can’t just start up with a default TCP/IP address, because I will possibly end up conflicting with a TCP/IP address already existing on the network.

Any ideas?

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [March 29, 2007, 4:58pm UTC](https://boards.straightdope.com/t/starting-linux-with-tcp-ip-in-listen-only-mode/397997/2 "2007-03-29T16:58:49Z")

</div>

Hmm. UDP also runs over IP, so I don’t know if it’s even possible to receive a UDP packet, even in broadcast mode, without an actual IP address.

You could try putting the ethernet interface in [promiscuous mode](http://www.felipecruz.com/blog_ethernet-promiscuous-mode-linux.php) without configuring an IP and see what happens, though.

---

<div class="post-metadata">

**Author:** ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)\
**Post date:** [March 29, 2007, 6:55pm UTC](https://boards.straightdope.com/t/starting-linux-with-tcp-ip-in-listen-only-mode/397997/3 "2007-03-29T18:55:02Z")

</div>

Maybe look at how DHCPC (DHCP Client) works. It manages to listen on the ethernet prior to an address being allocated. Of course, they are different sorts of packets, but still.

This code may be more helpful [BootP Client and Server](http://mbootp.sourceforge.net/) since it also uses unaddressed UDP packets, and may be a bit simpler.

What sort of device are you emulating? It sounds pretty odd - it’s not like DHCP for IP allocation is recent.

Si

---

<div class="post-metadata">

**Author:** ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)\
**Post date:** [March 29, 2007, 7:01pm UTC](https://boards.straightdope.com/t/starting-linux-with-tcp-ip-in-listen-only-mode/397997/4 "2007-03-29T19:01:05Z")

</div>

I think I have it working.

It didn’t work without giving it an IP address, but on a whim I gave eth0 the loopback address and put it in promiscuous mode (ifconfig eth0 127.0.0.1 promisc) and it seems to work. Thanks for the push in the right direction.

The device I am emulating is a proprietary industrial controller running its own proprietary operating system. DHCP and BOOTP aren’t an option at this point.
