[Ninux-Calabria] Seminario su CORE

Vincenzo Pirrone linuspax a gmail.com
Lun 16 Dic 2013 13:10:47 UTC


> E' sufficiente dare le basi per proporre un'alternativa a packet tracer di Cisco, ovvero avere un software in cui simulare dei router (e degli switch managed?) 

Mi sa che per gli switch managed non si può fare nulla su CORE :(


Il 15/12/2013 22:19, Giuseppe De Marco ha scritto:
> Con CORE hai un sistema di virtualizzazione, pertanto fai veramente
> tutto usando linux-hosts.
> Questi "lxc" hanno tutti i programmi del pc host.
> 
> Secondo me è il sistema migliore per imparare le reti, mi sta appassionando.
> 
> Ne approfitto per postare un Service customizzato.
> Lo uso per creare le antenne in bridge così come usate da noi in ninux
> 
> 
> </home/user/.core/myservices/ninucs.py>
> 
> #
> # CORE - ninux cosenza services
> #
> 
> ''' 
> ninucs.py: ninux cosenza services
> '''
> 
> import os
> 
> from core.service import CoreService, addservice
> from core.services.utility import UtilService
> from core.constants import *
> 
> class CPE_Bridge(CoreService):
>     ''' 
>     '''
>     _name = "CPE_Bridge"
>     _group = "Ninux"
>     _configs = ('bridge.sh', )
>     _startindex = 60
>     _startup = ('sh bridge.sh',)
> 
>     @classmethod
>     def generateconfig(cls, node, filename, services):
>         ''' 
>         '''
>         
>         print filename
>         
>         cfg = """#!/bin/bash
> brctl addbr br0
> brctl addif br0 eth0
> brctl addif br0 eth1
> ip link set dev br0 up
> 
> export ETH0=$(/sbin/ip addr show eth0 | head -3 | tail -1 | awk -F' '
> {'print $2'})
> export ETH1=$(/sbin/ip addr show eth1 | head -3 | tail -1 | awk -F' '
> {'print $2'})
> 
> ifconfig eth0 0.0.0.0
> ifconfig eth1 0.0.0.0
> ifconfig br0  $ETH0
>         """
>         #""" % { 'bridge_addr': node.getaddr('eth0', rescan=1)['inet'][0] }
>         
>         return cfg
> 
> # this line is required to add the above class to the list of available
> services
> addservice(CPE_Bridge)
> 
> </end> 
> 
> in /home/user/.core/nodes.conf  ho aggiunto:
> 7 { ninux_antenna router_green.gif router_black.gif {IPForward
> CPE_Bridge} netns {} }
> 
> e in /etc/core/core.conf ho decommentato la seguente linea:
> 
> custom_services_dir = /home/user/.core/myservices
> 
> oppelà.
> Adesso sto studiando bene lo switch di openwrt per riprodurre un
> servizio che integra olsr sulle vlan, perchè ci sono alcuni aspetti sul
> tagged/untagged misti allo schema proposto da spax che devo studiare
> 

E sei un grande



-- 
Vincenzo Pirrone
Twitter: @spax_arm
PGP Key ID: 5CF5047D

-------------- parte successiva --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://ml.ninux.org/pipermail/calabria/attachments/20131216/8f7e4701/attachment.pgp>


Maggiori informazioni sulla lista Calabria