LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Apache over crossover cable? (https://www.linuxquestions.org/questions/linux-networking-3/apache-over-crossover-cable-600005/)

pdgardin 11-15-2007 10:27 PM

Apache over crossover cable?
 
Hi,

I am getting a bit frusterated with the following issue, and I'm hoping someone might have a few tips to get me going.

In a nutshell, I want to have Apache on my linux computer be able to serve pages through a crossover cable to my winXP computer. Besides the crossover connection, both computers are wirelessly connected to a router (And I'd prefer to leave it that way and not share their net connection for various reasons).

I have apache installed and working fine, but I can't ever access it from my winXP computer. My router won't let me ping the IP address of the wireless connection on the linux machine from the XP machine. I'd like it if I could just be able to get pages served from Apache through the crossover cable regardless of anything else and without breaking my wireless connections.

Right now I have Ubuntu 7.04 running, but I'm willing to change if something else would make it easier, doesn't really matter to me.

Here is a crude ASCII diagram if my explanation wasn't clear:

Code:

----{Internet}
---------|
-[Wireless - Router]
-|-----------------|
[XP]<--crossover->[Linux]
----Apache port80

Thanks in advance,
-pdgardin

MS3FGX 11-16-2007 12:50 AM

You didn't really give all the details on your setup, so I don't know for sure how you have it working; but since both machines connect wirelessly to the router and also have the physical NICs connected, the wireless and wired networks should really be separate subnets.

So if the wireless network has IPs in the 192.168.1.x range, then make the two wired NICs have IPs like 192.168.2.1 and 192.168.2.2. Then you can bind Apache to the 192.168.2.x interface only, so it won't serve pages over the wireless interface.

When the XP machine wants to connect to the Apache server directly, it won't be using the wireless interface because the IP you are giving it isn't even on the wireless network. This would allow you to force all of the HTTP traffic over the cross-over cable, and not involve the wireless network at all.

pdgardin 11-16-2007 09:27 AM

hm... I believe I was trying something similar, although maybe not exactly this.

The wireless router is 192.168.0.1 and assigns IPs in the form 192.168.0.X. I assigned the two physical NICs IPs in the form 192.168.1.X and assigned both the wired and wireless Subnet masks of 255.255.255.0

This didn't really seem to be working but I'll try again, I may have been doing something a bit different - Ill check when I get home.

I guess then my other question though is, if I use a Web browser (or Ping or whatever) to try and talk to an address on the wired network (in the form 192.168.1.x), will the OS always automatically know which network interface to use? (i.e. what prevents it from trying to dial 192.168.1.x addresses over the wireless or trying to dial external internet addresses over the wired crossover cable?)

Otherwise, thanks again, I'll look into the setup of the subnets more when I get home.

-pdgardin

jschiwal 11-16-2007 09:45 AM

On the Linux machine, check the output of /sbin/route. You may not have the routes setup.

MS3FGX 11-16-2007 11:03 AM

Quote:

I guess then my other question though is, if I use a Web browser (or Ping or whatever) to try and talk to an address on the wired network (in the form 192.168.1.x), will the OS always automatically know which network interface to use? (i.e. what prevents it from trying to dial 192.168.1.x addresses over the wireless or trying to dial external internet addresses over the wired crossover cable?)
This is where the concept of default routes come into play, as jschiwal suggested.

Basically, the operating system has a list of default routers that it uses to link itself to other networks. If the machine can't contact a host on it's immediate network, it will by default send it to the default router that has been configured with the assumption that the router will know what to do with it.

With multiple interfaces and network configurations, each interface can have it's own default router to use, which helps shape traffic to where it needs to go. There are more advanced things you can do with routes, but that is the basic concept.

pdgardin 11-17-2007 12:22 AM

It works! Just needed a bit of messing with the routing settings in winXP and Linux. Thanks very much for your time, MS3FGX and jschiwal.

-pdgardin


All times are GMT -5. The time now is 07:51 PM.