Setup network on CentOS / Red Hat
Some explanations about “vi”
“vi” is probably the most used text editor on Unix, this is a great tool but not easy to use if this is the first time that you play with it. When you start “vi” you’re entering an interactive mode that needs a command to interact with the text. In this post we will use this commands (keys) only :
– “i” : “Insert mode”, it’s used to modify the text like other text editor
– “dd” : Command to delete an entire line
– “:” : To enter specific command
– “wq” : Command to save and exit vi
– “ESC” : Will exit mode like “Insert”
Configure IP address :
To configure the IP address you need to edit the file ifcfg-eth0 :
vi /etc/sysconfig/network-scripts/ifcfg-eth0
– Move the prompt to the line “BOOTPROTO=”dhcp”
– Press two times the key “d” to delete the entire line
– Enter the insert mode by pressing the “i” key
– Go to the line “ONBOOT” and change “no” to “yes”
– Go at the end of the file and add these three new lines with the correct settings (delete the characters < >) :
IPADDR=<IP address> NETMASK=<Subnet mask> GATEWAY=<IP of the router>
– Exit the “Insert mode” by pressing the “ESC” key. Your file should look like this :
– Press the key “:” and enter the command “wq” to write the file and quit vi. The command appears at the bottom left of the screen. If you want to quit the file without saving, you can use the command :q!.
– Now you need to reload the network service by typing :
service network restart
– Try to ping your router to be sure that your settings are correct :
[root@localhost ~]# ping 192.168.99.1 PING 192.168.99.1 (192.168.99.1): 56 data bytes 64 bytes from 192.168.99.1: icmp_seq=0 time=4.794 ms 64 bytes from 192.168.99.1: icmp_seq=1 time=3.982 ms 64 bytes from 192.168.99.1: icmp_seq=2 time=3.938 ms
Configure DNS servers :
To configure the DNS servers you need to edit the file resolv.conf (The file resolv.conf is empty by default) :
vi /etc/resolv.conf
– Press the “i” key to enter in “Insert mode”
– Add these three lines that correspond to your network settings (delete the characters < >) :
search <Search domain> nameserver <Primary DNS server IP> nameserver <Secondary DNS server IP>
– Exit the “Insert mode” by pressing the “ESC” key. Your file should look like this :
– Press the key “:” and enter the command “wq” to write the file and quit vi. The command appears at the bottom left of the screen. If you want to quit the file without saving, you can use the command :q!.
– Now you need to reload the network service by typing :
service network restart
– Try to ping something to be sure that your settings are correct :
[root@localhost ~]# ping www.centos.org PING www.centos.org (72.232.194.162): 56 data bytes 64 bytes from 72.232.194.162: icmp_seq=0 time=164.180 ms 64 bytes from 72.232.194.162: icmp_seq=1 time=166.716 ms 64 bytes from 72.232.194.162: icmp_seq=2 time=167.061 ms
Now that the network is configured, you can reach your new server by ssh to continue the installation. It’s not mandatory, but it will be easier for some commands.
– If you’re using Red Hat Enterprise Linux, you need to register your installation to install software by running this command :
rhn_register
Add tools/updates :
Before installing Reposado/Margarita, it’s important to update our fresh install with the last system patches and to add a few tools (It is necessary to validate the installation by “yes” when prompted).
– Update the CentOS / Red Hat installation to the last versions :
yum update
– Install “git” to download the sources of Reposado and Margarita :
yum install git
– Install “httpd”, the Apache web server used to share the updates to clients :
yum install httpd
– Install “vixie-cron”, the scheduler of all unix used to sync Reposado with all update servers every night :
yum install vixie-cron
– Install “python-setuptools”, some tools needed to install Margarita :
yum install python-setuptools
Set the correct time :
– Install “ntp” to configure the time :
yum install ntp
– Set the local date and time by polling the NTP server :
ntpdate ch.pool.ntp.org
– Check if the time is correct :
date
– To keep your server in time, you can enable the NTP service :
service ntpd start chkconfig ntpd on
I just wanted to say thank you for this tutorial. It’s one the best I’ve seen.
absolutely beautiful howto guide – worked perfectly
also, per the instructions here, i added a .htaccess file to the directory /var/local/reposado/html
with instructions found here:
https://github.com/wdas/reposado/blob/master/docs/URL_rewrites.txt
so as i only needed to put the catalogURL as http://example.com/index.sucatalog on client machines and the apache2 mod_rewrite engine on the reposado box figured out which index to send it to regardless of version of the macosx client
again, thank you for this wonderful page.
Thank you for your information that completes the guide !
I was curious if you have found a way to secure this with .htaccess? I have so far been unsuccessful. Margarita doesn’t respect the the file.
Thanks for this tutorial.
The standard command to configure the client is:
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL
failure: repodata/c7c64887b23d8a76ac7d8b0b4a2673a3e832963c948a8700c8647f4fa8bbd339-primary.sqlite.bz2 from updates: [Errno 256] No more mirrors to try.
problem connecting to softer sources
plz help me in this regards
thank u
This is not the correct place to get support. You can get help through the Google Group for Reposado:
https://groups.google.com/forum/#!forum/reposado
Brilliant work here…a single run through the setup process on Centos 6.5 resulted in a fully working reposado + margarita configuration.
Thank you for providing such a detailed walkthrough.
I am not familiar with reposado but we have working outdated reposado and just wonder how can I update so the yosemette and elcapitan clients can update from?
Sorry for the delay, but the better way to get support is to contact directly the newsgroups of the projects.
There’s a problem with CentOS Curl and downloading El Capitan updates. (Error 59: Unknown cipher in list: HIGH)
I thought I’d share this fix here:
https://groups.google.com/forum/#!topic/reposado/_fUl1n3uPq8
I’ve used these directions many times. I’ve never left a comment but these posted directions worked flawless. Thank You!