LinuxQuestions.org
Visit Jeremy's Blog.
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-05-2004, 03:21 PM   #1
phyberoptix
LQ Newbie
 
Registered: Dec 2002
Distribution: FC3, SuSe 9.2
Posts: 17

Rep: Reputation: 0
Question Help setting default Network card


I have 2 nics in my linux box (FC2). One is connected to the internet, and the other is an internal lan connector. I want to be able to use the external (internet) interface as default, and set up a routing table (?) to tell linux when to use the internal (lan) nic.

for example, my internal nic should handle all traffic to and from:
168.218.*, 168.110.*, 129.39.15.*, 199.166.240.*

and the external (internet) adapter should do all other traffic. This way, when I open a web browser on my box, it will by default use the external (internet) nic, and if I need specific items from my internal network, the box will use the internal (lan) nic.

The internal (lan) ip is 168.218.58.100/255.255.255.128
The external (internet) ip is 192.168.2.100/255.255.255.0

Could someone help me with this? I've searched for some specific examples, but can't seem to hit it right.

Thanks in advance!
 
Old 11-05-2004, 03:54 PM   #2
gabriele_101
Member
 
Registered: Oct 2001
Location: CAMBRIDGE, MA USA
Distribution: RH9 Kernel 2.4.20-18.9
Posts: 69

Rep: Reputation: 15
Try Running:
Code:
route del default
route add -net 168.218.0.0 netmask 255.255.0.0 eth1
route add -net 168.110.0.0 netmask 255.255.0.0 eth1
route add -net 129.39.15.0 netmask 255.255.255.0 eth1
route add -net 199.166.240.0 netmask 255.255.255.0 eth1
route add -net 0.0.0.0 netmask 0.0.0.0 eth0
You may have to delete some other routes first (not just the default route, which we re-create in the last line), so feel free to post the output of
Code:
rout -n
before you run the above commands.

And if you want to know how to make it last, follow my link, if someone ever answers:

http://www.linuxquestions.org/questi...hreadid=251500

-Gabriele
 
Old 11-05-2004, 04:41 PM   #3
OrphanedLand
LQ Newbie
 
Registered: Dec 2003
Distribution: Slackware
Posts: 26

Rep: Reputation: 15
Hello friend,

I think that your Internal NIC is eth0 and External NIC is eth1

This commands must do what you want...

route add -net 168.218.0.0 netmask 255.255.0.0 dev eth0
route add -net 168.110.0.0 netmask 255.255.0.0 dev eth0
route add -net 129.39.15.0 netmask 255.255.255.0 dev eth0
route add -net 199.166.240.0 netmask 255.255.255.0 dev eth0
route add -net 0.0.0.0 netmask 0.0.0.0 dev eth1

If you understand you correctly and I am not wrong, this is the solution for you...

Goodluck

Last edited by OrphanedLand; 11-05-2004 at 04:50 PM.
 
  


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
Setting default Sound card. Mr.Ampersand() Linux - Software 7 11-08-2005 01:32 PM
Problem with setting up network card / network ssmeets Linux - Hardware 3 11-03-2005 03:46 PM
Choosing the default network card for connecting to the internet MaestroC Linux - Networking 4 10-22-2005 07:47 PM
setting up network card ah786 Slackware 16 11-05-2004 06:09 PM
Sound - crackling and setting default card VoidHawk Linux - Newbie 0 08-03-2001 10:44 AM

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

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