I have a box ("monitor") intended to monitor whether a captive portal server is working. One interface (eth1) is statically IP'ed as the management interface, so I can check the box, see if the captive portal is up (web page hosted on "monitor"), SSH in, etc. and is the default route. The other interface is on a subnet as a client of the static portal.
Code:
+----------+
| monitor |---eth1---> management LAN/default route
| |---eth0---> captive portal LAN
+----------+
If you're not familiar with captive portals, the client (in this case "monitor") gets DHCP from the captive portal server. Then, the captive portal responds to a HTTP request for *any address* with a Location: redirect to its' own address and serves up a login page. Once the client logs in, IP traffic is passed to the actual destination IP.
The problem I'm having is, obviously, when I try to test this, HTTP traffic is routed out eth1, the default route, not eth0 which goes to the captive portal server. I've tried specifying --bind-address with wget and curl, but that simply sets the source IP while still following the kernel's routing tables.
Is there any easy way to bypass routing and specify the interface a packet is supposed to leave? Failing that, how low-level would my programming have to be to get this to work?
(It's not totally important to the discussion, but eth0 is actually a set of five q-tagged interfaces to monitor five captive portal servers.)
Thanks for any help.
-Jason