Yes, you can do this - I believe I have come up with quite a creative solution to your problem. In general terms (I can't be specific because you have not provided details of your OS etc) -
Ensure that the Netmask on the wifi router is bigger then on the Ethernet Interface, and use "smaller routes" to route across the LAN. For example
- Set the LAN interface on your router to 192.168.254.254 with a netmask of 255.255.0.0
- Ensure your WIFI router is issuing DHCP addresses in the range 192.168.254.0-192.168.254.127
- Leave the WAN Interface on DHCP (or hard code it to 192.168.254.129 with a gateway
of 192.168.254.254 and a netmask of 255.255.0.0)
- Statically assign 192.168.1.1 with a netmask of 255.255.255.0 to the ethernet interface
on your laptop.
- If your desktop at home is permanently wired, statically assign its IP address to
192.168.254.253 netmask 255.255.0.0. ( If it has a WIFI and ethernet port like the
laptop, and you normally use WIFI, set it up the same way as the laptop, except
statically assign 192.168.1.2 on the ethernet Interface )
This should work as follows:
When the laptop sends a packet out the network stack, it will look at the routing table. It will try and match the smallest netblock first, so it will send packets for the desktop
interface out the ethernet address.
It will send all other packets out the wireless connection.
Because the netmask is bigger for the wireless connection, both laptop and desktop will be able to see the outside world.
Hopefully when the ethernet cable is not plugged in, the ethernet interface will not be assigned an IP address, so traffic will all be routed out the Wireless interface.