LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2006, 09:19 AM   #1
donang72
LQ Newbie
 
Registered: Nov 2006
Posts: 6

Rep: Reputation: 0
Noobie in need of a lot of help


I am new to linux, and when i say new i mean new. I just installed fedora 6 onto a pc, i've been trying read all i can and learning my way around linux. I've been searching the net, forums, articles etc but i cant find a clear cut step by step guide that i can understand.

Here's what i am trying to do


i am wanting to run my xp box through my linux box.
my current set up :

cable modem to router...router to linux box......linux box to xp box via second nc and cross over cable.

at the moment i do have internet access through my main connection on my linux box, but i have the "limited or no connectivity" on my xp box.

when trying to set up i dont know if my NC connected to my router should be set using DHCP or static ip and the same goes for my second NC.

do i need to try using another app like samba or something?


I am clueless here and at about my wits end with it.
Any help at all will be much appreciated.
 
Old 11-14-2006, 09:43 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,213

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
You need to set up Network sharing on your linux system.

To answer some of your questions, DHCP is fine on your linux NIC, if it is getting a IP, it must be since it is working, leave it alone for now. On the XP machine, it needs to be able to 'see' the DHCP server when it doesn't have an IP address, or it will not work.

When you set up network sharing, the second NIC on linux define a static address, and do the same on XP. You should then be able to ping between them ( if your cable is good ).

You need samba only if you want to share files and printers between the two machines. Get the ping working first, then we'll go from there.
 
Old 11-14-2006, 09:46 AM   #3
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
On your words that internet is working at your linux box;
1. Put an ip to linux-box's NC(connected to win box) <-.-.-> & another ip from the same class to win-box.
2. Put linux-box'NC(win-connected)-ip as the gateway at windows box.
3. Checkout your /etc/resolv.conf & then note down & mention the nameserver ip from this box over to your windows box.
4. echo 1 >> /proc/sys/net/ipv4/ip_forward //to be run at linux box
5. At linux box;
run iptables -t nat -A POSTROUTING -o <interface-name-attached-to-router) -j MASQUERADE

Thts it !!!
 
Old 11-14-2006, 07:53 PM   #4
sfarber53
LQ Newbie
 
Registered: Dec 2003
Location: Blacklick, OH
Distribution: CentOS 4.x; also OS X.4
Posts: 17

Rep: Reputation: 0
More to the point might be to buy and inexpensive hub or switch then everything will gateway through the router
 
Old 11-17-2006, 04:49 PM   #5
donang72
LQ Newbie
 
Registered: Nov 2006
Posts: 6

Original Poster
Rep: Reputation: 0
thanks for the reply guys...im still having a lot trouble.

on my second nc card (with windows box connected to it) i tried using dhcp to automatically assign ip address, but i was getting an unable to determine ip address error

So then i looked at doing it statically, but how do i go about assigning it an IP address manually? Also, do i want to assign it the same gateway as NC 0 ? I know that in the windows box, i have to assign the eth1 card as the default gateway.

Also where do i find the subnet mask to assign?


Sorry if these questions seem stupid, but i'm still trying to learn all this. Thanks for the help

Last edited by donang72; 11-17-2006 at 04:51 PM.
 
Old 11-17-2006, 06:14 PM   #6
donang72
LQ Newbie
 
Registered: Nov 2006
Posts: 6

Original Poster
Rep: Reputation: 0
ok...here's what i've done.

on my second network card that is connected to windbox, i assigned it the same ip address as first network card, set default gateway the same as nc 1, i did not assign a subnet mask, as i did not find one.

on win box, i assigned the default gateway as the ip address of nc 2 on linux box.a


tried to ping windows box with no success. am i way off base here or am i getting somewhat close?

thanks in advanced
 
Old 11-17-2006, 07:10 PM   #7
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,213

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
Let me see if I can get you going in the right direction.

IP addresses. Every nic needs its own, do not try and use the same IP twice, it just won't work. If they are on the same physical net, then second nic to try and activate, will fail, duplicate IP addresses are not allowed.

O.K. usually you can use private IP addresses for home lans. Private IP addresses can not be routed to the public internet. There is a function call NAT ( Network Address Translation ) that looks after this. If you send a packet to the router, it translates the IP address from your machine to a IP address that can be routed. In fact, it will be the IP address assigned by your ISP. When a packet is received, it replaces the internet IP address to the one your machine is using. The NAT function can do this for several machines and sort out all the data. Basically, you do nothing, don't even give it another thought.

Class A private IP address are 10.0.0.0 , You don't use the '0''s these fields can be anything from 1 to 255 in dotted decimal notation. The mask is used for sub-netting. The mask defines what part of the address field is sub-net, and what part is 'host' ( computer ). A mask of 255.255.0.0 would cause any router to have up to 255 sub-nets and 255x255 hosts. The longer the mask, the more sub-nets you get, and the fewer hosts.

