LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-17-2004, 08:29 PM   #1
Lechium
Member
 
Registered: Jun 2004
Distribution: Gentoo
Posts: 102

Rep: Reputation: 16
Setting up linuxbox as a router for windowsbox (my modle on the inside)


Hi. Ive been trying to set up my linuxbox as a router for the windows machine. I've read all the howtos yet am syill somehwat confused... can you guys correct me if im wrong please?

model I am trying

internet jack
||
[linux eth card 1] -- ip: my ip; mask: 225.225.225.0
||
Linuxbox
||
[linux eth card 2] -- ip: 10.0.0.1; mask: my ip
||
cable to windows box
||
[windows eth card] -- ip: 10.0.0.2; mask: 225.225.225.0
||
windows box

is this correct?
 
Old 06-17-2004, 09:26 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Except for the netmasks :) it looks OK

255.255.255.0



Cheers,
Tink
 
Old 06-17-2004, 10:36 PM   #3
Lechium
Member
 
Registered: Jun 2004
Distribution: Gentoo
Posts: 102

Original Poster
Rep: Reputation: 16
so 255.255.255.0 across the board? ok

One more question -- how exactly do I allow ip forwarding?
 
Old 06-17-2004, 10:59 PM   #4
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,509

Rep: Reputation: 46
Ip forward is done by iptables. Knoppix should have some way to automate this task. Try searching the network setup.

If you really need to config manually, try googling for iptables and NAT (network address translation), which is more or less the same thing as ip forward.
 
Old 06-19-2004, 01:29 PM   #5
Lechium
Member
 
Registered: Jun 2004
Distribution: Gentoo
Posts: 102

Original Poster
Rep: Reputation: 16
Hi.
I am even more lost than before...

I had set up cards just right time and time again. Than I had enabled ip forwarding. The program that suposed to set up nettables for me (netconf) isn't in my comp and apt-get cannot get it.... different HOWTO's give me competly different direction, and accodring to some I'm done (but it's not working) and according to others I need stuff I dont have.

Question #1:
After netcards are set up, should computers be at least able to ping each other on their new addresses? Linuxbox can ping 10.0.0.1, but not 10.0.0.2 (windowsbox)?

Question #2:
How do you set up iptables? I've been lookign for decent howto for longets time, yet they all are outdated or refere to stuff I cannot do =(

thank you...
 
Old 06-19-2004, 02:06 PM   #6
astrax
LQ Newbie
 
Registered: Jun 2004
Location: Mantsala, Finland
Distribution: Fedora Core 2
Posts: 14

Rep: Reputation: 0
#1

Yes, you should be able to ping each others, unless your windows-machine's firewall prevents replying to pings.

Are the leds of your network cards lit, if not, it's a hardware (or driver) problem, else a software problem.

The linuxboxes netmask must be 255.255.255.0. And your windows-machine's default gateway must be 10.0.0.1 for you to get to the Internet (but even without this you should be able to ping 10.0.0.1)

If it still doesn't work, post ifconfig and route -n output here.

#2

Configuring iptables isn' the most straightforward task in the world. I'd recommend the Shoreline firewall, which simplifies things a bit ( http://www.shorewall.net/ ). It's website has also good examples of different configurations.

Last edited by astrax; 06-19-2004 at 02:07 PM.
 
Old 06-19-2004, 02:28 PM   #7
Lechium
Member
 
Registered: Jun 2004
Distribution: Gentoo
Posts: 102

Original Poster
Rep: Reputation: 16
[ifconfig]

eth0 Link encap:Ethernet HWaddr 00:50:BA:02:0D:BB
inet addr:[my ip here] Bcast:10.108.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9299863 errors:0 dropped:0 overruns:0 frame:0
TX packets:918883 errors:0 dropped:0 overruns:1 carrier:0
collisions:0 txqueuelen:1000
RX bytes:838072855 (799.2 MiB) TX bytes:933514393 (890.2 MiB)
Interrupt:9 Base address:0xa000

eth1 Link encap:Ethernet HWaddr 00:C0:26:A4:B8:6B
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:28 errors:1 dropped:4 overruns:1 frame:0
TX packets:630 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5685 (5.5 KiB) TX bytes:45734 (44.6 KiB)
Interrupt:11 Base address:0xc000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:631 errors:0 dropped:0 overruns:0 frame:0
TX packets:631 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:75162 (73.4 KiB) TX bytes:75162 (73.4 KiB)

[rout -n]

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
[first 2 numbers of my ip].0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 10.108.0.1 0.0.0.0 UG 0 0 0 eth0

That is wierd since I remeber setting eth1's gateway to my ip... for some reason whey I /usr/sbin/netcard for one card it affetcs another... i cannot set gateway on eth1 to what i need it o be without knowcking out eth0. and as soon as i fix eth0, eth1's gw is back to old one... wierd...


Window box is set at:
ip address: 192.168.0.2
Seubnet mask: 255.255.255.0
Default gateway: 192.168.0.1

p.s. note i did change from 10.0.0.* to 192.168.0.* when i tried to srat anew, but didnt help much apparently.
 
Old 06-19-2004, 05:57 PM   #8
Lechium
Member
 
Registered: Jun 2004
Distribution: Gentoo
Posts: 102

Original Poster
Rep: Reputation: 16
Bump...

edit

i tried: route add -net 192.168.0.1 netmask 255.255.255.0 gw [my ip] dev eth1, and it told me that mask does not match route address... wtf? i tried 255.255.0.0 as well to no avail

Last edited by Lechium; 06-19-2004 at 06:09 PM.
 
1 members found this post helpful.
Old 06-20-2004, 04:25 AM   #9
astrax
LQ Newbie
 
Registered: Jun 2004
Location: Mantsala, Finland
Distribution: Fedora Core 2
Posts: 14

Rep: Reputation: 0
You don't have to have any gateway on eth1, in fact you shouldn't have one.

Try ping 10.108.0.1, it should be your gateway to internet. Ctrl-C ends the ping-command.

Here's an example of a succesful ping from a linux-machine, windows' output is slightly different:
Quote:
PING 195.74.0.47 (195.74.0.47) 56(84) bytes of data.
64 bytes from 195.74.0.47: icmp_seq=1 ttl=246 time=15.6 ms
64 bytes from 195.74.0.47: icmp_seq=2 ttl=246 time=13.3 ms
Do this and tell, which replies correctly and which doesn't:
  • ping 192.168.0.1 from windows
  • ping 192.168.0.2 from linux
  • ping 10.108.0.1 from linux
  • ping www.google.com from linux

When you're able to get from your linuxbox to internet, we should move on to configuring iptables/shorewall.


As a footnote, the error message states that if you have a mask of 255.255.255.0 and your IP is 192.168.0.1, your gateway's IP must be 192.168.0.xxx. But as said, you can't have any gateway for eth1.
 
  


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
linuxbox->router->printserver->printer xviddivxoggmp3 Red Hat 12 08-02-2004 02:59 AM
linuxbox as router and another router? ldin Linux - Networking 2 02-17-2004 02:00 PM
linuxbox router earl Linux - Networking 3 11-01-2003 11:04 AM
Iptables -L view very slow after 4-5 days on Linuxbox(Router) riaz2000 Linux - Security 10 10-29-2003 11:36 PM
Can ping linuxbox.domain but not linuxbox Gribbly Linux - Networking 1 06-07-2003 01:38 AM


All times are GMT -5. The time now is 10:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration