LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Using Linux Box as a Router (https://www.linuxquestions.org/questions/linux-networking-3/using-linux-box-as-a-router-88901/)

wasabi 09-03-2003 02:23 PM

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....

chitang 09-03-2003 03:29 PM

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.

wasabi 09-03-2003 03:47 PM

is there a more simple way to do this, I am a big time linux newbie

dubman 09-03-2003 05:15 PM

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

wasabi 09-03-2003 08:30 PM

thanks for your reply

...but the link that i click is dead

dubman 09-04-2003 05:08 PM

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

My Apologies

--dubman


All times are GMT -5. The time now is 08:22 PM.