Discussion at work, would a router work pluging a cable in wan1 and lan1?

hi all. and sorry for the random question, but this sparkled a raging flame-war at work and i want more points of view

situation

a router, with linux of some sort,
dhcp client requesting for ip in wan1 (as usual with wan ports)
dhcp server listening in lan1, and assigning ip (as usual with lan ports)
a cable connecting wan1 to lan1
a pc in lan2 (normal setup) to be able to monitor

would the router assign an ip to himself?

my personal opinion is yes, and not only that, it could be possible to ping from pc in lan2 to the wan1 ip

we dont have a spare working hardware to test this

I guess the first question is why in the world would you connect a cable between the WAN and LAN port?

At a guess I would say yes, the DHCP Daemon would certainly respond to DHCP Discover requests coming from the LAN interface. The easiest thing to do would be spin up a virtual machine in VirtualBox, bridge together the WAN and LAN interfaces and watch what happens. No better substitute that real world experience :slight_smile:

well. someone sent a picture meant to be funny, a joke, of this setup
and you know how it is. if we were sane, we wouldn't work in infrastructure

We know linux can handle this. we already established that a pc with more than 1 physical ethernet card can do this

the discussion right now, centers around possible hardware differences in routers

my position is that this works. no idea why would someone would do it other than as a research or as a theorical experiment to explore/test knowledge of networking

as i said. we are not completely sane, but at least we have "fun"

Whether it would work or not, the problem is kind of self-limiting. If it answered its own DHCP request, the external interface would put its external IP on the same subnet as its internal network, leaving it unable to route any requests.

Proof of concept:

...but 192.168.1.100 could not be pinged from the LAN side, neither by cable nor by wireless.

So yes, a router can answer its own DHCP request :slight_smile: But it will not be able to route between two identical subnets.

Of course, this may be implementation-dependent. There could be some trigger-happy switches out there.

but, would routing be needed?
since they are in the same network. im inclined to believe the package would "find" its destination

I just tested with a cable, too, and it didn't work. 192.168.1.101 on the same switch as 192.168.1.100 couldn't ping 192.168.1.100. It may just not be capable of that kind of doublethink.

You know... I wonder if it'd work if I forced the mac address... Assembling it again. *sigh*

All right -- so 192.168.1.100 doesn't answer ping. But it does appear in the ARP table! Correctly even, a different MAC than the internal interface.

So the traffic is getting switched -- but some smart engineer put in a check for dummies wiring router to itself. The router is wagging its finger at me going "tut tut tut, can't do that" and doing the right thing, dropping silly requests.

Obviously implementation-dependent. I'll try a d-link i I can dig one up...

The d-link appears unwilling or unable to assign an IP address to itself. It's a d-link however, which I wouldn't put past being unable to autonegotiate with its own ports. :mad:

crap. i lost a bet
damm dlink, it probably has 1 ethernet and several virtual interfaces

thanks for your help, greatly apreciated