LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-18-2003, 01:40 PM   #1
mikejbrod
LQ Newbie
 
Registered: Aug 2003
Posts: 15

Rep: Reputation: 0
Question Linux as a server to xp????


How do i setup a linux red hat 9 pc to act as a server to windows xp???




Please dumb the info down a shade as I am not to good at using Linux at the mo!


Can anyone give me a step by step to do this?


Thanks very much in advance

Mikejbrod
 
Old 10-18-2003, 01:42 PM   #2
jqcaducifer
Member
 
Registered: Jul 2003
Distribution: Fedora 3
Posts: 133

Rep: Reputation: 15
Can you be more specific? Like a server on a local network, or a server on the internet? And which servers are you specifically looking for? FTP, HTTP, DNS, DHCP, NTP, Samba, SSH, Telnet, etc?
 
Old 10-18-2003, 01:43 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
What type of server do you have in mind, fileserver, webserver, etc? Fileserver, you'd just have to setup and use Samba, etc. www.samba.org

Webserver you can just run apache or the such.

Let us know.
 
Old 10-18-2003, 01:44 PM   #4
mikejbrod
LQ Newbie
 
Registered: Aug 2003
Posts: 15

Original Poster
Rep: Reputation: 0
I would like to use it as a gateway to to net for the xp machine (sorry!)
 
Old 10-18-2003, 03:57 PM   #5
jqcaducifer
Member
 
Registered: Jul 2003
Distribution: Fedora 3
Posts: 133

Rep: Reputation: 15
For a router, (i think same as gateway), you simply have to enable IP Forwarding:
Code:
echo "1" > /proc/sys/net/ipv4/ip_forward
then you have to either set up your DHCP server to point to your linux machine as the gateway, or you have to manually set it up on your windows machine.
And you should also look into iptables, a firewall, to prevent tons of hackers accessing your computer.

Oh ya, you need 2 ethernet connectors on your linux machine, one that directly connects to the cable modem, and uses dhcp, and another that connects to your internal network, which has a manually set IP address and stuff, so that the comp. can forward packets from your internal network outside via cable modem. (i'm assuming you have cable, no clue what to do w/ dialup)
 
Old 10-18-2003, 04:58 PM   #6
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
edit the file /etc/sysctl.conf and change the line that says:

net.ipv4.ip_forward = 0

to

net.ipv4.ip_forward = 1 # 1 turns on ip forwarding


your linux box will of course need 2 NICS, 1 to the XP box and 1 to the internet.
you'll have to give the XP box an ip address that is on the same network as the network card it connects to on the Linux box:

if the Linux box is connected to the XP box on eth1 then do this on the Linux box:

ifconfig eth1 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255

and on the XP box you'll have to go into Control Panel, Network Connections and go to Local Area Connection (right click on the icon and go to properties)
In the properties window, highlight the line that says Internet Protocol (TCP/IP) and click the Properties button located below it.

In there u'll have to set the IP of the XP box to 192.168.1.X where X is any number from 2 - 254 inclusive (DO NOT USE 0, 1 or 255).
Mask: 255 255 255 0
Gateway: 192.168.1.1 (notice the gateway address is the same as eth1 on Linux box)

DNS servers u'll get from your ISP


now you should be able to ping back and forth between the 2 boxes provided you use a CROSSOVER cable.

on the linux box you'll have to setup NATing to use the internet on the XP box. Assuming you have iptables installed and working, the rule to use is:

/sbin/iptables -A POSTROUTING -t nat -i eth1 -o eth0 -j MASQUERADE

if your ISP gives you a static ip address (one that never changes) then you can
cut down on the overhead a little by using SNAT over MASQUERADE, that rule
would look like this:

/sbin/iptables -A POSTROUTING -t nat -i eth1 -o eth0 -j SNAT --to static.ip.address.here

use 1 or the other rule, not both.


you'll have an insecure setup there so you'll want to learn more about iptables to setup a good strong firewall and many learn about DNAT if you want to run servers on the XP box (why on earth would you do that thought, XP isnt a server-stable OS IMHOP).

that is the general setup, you can do a search for many posts that answer this question many different ways also.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
is there a way to make a local linux server the time stamp server for win2k? Lleb_KCir Linux - General 2 09-19-2005 08:05 PM
Ms Win2000 Server & Linux NIS Server ON the same network. tulip4heaven Linux - Networking 3 07-26-2005 08:35 PM
can we configure a Linux server with mail server,file server and web server kumarx Linux - Newbie 5 09-09-2004 07:21 AM
Setup a linux server, DNS, WEB, FTP, and Mail Server Help watermelon_lee Linux - Networking 1 08-26-2003 04:09 AM
Linux app-server to server StarOffice to Windows Clients: Need advice biosx Linux - Networking 3 08-14-2002 11:14 AM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration