nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

How does "route add ..." fetch the interface automatically

This is a discussion on How does "route add ..." fetch the interface automatically within the Linux software forums, part of the Linux Getting Started category; Hi All, This is related to adding a default GW in the Kernal IP routing table in Linux. As you ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 11:32 AM
Junior Member
User
 
Join Date: Feb 2008
My distro: Monta Vista
Posts: 2
Rep Power: 0
Madhu is on a distinguished road
Question How does "route add ..." fetch the interface automatically

Hi All,

This is related to adding a default GW in the Kernal IP routing table in Linux.

As you knt the Command to be used is :
route add default gw {ip address}

Note: I have not given the eth interface. My Question is, though the interface is not given, it automatically adds an interface by itself.

I would like to know the logic behind this. Is it taking this from any physical file or something..

The reason is the above command works fine in all my systems, except one, which takes the interface as lo which is not possible and wrong. so i have to explicitly specify bond0 as the itf.. (though, its not a prob..i wud like to know the root cause of this behaviour )

Kindly help.

Regards
Madhu
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-09-2008, 11:47 PM
Junior Member
User
 
Join Date: Apr 2008
My distro: SUSE
Posts: 1
Rep Power: 0
1dannyboy is on a distinguished road
Default

The route add command basically uses the gateway to determine which interface it will use.

an alternate method would to just send it directly to an interface
Reply With Quote
  #3 (permalink)  
Old 04-24-2008, 06:28 PM
Junior Member
User
 
Join Date: Apr 2008
My distro: Fedora
Posts: 20
Rep Power: 0
RamPD is on a distinguished road
Default Try it

I think it depends on ethernet card in the system
try it
#ifconfig eth0 ipaddress
#route add default gw ip address eth0
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)

 
Thread Tools
Display Modes

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

Similar Threads

Thread Thread Starter Forum Replies Last Post
Redhat: Up2date " permission denied" while root guarrand Getting started tutorials 2 07-03-2008 12:50 PM
Does Redhat have "what" utility which can be used to display identification Info? DCAO Linux software 2 10-30-2007 08:23 PM
[Commercial] SafeSquid "SPEED-BOOSTER" 4.2.0 Released httpproxy Networking, Firewalls and Security 1 09-26-2007 09:05 PM
"permission denied" - Installing Lighttpd on RHEL 4 b3n Web servers 3 08-29-2007 08:45 PM
Oracle "show databases" list raj Databases servers 1 05-18-2007 02:21 AM


All times are GMT +5.5. The time now is 02:51 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36