Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-11-2003, 03:45 AM
|
#1
|
LQ Newbie
Registered: Sep 2003
Posts: 10
Rep:
|
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
Last edited by c0rrupt0; 09-11-2003 at 03:50 AM.
|
|
|
09-11-2003, 03:57 AM
|
#2
|
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120
Rep:
|
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?
|
|
|
09-11-2003, 04:01 AM
|
#3
|
LQ Newbie
Registered: Sep 2003
Posts: 10
Original Poster
Rep:
|
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
|
|
|
09-11-2003, 04:19 AM
|
#4
|
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120
Rep:
|
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.
|
|
|
09-11-2003, 04:31 AM
|
#5
|
LQ Newbie
Registered: Sep 2003
Posts: 10
Original Poster
Rep:
|
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.
|
|
|
09-11-2003, 12:06 PM
|
#6
|
Member
Registered: May 2003
Distribution: Slack Puppy Debian DSL--at the moment.
Posts: 341
Rep:
|
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.
|
|
|
09-11-2003, 12:31 PM
|
#7
|
Member
Registered: May 2003
Distribution: Slack Puppy Debian DSL--at the moment.
Posts: 341
Rep:
|
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.
|
|
|
09-11-2003, 12:34 PM
|
#8
|
Member
Registered: May 2003
Distribution: Slack Puppy Debian DSL--at the moment.
Posts: 341
Rep:
|
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. ]
Last edited by Eqwatz; 09-12-2003 at 11:44 AM.
|
|
|
09-11-2003, 11:48 PM
|
#9
|
LQ Newbie
Registered: Sep 2003
Posts: 10
Original Poster
Rep:
|
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.
Last edited by c0rrupt0; 09-12-2003 at 08:53 AM.
|
|
|
All times are GMT -5. The time now is 07:56 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|