LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-2003, 11:50 AM   #1
blish_blash
Member
 
Registered: Dec 2003
Posts: 68

Rep: Reputation: 15
Unhappy rh9 Routing Prob. using Linux between router and Win Client


Hi -
I am new to Linux (1 week?) and work only on shell, so go easy on me :-)
I have a Router through which we share one dsl for 4 people.
The router (a Netgear box) is also used as NAT and dhcp, so it gives the clients IP adresses and DNS location.

I try to connect a linux between my winXP client, and the router.
The linux has two eth-cards : one (eth0) is connected to the router, the other (eth1) to my winXP client.
The router has the ip 192.168.0.1.
eth0 is getting its ip from the router, and functions ( i can surf with lynx )
eth1 i give a static address of 192.168.100.1

the win machine runs on 192.168.100.2.

I can ping between linux and win, but the win machine does not get to the net, and I have no clue as how to give it a DNS access - but first I will be glad to be able to ping from my XP to the router...

You will proably ask me for "routes" so I quote it here:

Dest // Gateway // Genmask // Flags // Metric // ref // use // Iface
192.168.100.0 // * // 255.255.255.0 // U // 0 // 0 // 0 // eth1
127.0.0.0 // * // 255.0.0.0 // U / 0 / 0 / 0 / lo
default // 192.168.0. 1 // 0.0.0.0 // UG / 0 / 0 / 0 / eth0

I turned also my iptables off, but it did not really improve anything...

Be glad for help ...
Greetings,
Ron
 
Old 12-05-2003, 06:07 AM   #2
tiger3
Member
 
Registered: Nov 2003
Location: Land of the Rising Sun!
Distribution: Fedors Core 3, Red Hat 9, Mandrake 8.1
Posts: 52

Rep: Reputation: 15
192.168.100.0 and 192.168.0.0 are different networks without a router you cannot get them to ping or any connectivity. you have to set up the Linux box to act as a router. You may have to give the windows box a static IP. And make sure your real router routes for both networks.

Make your eth1 ip the default gateway on your windows box. And add routes through the Linux box so traffic for the network 192.168.100.0
This is done using the route command

syntax:

# route [add,del] [-net, -host] [addy] netmask [mask] gw [gwaddress] dev [eth0]

Addy option is the destination network to which you want to offer a route.

To display the routing table use the command route with no parameters.

Troubleshooting:
netstat can be used to display the status of all network connections.

-r option shows the routing table

-n does not perform name resolution

traceroute - can be used to view hops

Last edited by tiger3; 12-05-2003 at 07:10 AM.
 
Old 12-05-2003, 05:04 PM   #3
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
You need to activate ip routing

make sure you have

1

in the file /proc/sys/net/ipv4/ip_forward

This is a command that should do it:

echo 1 > /proc/sys/net/ipv4/ip_forward



that should do the trick.
 
Old 12-08-2003, 09:52 AM   #4
blish_blash
Member
 
Registered: Dec 2003
Posts: 68

Original Poster
Rep: Reputation: 15
Unhappy must i use NAT?

Hi -
Thank you both for the answers -
I set the ip_forward to 1 and played a bit with route (which does not really functions like it is written in man) and I advanced a bit :
Now my windows machine can ping other clients on the network and they can ping it, but it can not go to the internet, nor ping the router.
I am suspecting the router denies it...


so the network looks like this:

Code:
     Internet 

   (External IP)
Router (netgear box, NAT DHCP) 
   (192.168.0.1)

   (192.168.0.X)
     Linux Client             Other clients (192.168.0.X)
  (192.168.100.1)

  (192.168.100.2)
     Win Client
Like I said - the win client can ping all the machines in the network (199.168.0.X) , except for the router, and it doesn't go to the net - do I have to use NAT on my linux?
Is the problem on the router box?

Greetings,
Ron
 
Old 12-08-2003, 12:22 PM   #5
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
why don't you put everything in the same subnet? ie: 192.168.0.x?
 
Old 12-08-2003, 02:16 PM   #6
blish_blash
Member
 
Registered: Dec 2003
Posts: 68

Original Poster
Rep: Reputation: 15
ifconfig, route and so on

Hi - thanks for your answer - here are the details...
Well - I tried to put them all on 192.168.0.X but I did not succeed to the mutter of being able to ping them all, and was already very glad to be able to ping other clients on the network from inside the win machine - this stopped as I changed them all to the same network, I will however try again, maybe I have done some routing mistake.
For now - here are the details you asked for....

Code:
[root@localhost root]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:05:5D:D5:46:C8
          inet addr:192.168.0.7  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10218 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6594 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:704433 (687.9 Kb)  TX bytes:426656 (416.6 Kb)
          Interrupt:9 Base address:0x9f00

eth1      Link encap:Ethernet  HWaddr 00:10:4B:6B:CB:0A
          inet addr:192.168.100.1  Bcast:192.168.100.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12277 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6103 errors:0 dropped:0 overruns:0 carrier:4
          collisions:0 txqueuelen:100
          RX bytes:1020947 (997.0 Kb)  TX bytes:781733 (763.4 Kb)
          Interrupt:11 Base address:0x7c00

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:1179 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1179 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:117214 (114.4 Kb)  TX bytes:117214 (114.4 Kb)




