LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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
 
LinkBack Search this Thread
Old 11-22-2006, 03:21 AM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 214

Rep: Reputation: 30
networking issue with two LAN card


I just installed two network adapter into my redhat ES server. I put first card to access my VPN network & second to access internet. ok below as:

eth0-192.168.123.3 gateway 192.168.123.123
eth1:192.168.1.5 gateway 192.168.1.120

but i am unable to access both network simultaneously(VPN,Internet) when i disable a card only then i can access a network ok else not.

plz tell me what to do to access both network at same time

thanx in advance
 
Old 11-22-2006, 03:26 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,835

Rep: Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118
whichever network is not used as the default route will need any additional routes explitictly setting on it. how is your box supposed to know that, for example, 192.168.100.100 lives down the VPN side as opposed to the internet side?

route add -net 192.168.100 netmask 255.255.255.0 dev eth0
 
Old 11-22-2006, 06:01 AM   #3
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 214

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie
whichever network is not used as the default route will need any additional routes explitictly setting on it. how is your box supposed to know that, for example, 192.168.100.100 lives down the VPN side as opposed to the internet side?

route add -net 192.168.100 netmask 255.255.255.0 dev eth0


sorry chirs, i didn't get you. plz clear me what u wanna advice me.
plzzzzzzzzzzz.
 
Old 11-22-2006, 06:37 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,835

Rep: Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118
what's not clear? I'm sure i can give more information if you actually explain your problem to a suitable level of detail. you've not even said what "unable to access both network simultaneously" even means...
 
Old 11-23-2006, 12:04 AM   #5
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 214

Original Poster
Rep: Reputation: 30
chris, i tell u details:

I hv two lan cards in redhat AS:

eth0:- 192.168.123.6 gateway 192.168.123.123 (ip address of dlink adsl router to access internet)

eth1:- 192.168.10.2 gateway 192.168.10.5( ip address of cisco router connected to VPN)

beside above i put dns server to access internet also.

ok
now both card are active, but when i want to access internet .it takes the route to 192.168.10.2 ,thr it should take 192.168.123.6 for internet access....why so?

n when i try to access vpn it takes the route 192.168.123.6 thr it should tk 192.168.10.2..!

so, that's my problem i m unable to access both service at the same time , i hv to disable a netowk card to access relevent service.

i hope it clear now...
 
Old 11-23-2006, 06:38 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,835

Rep: Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118
as above you need to tell your pc which way to go to get where you want. so as you have two identical looking eth interfaces, you need to simply set the default route to go via eth0 and don't set anything about a default route for eth1. then using the example above, use the route command (or your gui of choice) to add specific, non-default routes to the system saying what else lives down eth1.
 
Old 11-24-2006, 12:03 AM   #7
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 214

Original Poster
Rep: Reputation: 30
DEAR,

I am in mess, i tried to add routes to but no success. can not you tell me right commands n way to achive my goal. Hope you will help me..
 
Old 11-24-2006, 06:56 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,835

Rep: Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118
i *HAVE* told you the right commands... erm.. well actually, a little syntax slip up.
Code:
route add -net 192.168.100.0 netmask 255.255.255.0 dev eth0
says that in order to reach the 192.168.100.0/24 network, you need to use the eth0 interface.
 
Old 11-24-2006, 07:23 AM   #9
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 30
Quote:
Originally Posted by sunlinux
eth0:- 192.168.123.6 gateway 192.168.123.123 (ip address of dlink adsl router to access internet)

eth1:- 192.168.10.2 gateway 192.168.10.5( ip address of cisco router connected to VPN)

beside above i put dns server to access internet also.
Make route for your internet connection as default with..
Code:
ip rou add default via 192.168.123.123 dev eth0
& for VPN connectivity..
Code:
ip rou add to 192.168.10.0/24 via 192.168.10.5 dev eth1
Thats it !!

p.s: Default routes are always used after all other static routes.
 
Old 11-24-2006, 11:37 PM   #10
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 214

Original Poster
Rep: Reputation: 30
thanx chris & amit my problem is sloved..
 
Old 11-25-2006, 02:15 AM   #11
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 214

Original Poster
Rep: Reputation: 30
o.. this damn problem again , linux unable to save routing list that i configured , as i restart my system all routes are flushed away..why so ?
 
Old 11-25-2006, 04:31 AM   #12
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 30
save(copy-paste) them to any of your startup script. e.g. rc.local or any runlevel specific startup script.

or you can go through the below mentioned link for setting up persistent routes but neverthless it works the same way.(i am not sure whether it will work in other distro or not)
http://www.cementhorizon.com/wiki/in...Linux_3_RHEL_3

EDIT : updated link info.

Last edited by amitsharma_26; 11-25-2006 at 04:40 AM.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lan Party Networking Xel'naga666 Linux - Networking 2 09-03-2005 05:25 AM
Lan Card Issue LinuxRam Linux - Networking 1 08-29-2004 12:37 PM
LAN Networking with 2 ISP intune Linux - Networking 1 07-18-2004 11:15 AM
need help on Lan networking/configs..... jay820 Linux - Networking 13 03-04-2004 01:57 AM
Samba / LAN Networking. Help? Zorlak Linux - Software 4 04-10-2003 02:54 AM


All times are GMT -5. The time now is 09:00 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration