Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 03-20-2006, 11:48 AM   #1
Registered: Apr 2003
Location: Stockholm, Sweden
Distribution: Debain
Posts: 59

Rep: Reputation: 15
where did I go wrong?

I'm trying to get my Debian box to work as a router for my laptop with XP Pro and for my stationary that has dual boot with XP Pro and Debian, but it aint working. It's working up to layer two, because I can ping between them and they're all showing up in the arp table.

This is how the router is setup:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static

auto eth2
iface eth2 inet static
I've tried with different broadcast addresses for eth1 and eth2, dont know if eth1 and eth2 are suppose to have the same broadcast address, which is it? What's the highest and the lowest address I can have as broadcast address? What is the highest IP address I can have when the lowest is

The routers /etc/hosts
Code: localhost.localdomain localhost gardian Active #stationary hostname and IP
Am I suppose to add the windows workgroup name which is to /etc/hosts and change the routers domain too? so /etc/hosts will look like:
I want to be the local networks domain name. What should I do to create my own domain if this doesn't work? which files needs to be changed on the router so I wont get the error message when I try to change it on the windows machines? now it only works with as workgroup name on the windows box.

Router /etc/hosts.allow
That's the only files I have altered on the router.
Every time I boot up the router I have to run: echo "1" > /proc/sys/net/ipv4/ip_forward. If I create a new file that looks like this:
and save it as ip_fw in lets say /usr/sbin. Then I'm suppose to put /usr/sbin/ipfw in a file, which I dont remember the name and the location of, but then it will be run automatically at boot. I'm on the right way? If so, which file is it?

What I've done with the stationary windows macine:
Code: localhost gardian #the router
loopback 127 # workgroup name and network address
windows stationary addresses
DNS-server X.Y.X.Y # not my real DNS-server address
DNS-server2 X.X.X.X
Got the DNS-server address from /etc/resolv.conf

Then I created this iptables script as /etc/init.d/

iptables -F
iptables -t nat -F
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
I'm just getting started reading Iptables Tutorial 1.2.0 so I dont know how this script is working with a dynamic internet IP address.

After that I did a chmod:
chmod 755 /etc/init.d/
to make it start at boot:
ln -s /etc/init.d/ /etc/rc1.d/S99iptables
ln -s /etc/init.d/ /etc/rc2.d/S99iptables
to activate it:
cd /etc/init.d
I've followed a tutorial on the Swedish linux forum made by Ekenstein. Hope other ppl can se this thread and make an easy start on how to set up a router. But some where I made an mistake and I dont know where. If I have missed to leave any info, let me know and I'll fill out the blanks. Now where did I do wrong... Have I missed any software that needed to be installed exept for iptables? Any clues or ideas for an upgrade?

Last edited by HmmLinux; 03-20-2006 at 11:58 AM.
Old 03-21-2006, 04:57 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
Well I don't really see a fundamental question there... those two NIC's are on the same network, therefore there is no routing taking place, it's just going to bridge your network, and if you can ping one ip from the other then that's the job done... personally if you do want to keep them on the same subnet then please please just go spend $10 on a switch.
Old 03-21-2006, 07:39 PM   #3
Registered: Apr 2003
Location: Stockholm, Sweden
Distribution: Debain
Posts: 59

Original Poster
Rep: Reputation: 15
the client cant access the net so it's not done and why and how to fix it is the big question. i've changed the network addresses to:

whats the fun in buying a switch? im doing this because i want to learn how to. thanks for the tip buying a switch, hope other ppl find you more helpfull then i did. if i want to use VLSM and keep it on the same network, would that be possible? does debian have an supporting routing protocol? Chris, feel free to answer but please please please say something that will help me learn more.


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
What's wrong with this? anuode Solaris / OpenSolaris 4 09-19-2005 02:01 PM
What's wrong ? igor@44 Programming 8 08-10-2005 05:36 AM
Something is VERY WRONG MontyPY Linux - Software 4 03-04-2005 07:25 PM
my time is wrong and calender is also wrong Paxmaster Linux - General 6 12-16-2004 01:46 AM
What's wrong with RH 9? kavelj Linux - Distributions 4 07-17-2003 03:27 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:18 AM.

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