Restricting Mirrors Off A Repo
What is the best way to specify which mirrors off a repository you want to use? Have a host with rather restricted egress rules and want to allow it to reach a couple of mirrors for each repo it needs. And, yes, I am not ready to mirror them locally.
2 thoughts on - Restricting Mirrors Off A Repo
specify a mirror directly in the /etc/yum.repos.d/CentOS-*.repo files, using baseurl= instead of mirrorlist or, to be trickier [1] you could have mirrorlist.CentOS.org in your local DNS point to a local http server which has entries like…
http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os
containing (for example)
http://CentOS.mirror.lstn.net/6/os/x86_64/
http://mirror.n5tech.com/CentOS/6/os/x86_64/
http://mirrors.xmission.com/CentOS/6/os/x86_64/
http://www.gtlib.gatech.edu/pub/CentOS/6/os/x86_64/
http://mirrors.rit.edu/CentOS/6/os/x86_64/
http://repos.lax.quadranet.com/CentOS/6/os/x86_64/
http://ftpmirror.your.org/pub/CentOS/6/os/x86_64/
http://repo1.ash.innoscale.net/CentOS/6/os/x86_64/
http://mirrors.maine.edu/CentOS/6/os/x86_64/
http://mirror.fileplanet.com/CentOS/6/os/x86_64/
You can do this many was .. if the mirrors you want to use are always the same, you can just remark out the mirrorlist line and use more than one baseurl, like this in your .repo file:
baseurl=http://192.168.0.5/CentOS/$releasever/os/$basearch/
http://192.168.0.10/CentOS/$releasever/os/$basearch/
(in case this wraps .. each url can be seperated by white space and only one baseurl=)
You can also, if you want, write your own mirrorlist providing app ..