[root@localhost root]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.100.0   *               255.255.255.0   U     0      0        0 eth1
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         router          0.0.0.0         UG    0      0        0 eth0



[root@localhost root]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver 213.191.74.18
nameserver 213.191.74.19
search localdomain
[root@localhost root]#
I hope this helps :-) ...
Greetings,
Ron
 
Old 12-08-2003, 04:03 PM   #7
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
Sorrry to have you made change everything, I just _asked_ why you needed 2 subnet.

Anyways, what is important here is to configure your default gateway correctly


Each of the machine in the 192.168.100.x and 192.168.0.x must have the router as their default gateway (ex: 192.168.100.2 must have 192.168.100.1 as default gateway and 192.168.0.123 must have 192.168.0.7 as default gateway). Then, the router must have your netgear box as default gateway.
 
Old 12-08-2003, 04:17 PM   #8
blish_blash
Member
 
Registered: Dec 2003
Posts: 68

Original Poster
Rep: Reputation: 15
Hi - thanks again :-))

I did check it again and it does not function with one subnet... but i guess i could use the practice...

Now, to be sure we are talking about the same thing :

1. The netgear box gets its gateway from the ISP. it has also an intern IP of 192.168.0.1
2. The Linux Box has two eth cards:
2.1. eth0 (192.168.0.7) has no gw set
2.2. eth1 (192.168.100.1) has also no gw set
2.3. default route 0.0.0.0 has the gw 192.168.0.1 (the netgear box)
3. windows (192.168.100.2) has the gw 192.168.100.1, which is the eth1 on the linux.

The funny thing is, that I can contact, for example, 192.168.0.4, or each other client from the network, but not the netgear box, and not the internet, so I suspect the netgear box does not route the subnet 192.168.100.X.

I set on the netgear box a static route to 192.168.100.0 through gw 192.168.0.7 (eth0) which enables other to ping the win, and win to ping others, but... hmm...

maybe you have a clue?
Thanx again...
Many Greetings,
Ron
 
Old 12-08-2003, 04:24 PM   #9
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
Of course I do have a clue

your mistake

point 2. : The Linux Box must have 192.168.0.1 as a gateway. You define this in /etc/sysconfig/network in the format


GATEWAY=192.168.0.1

Please try this out.
 
Old 12-08-2003, 04:30 PM   #10
blish_blash
Member
 
Registered: Dec 2003
Posts: 68

Original Poster
Rep: Reputation: 15
yes - this is already set... :-(
I define in /etc/hosts router as 192.168.0.1
I can also use lynx from the linux to surf... (well - not much color there...)
???
:-(
Greetings,
Ron
 
Old 12-08-2003, 04:39 PM   #11
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
if you suspect that the netgear does not route traffic that doesn't come from its subnet, you must use NAT
 
Old 12-08-2003, 04:49 PM   #12
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
btw, your routing seems ok. sorry for all the steps, but it is really hard to figure it out from here.

For NAT'ing I usually instal webmin, go into the firewall section and tell it to masquerade. Lame, but it works. (you can then maybe check for the rules)..For more complex firewalls, I modify some scripst I have. You can also check here for some samples http://iptables-tutorial.frozentux.n...-tutorial.html
 
Old 12-08-2003, 04:56 PM   #13
blish_blash
Member
 
Registered: Dec 2003
Posts: 68

Original Poster
Rep: Reputation: 15
yes - i will do it tommorow (here in europe it is now midnight...)
I hoped i can solve this otherwise, since the linux runs on a pII 233, and i am not sure about performance issues when using NAT...
Anyway, I start to figure out something about networking - it isn't so bad...
Thanks alot,
I will replay when I try the next step...
Cheers,
Ron
 
Old 12-08-2003, 05:16 PM   #14
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
Nat is not cpu-extensive.

I run a firewall with complete rules on Pentium 166 here, load average: 0.00 0.00 0.00

gnite!
 
Old 12-09-2003, 03:23 PM   #15
blish_blash
Member
 
Registered: Dec 2003
Posts: 68

Original Poster
Rep: Reputation: 15
Hi - I finally did it !
I changed the router (netgear box) netmask from 255.255.255.0 to 255.255.0.0 so it feels also responsible for the 192.168.100 network - and it works ! I can ping the netgear, I can ping the internet and so on.
The only problem is, my win maschine has a static ip, and thus a static DNS, whereas I would like it to get the DNS server IP eather from the netgear router or from the linux, which gets it from the router...
But I guess that is a win problem - so I search some help somewhere else -
Many Thanx,
Ron
 
  


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
deb netinstall client to win gateway to router to internet Motown Linux - Networking 5 01-05-2005 07:24 AM
NForce 2 hd controller with WD 60gb. Prob in Win; Linux? RedHatMasta Linux - Hardware 1 02-06-2004 05:29 PM
A routing Linux to win system problem jarethfox Linux - Networking 2 08-03-2003 09:08 PM
Routing PPTP through router running linux 2.4.x kernel mcukstorm Linux - Security 4 07-07-2003 11:30 AM
linux routing VS cisco router shoot2kill Linux - Networking 5 07-01-2002 10:31 PM

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

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