LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-03-2003, 02:23 PM   #1
wasabi
Member
 
Registered: Aug 2003
Location: Charlotte, NC
Distribution: Fedora Core 3?
Posts: 95

Rep: Reputation: 15
Using Linux Box as a Router


Ok let me start off by saying that I have a machine running Mandrake 9.1 and another running win 2000 professional. I want to setup the mandrake box as the router to the windows box. I have the mandrake box connected to the internet through one of the network cards in the machine through eth0. I also have another card that shows up as eth1. I intended to run a crossover cable from the other card eth1 to the windows box, however when I run internet connection sharing and load the wizard it says at the end that DHCP server installation failed and it doesn't work.

Is this the way I need to set this up?
or..
When I installed Mandrake and had to select packages (i selected the router server option) do I need to use that somehow?

Thanks alot for whoever can help

-wasabi with one computer offline....
 
Old 09-03-2003, 03:29 PM   #2
chitang
LQ Newbie
 
Registered: Sep 2003
Posts: 1

Rep: Reputation: 0
hi there,
i look like u want the linux box as a router there i would do this
linux - eth0 connected to internet either DSL/Cable
linux - eth1 connected to Windows box
eth0 - public IP range: x.x.x.x
eth1 - private IP range: 192.168.1.x

Windows eth0 IP range: 192.168.1.x (but not the same as linux eth0)

Linux Configuration
Install Linux as standard with iptables.
configure
eth0 x.x.x.x mask x.x.x.x gw x.x.x.x (info from your ISP)
eth1, 192.168.1.x mask 255.255.255.0 (no GW cos u are the GW)

enable ip4_forwarding command is
"echo 1 > /proc/sys/net/ipv4/ip_forward"

configure iptable

iptables -A FORWARD -s 192.168.1.0/24 -d 0.0.0.0/24
iptables -A FORWARD -s 0.0.0.0/24 -d 192.168.1.0/24

iptables-save (to save the settings)

iptables --list

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- x.x.x.x/24 192.168.1.0/24
ACCEPT all -- 192.168.1.0/24 x.x.x.x/24

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

x.x.x.x is the your public IP range.

Windows eth0 IP range: 192.168.1.x mask 255.255.255.0 gw linux box

Now test the router,
First ping the router from your Windows
Next try to surf.

Remember this is a basic setup have no firewall protection.

http://www.netfilter.org/documentati...NAT-HOWTO.html

NAT will provide protection for all machines sitting behind the router.
 
Old 09-03-2003, 03:47 PM   #3
wasabi
Member
 
Registered: Aug 2003
Location: Charlotte, NC
Distribution: Fedora Core 3?
Posts: 95

Original Poster
Rep: Reputation: 15
is there a more simple way to do this, I am a big time linux newbie
 
Old 09-03-2003, 05:15 PM   #4
dubman
Member
 
Registered: Jan 2003
Distribution: Redhat 9, Fedora Core 1, Suse 8
Posts: 188

Rep: Reputation: 30
you said you ran ICS (internet connetion sharing), which is a windows configuration utility. If you have your internet connection to you linux machine, and routing to your windows box, you dont need ICS. ICS is only used for sharing a connection on the windows box itself.

however, you will need to enable routing on your linux box by doing this:
edit your /etc/sysctl.conf and add the line:
net.ipv4.ip_forward = 1

then you will need to determin how you want your windows box to get an ip address. If you want it automatically assigned you will need to run a dhcp server from the linux box as well. But then you have NAT issues to deal with.

My advice would be to set up IPTables with NAT. This would be much more secure and easier, in my opinion anyway.

Check out this site:
http://eressea.pikus.net/~pikus/plu...wall/page0.html
it should expalin everything you need.

Hope this helps...

--dubman
 
Old 09-03-2003, 08:30 PM   #5
wasabi
Member
 
Registered: Aug 2003
Location: Charlotte, NC
Distribution: Fedora Core 3?
Posts: 95

Original Poster
Rep: Reputation: 15
thanks for your reply

...but the link that i click is dead
 
Old 09-04-2003, 05:08 PM   #6
dubman
Member
 
Registered: Jan 2003
Distribution: Redhat 9, Fedora Core 1, Suse 8
Posts: 188

Rep: Reputation: 30
http://eressea.pikus.net/~pikus/plug...all/page0.html

My Apologies

--dubman
 
  


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
linux box as a router cambie Linux - Networking 4 11-21-2004 10:01 AM
linux box as router cambie Linux - Networking 10 11-16-2004 12:20 AM
Linux box as a router dumpa Linux - Newbie 8 08-08-2003 04:05 PM
Linux box as router AkumaLoka Linux - Networking 3 10-14-2002 04:57 PM
Linux box as router Kapone Linux - Networking 5 07-04-2001 06:50 AM

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

All times are GMT -5. The time now is 03:02 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
Open Source Consulting | Domain Registration