LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Public Windows, Private Linux (http://www.linuxquestions.org/questions/linux-networking-3/public-windows-private-linux-91551/)

c0rrupt0 09-11-2003 03:45 AM

LAN w/Public Windows, Private Linux
 
Ok. first I must apologize if this is a repeat question. I spent about 20 minutes digging through this forum tryign to find an answer but did not.

This is how I would like for my network set up.
The Idea:
I have Comcast cable Internet. Cable modem runs to uplink on HUB. From HUB I have two machines. One is XP and one is slack9. The linux machine is for test development. My windows machine is the machine I use to access the internet. Now I want the linux machien to be on a private network accessible only by my XP machine. the XP machine gets it's IP via DHCP and works fine.

The Problem:
I cannot reach my linux machine from the XP machine. I ran netconfig and put in this settings
IP - 192.168.1.44
Netmask - 255.255.255.0
Gateway - 192.168.1.1
Nameserver - <empty>
Now I think my problem is with the gateway but as I am not a *NIX networking guru this one truely has me stumped.

It is very important that I get this setup working asap so I hope some of you can help.

p.s. all hardware works fine as I tested the network with only the linux machine useing DHCP and was able to reach the internet

Looking_Lost 09-11-2003 03:57 AM

Just to clarify, is it an actual hub your are using or a home router/switch ? Both machines are directly connected to this hub with only one card each in them?

The only IP on the XP is the IP you get from your ISP dhcp and on linux the only ip is the private 192.168.x.x. you set?

c0rrupt0 09-11-2003 04:01 AM

yes that is correct. 1 physical HUB with uplink from cable modem and port 1 goes to XP and port 2 goes to the linux machine

Looking_Lost 09-11-2003 04:19 AM

Problem I can see it then is you're XP will have a proper public IP address.

Linux will have a private IP address.

Normally in a hub if both of them are in the same subnet it won't matter, in this case (if I'm reading it right) linux will try to reach you're XP, seeing as XP is on a different network it won't be able to to reach it whether you had a gateway set or not.


If you try and contact the linux from windows it'll see that the ip is on a different network, it'll then forward it out it's gateway, the one assigned automatically by your ISP which will then promptly ignore it as it's a private ip.

If the linux machine was the one with the ip from your ISP you could
set the windows one as 192.168.0.1 and create a virtual interface on the linux one of 192.168..0.2 and it should be able to get to it. I don't know if you can or if you can how to set up two ips on one card in windows.

c0rrupt0 09-11-2003 04:31 AM

right now I am setting up the linux machine to be a gateway for the private network. I can get the windows machine to be apart of that network as well part of my ISP's network.

I have my toes crossed as I am doing this so I hope it works.

Eqwatz 09-11-2003 12:06 PM

If your hub is a router, then the router is the only address visible on the web. The router then uses NAT (Network Address Translation) to run the packets to/from the web.

So, the bottom line is that you need to give more info.

If the hub is a router _it-is-the-Default-Gateway_ for both machines.

192.168.(not 1 OR 0 OR 255 and the same number has to be used unless you have another router!!!!!!!).(NOT 0 OR 255, 1 is either unused or is the host for the network, 254 is generally used as a host/gateway/printserver)

Read your docs on your router. It should have an address. Mine is a SMC Barricade. The default gateway address is 192.168.123.254 (It also is the address for the printserver.)

So, in my case, the private network is 192.168.123.2-253. A second subnet would have to be set up with its own host and a different subnet number. Ex. 192.168.124.xxx.

You didn't really search this site--did you.

Eqwatz 09-11-2003 12:31 PM

The confusion is caused by the word HUB.

BYTW. Are we talking ethernet? Because then you have either a switch--which does no NAT or anything, or a router which does all of those things. USB is a different animal--so is a switch. Set up is different, and how it is done is different.


You can run a second private network, but you have to set-up a second nic in the windows box and set it up to host linux. Or vice versa.

But you can't be routing packets through your router for both networks, a second network needs its own host.

If XP is the only one on your primary sub_network (connected to the hub and receiving the address from DHCP), then IT must serve as the Default_Gateway and host for the linux box. That means that the XP box needs the second NIC. The linux box is then connected to the XP using a cross-over cable. The linux box is not (in that situation) connected to the router.

Eqwatz 09-11-2003 12:34 PM

If it is a SWITCH, then you can set up multi-homing on the XP box, and do the assignments of different subnet IP addresses.

Different animal.

[So, the hub was an e-switch eh? On a switch, linux or XP can serve as host/default gateway for the other. There is multi-homing set-up on both O.S.es. This creates a virtual second NIC, which is generally the host for the network. (The physical NIC is initialized first, done the other way networking can get goofy on you.)

Then the set-up is pretty straight forward. The IP Address of the cable modem would be the default gateway for the local host. (Just plug them in. (as the only things plugged into the switch) until you configure the virtual NIC and it is given a MAC address. Assign it a different subnet address. If the cable modem has a subnet of 192.168.100.xxx, then the private network would be a different number--say 192.168.101.xxx. The IP address for this "virtual NIC" can be any number between 1-254 but it is easier to identify if is either 1 or 254. 1 is the safest.

Set up the network on the virtual NIC as you would a real one. This virtual NIC's IP address is the host/default_gateway for your private network. There is no need for a second physical connection. With a private subnet domain different from the domain of the modem, the whole thing can auto-magically use dhcp--XP has that built in if you use it as host, it has to be configured in linux.

OOPS you have to assign the others to be members of the 192,168.101.xxx domain/private-net{In the Hosts file. The domains are identified-with the cable modem being a static address.}. Domain entries have the zero--192.168.101.0. The home or host generally has the 1--192.168.101.1. You know like the 120.0.0.1 entry as Localhost Local Domain. That is why 1 is usually used as host. It is easier to remember, and the other programs may use that number in their scripts.

Then you can plug into your switch anything that uses an IP Address and it will just work--because you now have a router. Cool. ]

c0rrupt0 09-11-2003 11:48 PM

all I have to work with is stated above. I got it to work and this is how.
I foudn otu that the cablemodem acts as a gateway as well. It also has a USB port for USB connection to my machine. So I have that setup on my XP machine to get the IP via DHCP over the USB cable. Then I also have the cat5 running from the NIC interface from the cable modem, the XP machine, and the linux machine, to the HUB. (and yes it is a hub. a pos 6port KIT networks hub.) the NIC interface is assigned the private IP on the same network as the private network that the cable defaults to. If it is possible to change it I do not know how but it is set for 192.168.100.1(which was the IP I had to go to in the browser to get diagnostics for the Cable modem. If there is another way to do this with the equipment I have available, i do not know it either. But I do know that this works perfectly.

Thank you all to those you tried to help.


And yes I did search this site. I would have said otherwise if I didn't. So thank you for wasting your time in that meaningless post.


All times are GMT -5. The time now is 01:40 PM.