LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-26-2005, 11:23 PM   #1
hariiyer
Member
 
Registered: May 2004
Location: india
Posts: 103

Rep: Reputation: 15
adding more gateway


I am using RH-9 distro with squid. everything is working fine.

My setup is like this for internet iam using RH-9. for intranet portal i am using one router. Now my problem is when i give the gateway to the router intranet portal is working fine, and i am not accessing internet. when i give the gateway of linux box i can able to access internet and not intranet portal. Just tell me how to route both the gateways and access both the things at same time.

regards
hari
 
Old 12-27-2005, 07:19 PM   #2
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
you have to add a route for the intranet "range". If you don't have any route about the intranet, the linux just send everything to your default gateway (the internet) so it gets lost.

Assuming your intranet range is "192.168.1.0", it shuold be something like :
route add -net 192.168.1.0 netmask 192.168.1.255 gw 192.168.1.1 dev eth0

Of course, you will have the use the correct range/gateway ip/interface.
 
Old 12-27-2005, 08:28 PM   #3
kehkok
LQ Newbie
 
Registered: Nov 2005
Posts: 20

Rep: Reputation: 0
Cool 2 network cards

If I have different range like 192.168.10.0, so how do I link it up with the 192.168.1.1 (router).

I am able to ping from 192.168.10.23(eth1) to 192.168.1.23 (eth0), but I cannot ping from eth1 to either 192.168.1.1 or outside. How do I forward the packets from eth0 to outsdie?

Thx.
 
Old 12-27-2005, 08:38 PM   #4
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
I don't really understand what you ask. If you want your computer to send to a router "192.168.1.1" that "route" the 192.168.10.0 network, create a route like "route add -net 192.168.10.0 netmask 192.168.1.255 gw 192.168.1.1 dev eth0".

About the forwarding, well... it shouldn't be done by the linux computer unless the linux computer IS actually acting as the router. Make sure your ROUTER (what kind of router is it??) is correctly configurated to forward from an ip range to another, you might need to add some route in the router as well.
 
Old 12-27-2005, 09:00 PM   #5
kehkok
LQ Newbie
 
Registered: Nov 2005
Posts: 20

Rep: Reputation: 0
2 network cards

I did the route cmd and capture the output.

~>route add -net 192.168.10.0 gw 192.168.1.1 netmask 255.255.255.0
~>route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.10.0 192.168.1.1 255.255.255.0 UG 0 0 0 eth1
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1


So, I do the ping now, but it can't reach! The output is:

ping -c 5 -I 192.168.10.23 192.168.1.1
PING 192.168.1.1 (192.168.1.1) from 192.168.10.23 : 56(84) bytes of data.

--- 192.168.1.1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4010m


thx.
 
Old 12-28-2005, 05:26 AM   #6
hariiyer
Member
 
Registered: May 2004
Location: india
Posts: 103

Original Poster
Rep: Reputation: 15
i will explain my setup once again

i have 2 lan cards in my linux box. 1 is for inernet and other is for local. I have one external router (DAX) also.
The router is for lease line in which through i am accessing SAP PORTAL. Now my problem is that i can't access both internet and SAP portal at a time. Explain me how to access both the things

The private ip starts from 172.35.1.1 and my linux box ip is 172.35.1.9.

The ip address of the router is 172.35.1.254.

If i want to access SAP portal i will change the gateway (windows system) to 172.35.1.254 and if i want to access internet i will change the gateway to 172.35.1.9.

I hope u people understand my setup.

My distro is Whitbox
 
Old 12-28-2005, 06:23 AM   #7
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
Quote:
Originally Posted by Half_Elf
I don't really understand what you ask. If you want your computer to send to a router "192.168.1.1" that "route" the 192.168.10.0 network, create a route like "route add -net 192.168.10.0 netmask 192.168.1.255 gw 192.168.1.1 dev eth0".

About the forwarding, well... it shouldn't be done by the linux computer unless the linux computer IS actually acting as the router. Make sure your ROUTER (what kind of router is it??) is correctly configurated to forward from an ip range to another, you might need to add some route in the router as well.

the above suggestion looks fine to me

i can also suggest the same

u can look into more by using

iproute2

http://www.policyrouting.org/iproute2.doc.html

regards
 
  


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
Adding different gateway to the second NIC jomy Linux - Networking 3 12-25-2004 02:36 AM
Adding a gateway robotik Linux - Wireless Networking 5 10-20-2004 03:38 AM
Odd problem: Gateway unreachable after certain amount of time (Win XP Gateway) SocialEngineer Linux - Networking 2 08-13-2004 12:54 AM
Automatically adding default gateway when booting enjoyzj Linux - Networking 2 04-13-2004 04:05 PM
Adding a Gateway and making eth1 the primary unclebyron Linux - Networking 1 04-02-2002 07:35 PM

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

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