LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   routing table quiestion (https://www.linuxquestions.org/questions/linux-networking-3/routing-table-quiestion-170432/)

John Micheal 04-15-2004 06:51 AM

routing table quiestion
 
Dear All ,

i have few quiestions i would like to ask about :

1) how can i know the gateway of the interface from command line , when i try ifconfig -a , it show the ip address and mask but not the gateway.
is there any command i can use to show the gateway of my interface ??


2) how to configure my routing table to be saved even after i restart the system , every time i restart i need to use "route add " command to modify my routing table , is there any files i can use or edit to make my routing table permenant ??

Half_Elf 04-15-2004 08:41 AM

route -n
man route

you can't save your route, you'll have to add some line at some boot scripts.

Robert0380 04-15-2004 08:43 AM

1) route just typing "route" will show you some stuff. The Gateway will be listed in the colum that says "Gateway". The default route is the line that has 0.0.0.0 somewhere in it. I don't have access to a Linux box to give a more descriptive answer but on my box the default route looks something like:

default 192.168.1.1 0.0.0.0 UG 0 0 eth0

i may be off but basically that says the gateway IP that eth0 is connected to is 192.168.1.1. Now my other interface (eth1) is itself a gateway (10.1.1.1) but with IP Forwarding on and a NAT rule, everything headed for the internet still goes out of eth0 because eth0 is connected to the default gateway.

2) Not sure about how it's done in Red Hat but It involves and init script.

ugge 04-15-2004 09:23 AM

You agreed not to double post.
Double posting only makes people annoyed less willing to help.


All times are GMT -5. The time now is 01:49 AM.