Class C private IP addresses are 192.168.x.0, and the mask of 255.255.255.0 would allow 255 sub-nets and 255 hosts ( per sub-net ).

Your configuration is small. To get it to work, the connection between the XP machine and linux box, both NICs need an IP in the same sub-net, for example, make the NIC on linux ( connecting to XP ) 192.168.1.1 and make the XP machine 192.168.1.2 and the mask of 255.255.255.0.
If the cable is good, and you set those addresses, bring up both machines, you should be able to ping the other ( in both directions ).

Now the linux NIC connecting to your router, you can keep the IP addresses you have, as long as the sub-net is different than the one between XP and linux. Your linux box has to be set up as a router, to route packets from XP to the router, and onto the internet. Example, if your routers NIC is 192.168.0.1, and the linux NIC is 192.168.0.2 and the mask is 255.255.255.0 things will work, once linux is set up to route.

I have never set up internet sharing, although lots of people have. Some distros have gui tools to do the job ( Mandriva does ).

By far the easy way to get things going, is to plug XP and linux into the same router, make all three NICs belong to the same sub-net. Example 192.168.0.1 ( router ) 192.168.0.2 ( linux ) 192.168.0.3 ( XP ) sub-net 255.255.255.0. Set the default route to the router's IP 192.168.0.1. Most routers today will pass DNS information to the hosts that are connected. If yours does that, no need to find out those addresses, and define them once per machine.

Hope this helps you understand a little about what IP addresses to pick, and what mask to use.
 
Old 11-17-2006, 07:32 PM   #8
donang72
LQ Newbie
 
Registered: Nov 2006
Posts: 6

Original Poster
Rep: Reputation: 0
thanks so much for your time on this. It does make things a little simpler to understand. i will let you know how turns out.

Thanks again!
 
Old 11-17-2006, 08:02 PM   #9
donang72
LQ Newbie
 
Registered: Nov 2006
Posts: 6

Original Poster
Rep: Reputation: 0
ok...one more question..........on my xp box, what do i set the default gateway to? and what do i set the gateway to on my second linux card that is connected to xp box?
 
Old 11-18-2006, 12:16 AM   #10
donang72
LQ Newbie
 
Registered: Nov 2006
Posts: 6

Original Poster
Rep: Reputation: 0
i got my win box to ping my eth1 card and vice versa, now if anyone cann help me with routing it, i think i will have it...........i tried :

. Put an ip to linux-box's NC(connected to win box) <-.-.-> & another ip from the same class to win-box.
2. Put linux-box'NC(win-connected)-ip as the gateway at windows box.
3. Checkout your /etc/resolv.conf & then note down & mention the nameserver ip from this box over to your windows box.
4. echo 1 >> /proc/sys/net/ipv4/ip_forward //to be run at linux box
5. At linux box;
run iptables -t nat -A POSTROUTING -o <interface-name-attached-to-router) -j MASQUERADE


as stated above but obviously did not do something right.

Checkout your /etc/resolv.conf & then note down & mention the nameserver ip from this box over to your windows box. i checked out the file and all it give me was 3 different "name server" with 3 different addresses on it.

run iptables -t nat -A POSTROUTING -o <interface-name-attached-to-router) -j MASQUERADE
how to i locate or know this name. i used eth0 here, i was not given any errors, but i still cannot connect to the internet on my win box
 
Old 11-18-2006, 04:41 AM   #11
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,213

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
I see you have made some progress. I found an article in the Tutorials. It describes how to set up a linux machine as a router. Have a look, I hope it helps you out some more.

http://www.linuxquestions.org/linux/...g/Linux_Router
 
Old 06-17-2007, 04:57 PM   #12
UhhMaybe
Member
 
Registered: Jul 2004
Location: Salt Lake City, Utah
Distribution: Absolute 12.0 Studio 64 1.3.0
Posts: 470

Rep: Reputation: 30
Cool

After reading and understanding the articles of YOUR interest, try here in the forums we share together. Please limit posts to single topic, no multiple posts of the same topic. Try http://www.wiki.com for stories about the small hurdles in YOUR project/system. Try http://www.tldp.org/HOWTO/HOWTO-INDEX/howtos.html for the big hurdles. Try http://www.howtoforge.com for more Linux tutorials. Try http://www.distrowatch.com for the details on the different flavors of Linux Distro's. Try http://www.google.com for the general search that could provide more pieces of that elusive puzzle. Good luck. Please include YOUR Distro name.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Very New Noobie here. Cool_Hand_Luke Linux - Newbie 9 02-26-2005 03:08 PM
Help im a noobie GNUROCKS Linux - Wireless Networking 8 01-25-2005 07:47 PM
Now I am actually a Noobie gbrewste LinuxQuestions.org Member Success Stories 8 06-16-2004 03:55 PM
<---Noobie---help! Indica Linux - Newbie 1 02-09-2004 07:02 AM
I'm such a noobie... neoxaero Linux - Newbie 2 02-07-2004 01:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration