If you’ve done any syslog configuration on a router, then you’re probably used to setting the syslog server with:
Rack1R2(config)#logging 1.2.3.4
If you’ve looked a little closer at the logging commands, you’ve probably noticed that there is also a ‘logging host’ command. So what is the difference between using ‘logging x.x.x.x’ and ‘logging host x.x.x.x’? It turns out that there is no difference*
Rack1R2(config)#logging 1.2.3.4
Rack1R2(config)#logging host 5.6.7.8
Rack1R2(config)#do sh run | i logging
logging 1.2.3.4
logging 5.6.7.8
* As long as you don’t add additional configuration after the IP Address with the ‘logging host’ command
You can use either
Rack1R2(config)#logging host 1.1.1.1 transport tcp port 666
Rack1R2(config)#do sh run | i logging
logging host 1.1.1.1 transport tcp port 666
The one thing you need to keep an eye out for is that once you’ve configured the “Syslog of the Beast”, if you then configure ‘logging 1.1.1.1′ or ‘logging host 1.1.1.1′ by accident, you’ll blow away your existing logging host configuration:
Rack1R2(config)#logging host 1.1.1.1
Rack1R2(config)#do sh run | i logging
logging 1.1.1.1
Command reference: logging host
Thanks for this post.. I was google for finding the difference..
Comment by Thameem — June 21, 2011 @ 1:11 am |