LinuxQuestions.org
Review your favorite Linux distribution.
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 11-24-2005, 03:35 PM   #1
k.king
Member
 
Registered: Oct 2005
Posts: 93

Rep: Reputation: 16
IP Route Add or Forwarding ?


I have two network cards in a server
eth0 static 192.168.1.1 Mask 255.255.255.0 DHCP Server
eth1 dhcpclient 192.168.0.xxx Mask 255.255.255.0

route
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 10 0 0 eth0
192.168.0.0 * 255.255.0.0 U 10 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 10 0 0 eth1

The workstations get an IP address in the 192.168.1.XXX range

They have internet access working via the file server fine (from 192.168.0.1)

There is a HP laser printer with a Jetdirect card on fixed IP 192.168.0.132

The /etc/sysconfig/network file has FORWARD_IPV4=true

If I ping this from the server or clients I get
From 192.168.0.xxx icmp_seq=2 Destination Host Unreachable


The interactive firewall shows 192.168.0.132 as whitelisted.

The question is can I keep everything the way it is above and add a route or forwarding allow the printer to be seen by the server at least ?
 
Old 11-25-2005, 12:51 PM   #2
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Let me tell you route add command.. because i didnt got your query exactly.

So i mould your query with my way n do present it with answers.

You have two ethernet cards... ( i am assuming them )
Eth0 --> ip --> 192.168.1.1
Eth1 --> ip --> 192.168.0.2

Your HP1 printer address is 192.168.0.5
Your HP2 printer address is 192.168.1.5
(again assumed them -- its not necessary for you to have another printer, you can have it as a network too)

Now suppose you want to ping both of them from your box.

Enter the below mentioned command with your own real-time situation & ips.

route add -net 192.168.1.0 netmask 255.255.255.0 gw <gateway-ip-if-u-use-any> dev eth0
route add -net 192.168.0.0 netmask 255.255.255.0 gw <gateway-ip-if-u-use-any> dev eth1

Through those commands we have just routed the traffic which belongs to their own respective eth cards.

Got some other problem or need some further clarification or answers.
Feedback.b
 
Old 11-25-2005, 02:32 PM   #3
k.king
Member
 
Registered: Oct 2005
Posts: 93

Original Poster
Rep: Reputation: 16
okay if it wasn't clear the route map I included was as the server machine responds to route command

specifically what I was trying to do was allow the clients which will be on 192.168.1. addresses to print to a printer on the 192.168.0 net.

if I try your commands it more or less duplicated entries already in the route table except the metric was zero and originals were 10. And I could not ping the laser still.

I then tried reversing the dev's and found that the following

route add -net 192.168.0.0 netmask 255.255.255.0 dev eth0

allowed me to ping the laser and print a testpage from CUPS.

Unfortunately I then discovered that the clients can no longer access the internet ?

If I try the same line with the gw 192.168.0.1 it responds Network is unreachable

If I route del the newly added line that allowed me to ping the printer the clients can all access the internet again.

Does that make sense ?
 
  


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
keepalived keeps using route not masq as the forwarding method. abefroman Linux - Networking 0 09-05-2005 04:21 PM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
route add powah Linux - Newbie 4 09-01-2005 02:24 PM
route add robf2301 Linux - Networking 6 03-11-2005 04:06 AM
ip route add ducati620 Linux - Networking 0 06-06-2004 06:11 AM

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

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