VMware vSphere

 View Only
Expand all | Collapse all

esxcfg-route entries are not persistant ?

  • 1.  esxcfg-route entries are not persistant ?

    Posted Jul 31, 2012 06:54 AM

    Dear Forum,

    im trying to add a static route to my ESXI 5 System, besides that, I am changeing the standard gateway, too.

    After 3-4 Days, without any event , that route is gone.

    To make the routes persistant after boot i also wrote them to /etc/rc.local. But this didnt have any effect to my problem...

    Is this behave normal ? I didnt find anything about making routes persistant, therefore im realy confused that a running system is forgetting its static routes..

    thanks for help ,

    regards

    Filip



  • 2.  RE: esxcfg-route entries are not persistant ?

    Posted Jul 31, 2012 08:05 AM

    Hi,

    What did you put in /etc/rc.local ? It should work if you put something like:

    esxcfg-route -a 192.168.10.0/24 192.168.0.1


  • 3.  RE: esxcfg-route entries are not persistant ?

    Posted Jul 31, 2012 08:16 AM

    I appended in the rc.local the following:

    esxcfg-route -a xx.xxx.xxx.xxx/32 xxx.xxx.xxx.xxx

    esxcfg-route -d default xxx.xxx.xxx.xxx

    its to delete the default GW, so the ESXI server is only reachable through another host i have...



  • 4.  RE: esxcfg-route entries are not persistant ?

    Posted Jul 31, 2012 08:19 AM

    Do you need a delete statemen? Why not just not specify the default in the network settings on the host?



  • 5.  RE: esxcfg-route entries are not persistant ?

    Posted Jul 31, 2012 08:40 AM

    you mean in the vsphere client ? There I can give a standard GW, im not sure if I can remove it just leaving the fields blank. But do you think it would change something?



  • 6.  RE: esxcfg-route entries are not persistant ?

    Posted Jul 31, 2012 08:47 AM

    If you take the delete statement out, does your other route survive the reboot?



  • 7.  RE: esxcfg-route entries are not persistant ?

    Posted Jul 31, 2012 09:11 AM

    well, I rebooted the mashine with the delete statement and what I can see is, that the static route is active, but the standardgw is not been deletetd.

    then i tried to delete the standard GW in the vshpere client , leaving the ip fileds blank. The vshpere client gives a warning that maybe the mashine is not reachable anymore, but after submitting , nothing changes: the standardgw is not been deleted, even in the cvshpere client its shown again ..



  • 8.  RE: esxcfg-route entries are not persistant ?

    Posted Jul 31, 2012 10:00 AM

    I just tried to edit /etc/vmware/esx.conf and replaced the default gateway IP with the loopback IP (127.0.0.1) and then did a /sbin/auto-backup.sh to save changes. Then rebooted... Looks fine... 

    Before edit:

    After Edit:

    /Rubeck



  • 9.  RE: esxcfg-route entries are not persistant ?

    Posted Jul 31, 2012 01:58 PM

    Rubeck, thanks for your help ! I tried to edit the esx.conf , did the auto-backup.sh and rebooted. But after reboot, my changes to the esx.conf is reverted !

    The static route is there, no problem, but the standardGW which i want to delete is allways been overwritten . See the part of the esx.conf im editing:

    /net/routes/kernel/gateway = "XXX.X.XXX.1" <<< seems to be the standard GW
    /net/routes/kernel/routes/child[0000]/gateway = "XXX.X.XXX.1" << the gateway to my static route
    /net/routes/kernel/routes/child[0000]/network = "XX.XXX.XX.16/32" << the static route itself
    /net/routes/kernel/routes/child[0001]/gateway = "XXX.X.XXX.9" << the ipadress of the esxi host
    /net/routes/kernel/routes/child[0001]/network = "XX.XXX.XX.0/24" << and its network

    so im just editing the first line, I tried to delete it, and I tried to change it to 127.0.0.1 as you suggested , but after reboot the line is overwritten and like before...



  • 10.  RE: esxcfg-route entries are not persistant ?

    Posted Jul 31, 2012 02:39 PM

    I did a grep in /etc and found the default GW in one more file :

    dhclient-vmk0.leases

    there it is 2 times :

    option routers XXX.X.XXX.1;

    can I delete it here , too ??



  • 11.  RE: esxcfg-route entries are not persistant ?

    Posted Aug 01, 2012 07:14 AM

    Hi again..

    You proberly can, but I do not think that will make any difference if you have a static IP address for the host configured. The file is indeed backed up by auto-backup.sh, though.

    When editing and then running the /sbin/auto-backup.sh can you verify that the /bootbank/state.tgz is updated by extracting it and see if the esx.conf in there is indeed the one currently active on the host...?

    I just set up a new ESXi 5 VM which I've fully patched, and tried editing the esx.conf ones again replacing the default gateway with 127.0.0.1. Ran auto-abackup.sh and rebooted. It still works..  Im kind of puzzled to why it isn't working for you...

    /Rubeck



  • 12.  RE: esxcfg-route entries are not persistant ?

    Posted Aug 01, 2012 09:33 AM

    hi Rubeck ,

    thanks again for you elp,

    I again changed the def GW to 127.0.0.1 in esx.conf, ran /sbin/auto-backup.sh , verified that in the state.tgz the esx.conf file is with 127.0.0.1. '( IT IS! )

    and made a reboot. after coming up, the originial def GW is restored ... grr....

    by the way whtat patches did you run in your esxi5 ? I am not shure about updatepatches..



  • 13.  RE: esxcfg-route entries are not persistant ?

    Posted Aug 01, 2012 10:12 AM

    ok I patched the Esxi to the latest patch ( from June) but nothing changed ! After reboot the original GW is restored...



  • 14.  RE: esxcfg-route entries are not persistant ?

    Posted Aug 01, 2012 10:24 AM

    Hmmm... What do the esx.conf within state.tgz look like in /altbootbank/ ? Does this still have the "old" gateway configured? If yes, could you check the Updated= value in /bootbank/boot.cfg and in /altbootbank/boot.cfg ...

    Regarding the patches I just applied the ESXi500-201207001.zip to a ESXi5 GA install...  Didn't worry to much of stuff in between as my ESXi5 is just a VM.

    /Rubeck



  • 15.  RE: esxcfg-route entries are not persistant ?

    Posted Aug 01, 2012 10:54 AM

    here the content boot.cfg:

    bootstate=0
    kernel=tboot.b00
    kernelopt=no-auto-partition
    modules=b.b00 --- useropts.gz --- k.b00 --- a.b00 --- ata-pata.v00 --- ata-pata.v01 --- ata-pata.v02 --- ata-pata.v03 --- ata-pata.v04 --- ata-pata.v05 --- ata-pata.v0
    build=5.0.0-1.18.768111
    updated=2

    altbootbank/boot.cfg:

    bootstate=0
    kernel=tboot.b00
    title=Loading VMware ESXi
    kernelopt=no-auto-partition
    modules=b.b00 --- useropts.gz --- k.b00 --- a.b00 --- ata-pata.v00 --- ata-pata.v01 --- ata-pata.v02 --- ata-pata.v03 --- ata-pata.v04 --- ata-pata.v05 --- ata-pata.v0
    build=5.0.0-469512
    updated=1

    in the tgz file, after the auto-backup.sh the gateway is set to localhost , too.

    If i use esxcfg-route -d default xxx.xxx.xxx.x then in the esx.cfg the stGW is set to 0.0.0.0. But this is restored to the original after reboot, too...

    I just considerd if I can delete the standard gw by a script which runs after everything else, it would be ok for me. How can I configure such a script?

    I entered this in the rc.local, but this doesnt work ...

    ... and if there is no script where to put this in, than maybe I can use something like a cronjob/scheduler where I can delete the standardgw every minute :smileywink:

    thanks for help...

    cheers

    Filip



  • 16.  RE: esxcfg-route entries are not persistant ?

    Posted Aug 02, 2012 07:42 AM

    Ok, seems that my latests post from yesterday is lost ... strange ...

    ok here we go again:

    I verified today the bootbank/state.tgz and altbootbank/state.tgz

    in  the bootbank tgz I have the same gateway like in /etc/vmware ! "0.0.0.0"

    but in the altbootbank I have the original GW.

    I figured out one thing: If I delete the def GW by esxcfg-route -d default xxx.xxx.xxx.xxx

    then the entry in the esx.conf is changed to "0.0.0.0". But after reboot, its gone ..

    here my /altboobank/boot.cfg:

    bootstate=0
    kernel=tboot.b00
    title=Loading VMware ESXi
    kernelopt=no-auto-partition
    modules=b.b00 --- useropts.gz --- k.b00 --- a.b00 --- ata-pata.v00 --- ata-pata.v01 --- ata-pata.v02 --- ata-pata.v03 --- ata-pata.v04 --- ata-pata.v05 --- ata-pata.v0
    build=5.0.0-469512
    updated=1



  • 17.  RE: esxcfg-route entries are not persistant ?

    Posted Jul 31, 2012 12:33 PM

    Routes added should be persistant across reboots as these are written to esx.conf..

    I 've added a few to a dummy ESXi5 VM I have here on my laptop... I did a save, and rebooted... When it came up, I noticed the esxcfg-route -l didn't display these new routes..?!

    This is what I added:

    esxcfg-route -a 7.7.7.7/32 192.168.111.243

    esxcfg-route -a 8.8.9.9/32 192.168.111.3

    I checked esx.conf and noticed something funky...

    cat /etc/vmware/esx.conf | grep -i /routes/child

    /net/routes/kernel/routes/child[0000]/gateway = "192.168.111.23" 
    /net/routes/kernel/routes/child[0001]/gateway = "192.168.111.3"
    /net/routes/kernel/routes/child[0001]/network = "8.8.9.9/32"
    /net/routes/kernel/routes/child[0003]/gateway = "192.168.111.243"
    /net/routes/kernel/routes/child[0003]/network = "7.7.7.7/32"

    Where did the 0000 child come from? It has the line /network= missing.

    I did not edit esx.conf before until today in this VM...

    I deleted the entry and edited it so I would end up with child 0001 and 0002 only:

    /net/routes/kernel/routes/child[0001]/gateway = "192.168.111.3"

    /net/routes/kernel/routes/child[0001]/network = "8.8.9.9/32"

    /net/routes/kernel/routes/child[0002]/gateway = "192.168.111.243"

    /net/routes/kernel/routes/child[0002]/network = "7.7.7.7/32"

    Saved and rebooted.... now the esxcfg-route -l displays them just fine:

    esxcfg-route -l

    VMkernel Routes:

    Network          Netmask          Gateway          Interface

    7.7.7.7          255.255.255.255  192.168.111.243  vmk0

    8.8.9.9          255.255.255.255  192.168.111.3    vmk0

    192.168.111.0    255.255.255.0    Local Subnet     vmk0

    192.168.112.0    255.255.255.0    Local Subnet     vmk1

    default          0.0.0.0          192.168.111.2    vmk0

    Maybe something like this is might be your issue too....? Some weird entry in esx.conf?

    /Rubeck