Find the answer to your Linux question:
Results 1 to 4 of 4
I have my box set up with dhcp. The dhcp server gives me my gateway. Is this info placed in any files? I can see my gateway by typing in ...
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    2

    [SOLVED] Where is gateway info stored?

    I have my box set up with dhcp. The dhcp server gives me my gateway. Is this info placed in any files? I can see my gateway by typing in netstat -rn, but I don't know where this info is stored. I have looked in /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-etho. I've tried to grep in quite a few directories/files for GATEWAY but haven't found my answer. Running RH54.

    Thank you.

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    i think routing table and gateway is set up by kernel when devices are brought up, you would only define a gateway in a configuration file when using a static IP address, otherwise that information comes from the DHCP server

    you can also see gateway with /sbin/route -n

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    It is stored in kernel memory (you can probably find it somewhere in /proc). When you use DHCP to get an IP address, the gateway is provided by the server. When you reboot and get another DHCP address, it is entirely possible that the server has changes (frequent w/ laptops), so the gateway may change also. So, this is not store in the material file system unless you use a static IP address and speciify the gateway manually, in which case it is probably in /etc/network/interfaces (not 100% sure of that).
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. #4
    Just Joined!
    Join Date
    Jun 2010
    Posts
    2
    Thanks everyone! That makes sense!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...