LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-01-2004, 09:16 AM   #1
MR_UNO
LQ Newbie
 
Registered: Nov 2004
Posts: 13

Rep: Reputation: 0
Question Linux gateway on a LAN and the rest of the boxes are XP


Hi there, I have Mandrake 10.0 installed on my computer, and i'd like to turn it into the gateway of the lan at home, the rest of the computers are 3 that are running XP and 1 that is running win98se...

Thanks in advance!
 
Old 12-01-2004, 09:37 AM   #2
m4dj4ck
Member
 
Registered: Aug 2004
Location: the coven
Distribution: slackies
Posts: 55

Rep: Reputation: 15
basically, you need to have ip forwarding enable and iptables installed on your mandrake 10. For beginner, i would recommend firestarter. it's easy to setup. Others linux firewalls are shorewall, gshield and etc. If you want to build your own custom iptables script, then you should refer to iptables/netfilter website regardings the docs.(www.netfilter.org) Cheers!
 
Old 12-01-2004, 09:47 AM   #3
MR_UNO
LQ Newbie
 
Registered: Nov 2004
Posts: 13

Original Poster
Rep: Reputation: 0
what about my IP address, should it be static? and the windows boxes IPs, what obut them???
 
Old 12-01-2004, 09:48 AM   #4
ror
Member
 
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
everything should be static unless you plan on running a dhcp server on your gateway (overkill for a small home network)
 
Old 12-01-2004, 11:03 AM   #5
Parenthesis
LQ Newbie
 
Registered: Nov 2004
Location: Australian - living in Germany
Distribution: suse 9.0
Posts: 5

Rep: Reputation: 0
Have a look here, www.fli4l.de, the one disk router, easy to configure, even for newbies, runs on a 486 with 16mb ram, hundreds of opt_packets available, very modular, so you can do what you want with it.
Boots from Floppy, CD, Hard Drive, or usb stick, or alternatively seeing as you can afford more than one computer, and assuming they are all yours you are not the poorest of souls, so just buy a hardware router
 
Old 12-01-2004, 11:50 AM   #6
MR_UNO
LQ Newbie
 
Registered: Nov 2004
Posts: 13

Original Poster
Rep: Reputation: 0
i've just read on the firestarter page that i need two network cards on the gateway...
i only have one, is that a problem???
 
Old 12-01-2004, 02:01 PM   #7
Parenthesis
LQ Newbie
 
Registered: Nov 2004
Location: Australian - living in Germany
Distribution: suse 9.0
Posts: 5

Rep: Reputation: 0
Buy another network card
 
Old 12-01-2004, 02:07 PM   #8
bdogg
Member
 
Registered: Sep 2004
Location: Salt Lake City, UT
Distribution: Debian Sarge
Posts: 93

Rep: Reputation: 15
TLDP - IP MASQUERADE

This will tell you all you need to know to get it going.

Get another network card and then start your homework.
 
Old 12-01-2004, 03:16 PM   #9
ror
Member
 
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
you only need 2 NICs if you're sharing a connection from one of them
 
Old 12-01-2004, 05:20 PM   #10
MR_UNO
LQ Newbie
 
Registered: Nov 2004
Posts: 13

Original Poster
Rep: Reputation: 0
let me see if i get this right, the only way is to have 2 nics?
i can't believe it, i can do the very same thing with only one nic at WIN XP, there must be a way to do it with one nic at linux...

i don't know if this is relevant, but, my connection is adsl, and the modem is plugged in the switch, and i reach the modem through the switch...
 
Old 12-01-2004, 11:30 PM   #11
bdogg
Member
 
Registered: Sep 2004
Location: Salt Lake City, UT
Distribution: Debian Sarge
Posts: 93

Rep: Reputation: 15
What exactly do you do with one nic in winxp? Internet connection sharing? How do you enable that with only one network connection?

You sure that that "switch" is not a router? What is the output of ipconfig /all in windowsxp when you have this setup where you can use winxp as a gateway and it only has one nic?
 
Old 12-01-2004, 11:35 PM   #12
ror
Member
 
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
If you're recieving the ADSL into to the switch you should want that as the gateway shouldn't you?
 
Old 12-02-2004, 02:20 AM   #13
gani
Member
 
Registered: Jun 2004
Location: Metro Manila, Philippines
Distribution: Linuxmint, Slackware
Posts: 356

Rep: Reputation: 34
Your modem could be with built-in internet sharing/NAT already but without firewall definitely.

I have tried this once in Slackware 10. Here is my script:

#!/bin/bash
#
# My Linux Box Simple Internet Sharing Script
#
# file: /etc/rc.d/rc.nat
#
#----------------------------------------------------------------------
# Don't forget to make this file executable by doing
# chmod 755 /etc/rc.d/rc.nat
#
# Then in your /etc/rc.d/rc.local script add this after the last line:
# . /etc/rc.d/rc.nat
#
# You may put a header comment to identify this.
#-----------------------------------------------------------------------
#
# eth0 = internal interface - (localnet) - This depends on your setup.
# eth1 = external interface - (DSL connected)
#
IPTABLES="/usr/sbin/iptables"
EXTIF="eth1" # To where my DSL is connected.
INTIF="eth0" # Connected to my local network.
#
echo ""
echo "Loading my INTERNET SHARER & rc.firewall ruleset....."
echo "My Box Internal Interface = $EXTIF"
echo "My Box External Interface = $INTIF"
echo "Clearing existing rules and setting default policy..."
$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -t nat -F
sleep 1
echo "FWD: Allow all connections OUT and ONLY existing and related ones IN..."
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPTABLES -A FORWARD -j LOG
sleep 1
echo "Enabling IP NAT (MASQUERADING)...."
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
sleep 1
echo "Enabling IP FORWARDING...."
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "Checking if IP FORWARDING is enabled = '`cat /proc/sys/net/ipv4/ip_forward`'"
#
if [ `cat /proc/sys/net/ipv4/ip_forward` = 1 ]; then
echo "It's enabled!..."
else
echo "IP forwarding is not enabled. Enable it now by typing 'echo 1 > /proc/sys/net/ipv4/ip_forward'"
echo "at the command line."
fi
#
echo ""
#
# End of my personal /etc/rc.d/rc.nat.

Just adjust the path since Slacware is a BSD style Linux.

This will be started each time you startup your box.

This is not yet secured since INPUT default policy is to accept. Search for howto on how to make this secured by creating default drop policy. I have tried one howto but it didn't work. And if you really want a highly secured firewall I would recommend OpenBSD instead - the one I'm using.
 
  


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
Obtaining IP LAN gateway in C under Linux executive Programming 2 04-13-2005 11:21 AM
Linux as Gateway in a LAN out of 20 PCs stormblast Linux - Newbie 2 04-30-2004 12:22 AM
how to share linux files on LAN btwn other linux boxes shakeeb Linux - Networking 9 02-04-2004 02:10 PM
File transfer between two linux boxes in a LAN ganninu Linux - Newbie 6 09-09-2003 10:37 AM
Can't access the rest of the network from behind gateway BrianG *BSD 1 05-02-2002 09:55 AM

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

All times are GMT -5. The time now is 08:46 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