Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Install Rancid - GitLab - Centos

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 4

inspired by:

https://goldstein-solutions.com/rancid-centos8/

vi /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
NM_CONTROLLED="no"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="fa0c8b08-2c6b-49da-a501-d2f2d3e6810d"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=192.168.43.199
NETMASK=255.255.255.0
GATEWAY=192.168.43.1

vi /etc/sysconfig/network
NETWORKING="yes"
DNS1=8.8.8.8
DNS=8.8.4.4

rpm -qd initscripts

Ifconfig
[root@localhost ttimco]# yum install net-tools.x86_64

[root@localhost ttimco]# ifconfig


ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.43.199 netmask 255.255.255.0 broadcast 192.168.43.255
inet6 fe80::20c:29ff:fe68:d52f prefixlen 64 scopeid 0x20<link>
inet6 2a04:cec0:11b4:9bdc:20c:29ff:fe68:d52f prefixlen 64 scopeid
0x0<global>
ether 00:0c:29:68:d5:2f txqueuelen 1000 (Ethernet)
RX packets 2510 bytes 654316 (638.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3102 bytes 234175 (228.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536


inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Boucle locale)
RX packets 1247 bytes 132468 (129.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1247 bytes 132468 (129.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

yum install -y diffutils perl tcl expect git gcc make postfix wget httpd mod_ssl
nano ftp php-common php-gd php-pear php-pecl-memcache php-mysql php-xml mod_ssl
MySQL-python
useradd rancid
wget ftp://ftp.shrubbery.net/pub/rancid/rancid-3.13.tar.gz -P /tmp
tar zxvf /tmp/rancid-3.13.tar.gz -C /tmp/
cd /tmp/rancid-3.13
./configure --prefix=/opt/rancid --localstatedir=/opt/rancid --with-git --
host=localhost
make && make install

touch /opt/rancid/.cloginrc
chown -R rancid:rancid /opt/rancid/
chmod 0600 /opt/rancid/.cloginrc

nano /opt/rancid/.cloginrc
add autoenable * 1
add method * ssh
add user * manager
add password * friend

nano /opt/rancid/etc/rancid.conf
LIST_OF_GROUPS="Switches Firewall"; export LIST_OF_GROUPS
RCSSYS=git; export RCSSYS

ln -s /opt/rancid/.cloginrc /home/rancid/
chmod -R 750 /opt/rancid/*
chmod 0600 /opt/rancid/.cloginrc

su - rancid
/opt/rancid/bin/rancid-cvs

nano /opt/rancid/Switches/router.db
Sw_x510-28GTX.0.BPL;cisco;up

nano /etc/hosts
192.168.43.254 Sw_x510-28GTX.0.BPL SW-BPL-00

su rancid
[rancid@localhost rancid-3.13]$ /opt/rancid/bin/clogin -f /opt/rancid/.cloginrc
Sw_x510-28GTX.0.BPL

-----------------------------------------------------------------------------------
---------------------------------
spawn ssh -x -l manager sw_x510-28gtx.0.bpl
The authenticity of host 'sw_x510-28gtx.0.bpl (192.168.43.254)' can't be
established.
ECDSA key fingerprint is SHA256:Q9H7O2UWStASCeqoyI8kx8YowjIsWixXB5CY8VKoDuc.
ECDSA key fingerprint is MD5:b6:1b:62:f4:3e:13:d0:a1:8f:12:da:d2:69:22:38:95.
Are you sure you want to continue connecting (yes/no)?
Host sw_x510-28gtx.0.bpl added to the list of known hosts.
yes
Warning: Permanently added 'sw_x510-28gtx.0.bpl,192.168.43.254' (ECDSA) to the list
of known hosts.

**************************************************************
* *
* Vous accedez a un systeme classifie de defense, ce qui *
* implique que vous possedez le niveau d'habilitation requis.*
* *
* Tout acces ou tentative d'acces non autorise fera l'objet *
* de poursuites tant disciplinaires que penales (art 410-1, *
* 411-1 a 414-9,323-1 a 323-7 du code penal). *
* *
**************************************************************
Password:
Last login: Tue Oct 11 16:06:59 UTC 2022 from 192.168.43.199
AlliedWare Plus (TM) 5.5.1 11/30/21 05:37:47

-----------------------------------------------------------------------------------
----------------------------------

https://linuxize.com/post/how-to-install-and-configure-gitlab-on-centos-7/

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/
script.rpm.sh | sudo bash

sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee

initial password:
EOqAs6UCWpuNffx+oJSfKl+YCobbbTXuHsNzg+IuXxQ=

su - rancid
/opt/rancid/bin/rancid-run

git push --set-upstream git@192.168.43.197:ttimco/$(git rev-parse --show-toplevel |


xargs basename).git $(git rev-parse --abbrev-ref HEAD)

git remote add origin


http://192.168.43.197/gitlab-instance-30e5c1a9/test_rancid.git
cd {device group}
git remote rename origin old-origin
git remote add origin
http://192.168.43.197/gitlab-instance-30e5c1a9/test_rancid.git
git push -u origin --all

remote origin already exists.


Serveur apache

systemctl enable httpd


systemctl daemon-reload
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
usermod -g apache rancid

nano /etc/gitweb.conf
our $projectroot = "/opt/rancid/Switches";

nano /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/git"

http://IP_server/git
S�curiser le syst�me

Maintenant que nous avons un syst�me qui peut se connecter � n'importe quel
appareil Cisco sur notre r�seau,
nous devons configurer au moins une s�curit� rudimentaire.
Au minimum, nous voulons chiffrer les communications client/serveur avec TLS et
configurer l'authentification frontale de base.
Bien que la g�n�ration et la r�cup�ration d'un certificat SSL d�passent largement
le cadre de cet article, une fois que vous les aurez, vous t�l�chargerez le
certificat sur /etc/pki/tls/certs/ et la cl� priv�e sur /etc/pki/tls/ priv�/

Une fois vos certificats en place, nous devons en informer Apache.


De plus, nous configurerons le serveur Web pour exiger un cryptage fort lorsque les
clients se connectent.
Mettez � jour /etc/httpd/conf.d/ssl.conf, en vous assurant que les directives
suivantes ne sont pas comment�es et configur�es avec les param�tres corrects
(notez que dans un environnement de d�veloppement, vous pouvez omettre les deux
derni�res directives de l'extrait ci-dessous, auquel cas Apache utilisera un
certificat auto-sign�) :

You might also like