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 ...
- 06-23-2010 #1Just 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.
- 06-23-2010 #2
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
- 06-26-2010 #3Linux Guru
- 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!
- 07-09-2010 #4Just Joined!
- Join Date
- Jun 2010
- Posts
- 2
Thanks everyone! That makes sense!


