반응형

 

OVS로 VLAN network를 구성하고 테스트해볼까 생각했는데, 이미 다른 분이 아주 상세하게 테스트한 내용을 잘 적어놓았네 ^^

 

 

https://m.blog.naver.com/love_tolty/222609033937

 

라즈베리파이3에 Open vSwitch(OVS) 설치/OVS 네트워크 구성/ONOS로 직접 Flow Rule 설정하여 VLAN 패킷 제어

자! 지난 포스팅에서는 Mininet기반 가상 네트워크 환경에서 ONOS로 간단히 Host간 통신이 되도록 F...

blog.naver.com

 

반응형

 

C language, Go(Golang), Netfilter, Netlink를 이용하여 Linux network을 제어하고 모니터링하는 방법을 알아보자~

 

 

개념 이해하기: Netfilter hooks into Linux networking packet flows

The following schematic shows packet flows through Linux networking:

 

From:  https://wiki.nftables.org/wiki-nftables/index.php/Netfilter_hooks

 

 


Linux Netfilter + C example code

참고 문서:   https://pr0gr4m.github.io/linux/kernel/netfilter/
  이론 설명과 함께 잘 동작하는 예시가 있어서 쉽게 이해할 수 있다.
  아래는 위 블로그의 끝 부분에 있는 HTTP Traffic만 선별하여 Drop하는 예제 코드인데,
  그냥 이 예제 코드만 봐도 이해할 수 있을 것이다.

 

http_netfilter.c

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/netdevice.h>

static unsigned int hook_http(void *priv,
		struct sk_buff *skb, const struct nf_hook_state *state)
{
	struct iphdr *iph;
	struct tcphdr *th;
	char *data = NULL;
	int length = 0;
	
	if (!skb)
		return NF_ACCEPT;

	iph = ip_hdr(skb);

	if (iph->protocol == IPPROTO_TCP) {
		th = tcp_hdr(skb);

		length = skb->len - iph->ihl * 4 - th->doff * 4;
		if (length <= 4)
			return NF_ACCEPT;

		data = kzalloc(length, GFP_KERNEL);
		memcpy(data, (unsigned char *)th + th->doff * 4, length);

		if (strstr(data, "HTTP") != NULL) {
			printk("[Kernel:%s] HTTP Detected\n", __func__);
			kfree(data);
			return NF_DROP;
		}

		kfree(data);
	}

	return NF_ACCEPT;
}

static struct nf_hook_ops *nf_ops = NULL;

static int __init nfilter_init(void)
{
	nf_ops = (struct nf_hook_ops *)kzalloc(sizeof(struct nf_hook_ops), GFP_KERNEL);
	nf_ops->hook = (nf_hookfn *)hook_http;
	nf_ops->pf = PF_INET;
	nf_ops->hooknum = NF_INET_LOCAL_IN;
	nf_ops->priority = NF_IP_PRI_FIRST;

	nf_register_net_hook(&init_net, nf_ops);
	printk("[Kernel:%s] NFilter Init\n", __func__);
	return 0;
}

static void __exit nfilter_exit(void)
{
	nf_unregister_net_hook(&init_net, nf_ops);
	kfree(nf_ops);
	printk("[Kernel:%s] NFilter Exit\n", __func__);
}

module_init(nfilter_init);
module_exit(nfilter_exit);
MODULE_LICENSE("GPL");

 

Makefile

obj-m += http_netfilter.o

KDIR := /lib/modules/$(shell uname -r)/build

default:
	$(MAKE) -C $(KDIR) M=$(PWD) modules

CC := gcc

%.c%:
	${CC} -o $@ $^

clean:
	$(MAKE) -C $(KDIR) M=$(PWD) clean
	rm -f ${TARGETS}

 

Build & Test

##
## HTTP Server 장비에서 아래 명령을 수행.
##

$ make

$ sudo insmod http_netfilter.ko

$


---

##
## 다른 PC에서 아래와 같이 HTTP Traffic을 발생시켜본다.
##
$ curl -v http://my-test.server.domain/

*   Trying my-test.server.domain:80...
* Connected to my-test.server.domain port 80 (#0)
> GET / HTTP/1.1
> Host: my-test.server.domain
> User-Agent: curl/7.77.0
> Accept: */*
> ##
## TCP Session만 수립될 뿐, 
## 실제 HTTP Response 패킷을 받지 못해서 이 상태로 계속 남아있다가 Timed out 처리된다.
##
* Recv failure: Operation timed out
* Closing connection 0
curl: (56) Recv failure: Operation timed out
$


---

##
## HTTP Server 장비에서 아래 명령을 수행.
##

$ dmesg --color --follow
... 중간 생략 ..
[264707.035282] [Kernel:hook_http] HTTP Detected
[264711.387549] [Kernel:hook_http] HTTP Detected
... 중간 생략 ..

 

 

 

 

 

 


Netlink for C language

Wikipedia

Netlink Protocol Library Suite (libnl)

Core Library Developer's Guide (libnl)

Routing Library Developer's Guide (libnl-route)

Example Collection

 

 

 

위 문서를 읽고 나서, 아래 예제를 테스트하면서 이해하기.

$  cat detect_chg_event.c


/**
 * How to build
 *   $  gcc -o detect_chg_event detect_chg_event.c
 * How to run
 *   $  ./detect_chg_event
 */

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <ifaddrs.h>
#include <net/if.h>
#include <netdb.h>
#include <netinet/in.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>


static int
create_sock (const char *nic)
{
    struct sockaddr_nl addr;
    int                sock;

    memset (&addr, 0, sizeof (addr));
    addr.nl_family = AF_NETLINK;
    addr.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR;

    sock = socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
    if (sock < 0)
    {
        fprintf (stderr, "failed to open NETLINK_ROUTE socket for %s - %s(%d)",
                nic, strerror (errno), errno);
        return -1;
    }

    if (bind (sock, (struct sockaddr *)&addr, sizeof(addr)) < 0)
    {
        fprintf (stderr, "failed to bind NETLINK_ROUTE socket for %s - %s(%d)",
                nic, strerror (errno), errno);
        close (sock);
        return -1;
    }

    return sock;
}


/**
 * NOTE: Cheeck if NIC status is changed
 */
static int
ip_changed (int         sock,
			const char *nic)
{
    struct nlmsghdr   *nlh;
    char               buffer[4096];
    int                len;
    int                idx;
    int                found;

    len = recv (sock, buffer, sizeof (buffer), 0);
    if (len <= 0)
    {
        fprintf (stderr, "NETLINK_ROUTE socket recv() failedn");
        return -1;
    }

    printf("\n %s %s(%d) Receive message from raw socket \n",
            __func__, __FILE__, __LINE__);

    found = 0;
    idx = if_nametoindex (nic);

    printf("\n %s %s(%d) Index of %s: %d \n",
            __func__, __FILE__, __LINE__, nic, idx);

    for (	nlh = (struct nlmsghdr *) buffer;
            NLMSG_OK (nlh, len);
            nlh = NLMSG_NEXT (nlh, len))
    {
        if (nlh->nlmsg_type == NLMSG_DONE)
            break;
        if (nlh->nlmsg_type == NLMSG_ERROR)
            continue;
        if (!(NLMSG_OK (nlh, len)))
            continue;

        printf("\n %s %s(%d) Netlink MSG Type: %d\n",
                __func__, __FILE__, __LINE__, nlh->nlmsg_type);

        /*
         * NOTE:
         *   RTM_NEWADDR, RTM_NEWLINK 에 관한 정의는 rtnetlink.h 파일에서 확인할 수 있다.
         *     - /usr/include/linux/rtnetlink.h
         */
        switch (nlh->nlmsg_type)
        {
            case RTM_NEWADDR:
                {
                    struct ifaddrmsg *ifa = (struct ifaddrmsg *)NLMSG_DATA (nlh);

                    if (ifa->ifa_index == idx)
                        found = 1;
                }
                break;
            case RTM_NEWLINK:
                {
                    struct ifinfomsg *ifi = (struct ifinfomsg *)NLMSG_DATA (nlh);

                    if (ifi->ifi_index == idx)
                        found = 1;
                }
                break;
            default:
                break;
        }
    }

    return found;
}


static int
get_nic_addr (  const char     *nic,
				struct ifaddrs *ifaddr,
				int             wanted_family,
				char           *host,
				int             host_len,
				int            *active)
{
    struct ifaddrs *ifa;

    for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next)
    {
        int family;
        int s;

        if (ifa->ifa_addr == NULL)
            continue;

        if (strcmp (ifa->ifa_name, nic))
            continue;

        /* Skip unwanted families. */
        family = ifa->ifa_addr->sa_family;
        if (family != wanted_family)
            continue;

        *active = (ifa->ifa_flags & IFF_RUNNING) ? 1 : 0;

        s = getnameinfo (   ifa->ifa_addr,
                            family == AF_INET ? sizeof (struct sockaddr_in) :
                            sizeof (struct sockaddr_in6),
                            host,
                            host_len,
                            NULL,
                            0,
                            NI_NUMERICHOST);
        if (s != 0)
        {
            fprintf (stderr, "failed to getnameinfo() for '%s - %s(%d)",
                    ifa->ifa_name, strerror (errno), errno);
            continue;
        }

        /* Get the address of only the first network interface card. */
        return 1;
    }

    return 0;
}


static void
print_ip (const char *nic)
{
    struct ifaddrs *ifaddr;
    char            addr[NI_MAXHOST];
    int             active;

    printf("\n %s(%d) nic: %s \n",
            __FILE__, __LINE__, nic);

    if (getifaddrs (&ifaddr) == -1)
    {
        fprintf (stderr, "failed to getifaddrs() - %s(%d)", strerror (errno), errno);
        return;
    }

    // NOTE: IPv4
    if (!get_nic_addr (nic, ifaddr, AF_INET, addr, sizeof (addr), &active))
    {
        // If IPv4 configuration is not available,
        // then try to get the Ipv6 configuration.
        printf("\n %s(%d) nic: %s  addr: %s  active: %d \n",
                __FILE__, __LINE__, nic, addr, active);
        // NOTE: IPv6
        if (!get_nic_addr (nic, ifaddr, AF_INET6, addr, sizeof (addr), &active))
        {
            // Nothing to do.
            strcpy (addr, "127.0.0.1");
            active = 0;
        }
    } else {
        printf("\n %s(%d) nic: %s  addr: %s  active: %d \n",
                __FILE__, __LINE__, nic, addr, active);
    }

    freeifaddrs (ifaddr);

    printf("\n %s %s(%d) %s is %s (link %s) \n",
            __func__, __FILE__, __LINE__,
            nic, addr, active ? "active" : "inactive");
}


int
main (void)
{
    // FIXME: enp7s0 --> my machine's network interface name
    char *nic = "enp7s0";
    int   sock;

    print_ip (nic);

    sock = create_sock (nic);
    if (sock < 0)
        return -1;

    while (1)
    {
        int ret;

        ret = ip_changed (sock, nic);
        if (ret < 0)
            return -1;

        if (ret)
            print_ip (nic);

        printf("\n\n %s %s(%d) END OF LOOP \n\n\n",
                __func__, __FILE__, __LINE__);
    }

    close (sock);

    return 0;
}


$

$  gcc -o detect_chg_event detect_chg_event.c

$  ./detect_chg_event

ip_changed detect_chg_event.c(73) Receive message from raw socket

 ip_changed detect_chg_event.c(79) Index of enp7s0: 2

 ip_changed detect_chg_event.c(93) Netlink MSG Type: 16

 detect_chg_event.c(181) nic: enp7s0

 detect_chg_event.c(205) nic: enp7s0  addr: 10.1.4.51  active: 1

 print_ip detect_chg_event.c(211) enp7s0 is 10.1.4.51 (link active)


 main detect_chg_event.c(239) END OF LOOP
 
 ...
 ...

 

위 예제에서 detect_chg_event 명령을 실행시켜 놓고, 아래와 같이 명령을 실행해본다.

$  ifconfig  enp7s0  mtu 1501
$  ifconfig  enp7s0  mtu 1500
$  ifconfig  enp7s0  down
$  ifconfig  enp7s0  up

detect_chg_event 예제 앱이 enp7s0 장치의 상태 변화를 감지해서 터미널에 감지한 내용을 출력해줄 것이다.

 

Netlink library for go

https://github.com/vishvananda/netlink

 

 


 

 

https://tomdnetto.net/post/linux_networking_from_go_nftables

 

Linux Networking From Go

Manipulating network interfaces, firewalling, and forwarding from Go.

tomdnetto.net

 

 

https://tomdnetto.net/post/advanced_nftables_with_go

 

Advanced NFTables With Go

NFTables like your mama taught you.

tomdnetto.net

 

 

 

반응형

 

참고할 문서

CISCO SDN  (www.oss.kr에서 download한 pdf 문서)

https://www.oss.kr/editor/file/3bd27047/download/99fb53a9-31c4-46f9-91ad-79eeaa927f16

위 문서에서 중요한 부분만 발췌한 내용 (아래)

Application Centric Infra (CISCO)

 

 

ACI VMM 아키텍처 - Openstack Neutron ML2

 

 


 

 

ACI & Kubernetes – The Cisco K8s CNI

CISCO ACI와 Kubernetes 조합으로 Network를 구성하고 싶다면, 아래  Documents를 참고할 것.

 

ACI & Kubernetes - The Cisco K8s CNI (Part One) - Haystack Networks

A look and review of the integration between Cisco ACI, Kubernetes and the Cisco K8 CNI.

haystacknetworks.com

 

 

 

Enable Consistent Application Services for Containers

Seamless developer experience intended to maintain the simplicity of Kubernetes while still enabling advanced capabilities within the Cisco ACI fabric, and maintaining application availability, security, and visibility across the infrastructure.

blogs.cisco.com

 

YouTube 영상: Kubernetes integration with CISCO ACI

 

 

 

 

ACI Networking Plugin for Kubernetes

https://pubhub.devnetcloud.com/media/netdevops-live/site/files/s01t07.pdf

 

 

 

ACI CNI Plugin (GitHub Source Code)

 

 

GitHub - noironetworks/aci-containers: Plugins for integrating ACI with container orchestration systems

Plugins for integrating ACI with container orchestration systems - GitHub - noironetworks/aci-containers: Plugins for integrating ACI with container orchestration systems

github.com

 

 

 

 

EPG, Contract, AP(Application Profile), BD(Broadcast Domain) 등 개념이 머릿속에 잘 그려지지 않아서 

이런 개념을 Use Case로 그린 Diagram만 우선 보고자 한다.

 

Cisco ACI Multi-Site Architecture White Paper (2021-11-23)

 

Cisco Application Centric Infrastructure - Cisco ACI Multi-Site Architecture White Paper

Cisco Application Centric Infrastructure (Cisco ACI) as a pervasive fabric technology, enterprises and service providers commonly need to interconnect separate Cisco ACI fabrics.

www.cisco.com

 

 

Cisco Application Centric Infrastructure - White Papers

Cisco Application Centric Infrastructure - white papers

www.cisco.com

 

 

EPGs and Preferred Groups

 

 

Referencing objects across templates and across schemas

 

Specific strat egy to define templates inside a schema

 

Layer 3 intra-V RF Layer 3 communication across sites

 

 

Intra-VRF Layer 3 communication across sites stretching an EPG

 

Layer 3 inter-VRF communication across sites

 

Inter-VRF communication across sites (shared services)

 

Interconnecting Cisco ACI fabrics for Layer 3 communication via L3Outs

 

Initial state: layer 3 intersite communication using the L3Out path

 

Issue when mixing VXLAN and L3Out traffic paths

 

 

Use cases for integrating Cisco ACI Multi-Pod and Cisco ACI Multi-Site

 

Single network infrastructure offering both IPN and ISN connectivity

 

Hierarchical MP -BGP EVPN peering

 

Multi-Site and traditional L3Out connections on border leaf nodes

 

Use of a stretched external EPG (Ext-EPG)

 

 

Multi-Site and traditional L3Out connections with a stretched bridge domain

 

Cisco ACI EPG-based network model

 

 

An example of stretched application between on-premises Cisco ACI and cloud sites

 

 

An example of stretched EPGs across sites

 

An example of intersite shared services

 

 

An example of Cloud L3Out

 

An example of On-Premises L3Out for cloud endpoints

 

 

On-premises service chaining for a stretched application tier

 

 

 

 

Cisco ACI policy model (Tenant, VRF, BD, EPG, EndPoint, Taboo, Contracts, Pod, Path, Node)

 

 

 

 

반응형

 


작성일: 2023년 10월 15일

 


[ 강의 동영상 ]
계영수 님이 GNS3 강의 동영상을 만든지 4년이 지나서 지금 GNS3 버전과 GUI 구성이 조금 달라서 헷갈릴 수 있지만,
이 동영상이 큰 도움이 된다.

  https://www.youtube.com/playlist?list=PL30o9a_lTg-KN4UmwKj2txuY3Vrd1nMrx

 

 


GNS3 및 CISCO Switch 명령 예제 모음

 

 

테스트할 때마다 사용하는 명령을 명령어 수행 순서대로 기록해보았다.

 

 

CISCO Switch Port에 IP Address 설정하기

##
## CISCO Switch Port에 IP Address 설정하기
## 

R1# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)# interface fastEthernet 0/0

R1(config-if)# ip address 10.1.1.1 255.255.255.0

R1(config-if)# no shutdown 

R1(config-if)# end
*Jul  2 21:14:42.231: %SYS-5-CONFIG_I: Configured from console by console

R1# ping 10.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/30/68 ms

R1#

 

 

CISCO Switch Loopback Port에 IP Address 설정하기

R1# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)# interface loop0
R1(config-if)#
*Jul  3 12:59:03.859: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

R1(config-if)# ip address 1.1.1.1 255.255.255.255
R1(config-if)# end
R1#
*Jul  3 12:59:45.647: %SYS-5-CONFIG_I: Configured from console by console
R1#

 

 

CISCO Switch에 BGP 설정하기

##
## AS 100을 관리하는 라우터(R1) 설정
##

R1# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)# router bgp 100
R1(config-router)# neighbor 10.1.1.2 remote-as 200
R1(config-router)# end
R1#
*Jul  3 13:05:03.939: %SYS-5-CONFIG_I: Configured from console by console
R1#


##
## AS 200을 관리하는 라우터(R2) 설정
##

R2# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)# router bgp 200
R2(config-router)# neighbor 10.1.1.1 remote-as 100
R2(config-router)# end
R2#
*Jul  3 13:07:28.543: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Jul  3 13:07:35.307: %BGP-5-ADJCHANGE: neighbor 10.1.1.1 Up 
R2#

 

 

BGP 설정 내용 확인하기

##
## 간략한 BGP 정보를 보는 명령
##

R1# show ip bgp summary

BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.1.2        4          200       7       7        1    0    0 00:02:53        0


##
## 상세한 BGP Neighbor 정보를 보는 명령
##

R1# show ip bgp neighbors 
BGP neighbor is 10.1.1.2,  remote AS 200, external link
  BGP version 4, remote router ID 2.2.2.2
  BGP state = Established, up for 00:05:43   ## <-- state 값을 확인해야 함.
  Last read 00:00:20, last write 00:00:14, hold time is 180, keepalive interval is 60 seconds
  Neighbor sessions:
    1 active, is not multisession capable (disabled)
  Neighbor capabilities:
    Route refresh: advertised and received(new)
    Four-octets ASN Capability: advertised and received
    Address family IPv4 Unicast: advertised and received
    Enhanced Refresh Capability: advertised and received
    Multisession Capability: 
    Stateful switchover support enabled: NO for session 1
  Message statistics:
    InQ depth is 0
    OutQ depth is 0
    
                         Sent       Rcvd
    Opens:                  1          1
    Notifications:          0          0
    Updates:                1          1
    Keepalives:             8          8
    Route Refresh:          0          0
    Total:                 10         10
  Default minimum time between advertisement runs is 30 seconds

 For address family: IPv4 Unicast
  Session: 10.1.1.2
  BGP table version 1, neighbor version 1/0
  Output queue size : 0
  Index 1, Advertise bit 0
  1 update-group member
  Slow-peer detection is disabled
  Slow-peer split-update-group dynamic is disabled
                                 Sent       Rcvd
  Prefix activity:               ----       ----
    Prefixes Current:               0          0
    Prefixes Total:                 0          0
    Implicit Withdraw:              0          0
    Explicit Withdraw:              0          0
    Used as bestpath:             n/a          0
    Used as multipath:            n/a          0

                                   Outbound    Inbound
  Local Policy Denied Prefixes:    --------    -------
    Total:                                0          0
  Number of NLRIs in the update sent: max 0, min 0
  Last detected as dynamic slow peer: never
  Dynamic slow peer recovered: never
  Refresh Epoch: 1
  Last Sent Refresh Start-of-rib: never
  Last Sent Refresh End-of-rib: never
  Last Received Refresh Start-of-rib: never
  Last Received Refresh End-of-rib: never
				       Sent	  Rcvd
	Refresh activity:	       ----	  ----
	  Refresh Start-of-RIB          0          0
	  Refresh End-of-RIB            0          0

  Address tracking is enabled, the RIB does have a route to 10.1.1.2
  Connections established 1; dropped 0
  Last reset never
  Transport(tcp) path-mtu-discovery is enabled
  Graceful-Restart is disabled
Connection state is ESTAB, I/O status: 1, unread input bytes: 0            
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 1
Local host: 10.1.1.1, Local port: 37711
Foreign host: 10.1.1.2, Foreign port: 179
Connection tableid (VRF): 0
Maximum output segment queue size: 50

Enqueued packets for retransmit: 0, input: 0  mis-ordered: 0 (0 bytes)

Event Timers (current time is 0x118E84):
Timer          Starts    Wakeups            Next
Retrans            10          0             0x0
TimeWait            0          0             0x0
AckHold             9          6             0x0
SendWnd             0          0             0x0
KeepAlive           0          0             0x0
GiveUp              0          0             0x0
PmtuAger            1          0        0x157854
DeadWait            0          0             0x0
Linger              0          0             0x0
ProcessQ            0          0             0x0

iss: 1109643795  snduna: 1109644028  sndnxt: 1109644028
irs:  864525182  rcvnxt:  864525415

sndwnd:  16152  scale:      0  maxrcvwnd:  16384
rcvwnd:  16152  scale:      0  delrcvwnd:    232
          
SRTT: 737 ms, RTTO: 2506 ms, RTV: 1769 ms, KRTT: 0 ms
minRTT: 48 ms, maxRTT: 1000 ms, ACK hold: 200 ms
Status Flags: active open
Option Flags: nagle, path mtu capable
IP Precedence value : 6

Datagrams (max data segment is 1460 bytes):
Rcvd: 19 (out of order: 0), with data: 10, total data bytes: 232
Sent: 20 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 10, total data bytes: 232

 Packets received in fast path: 0, fast processed: 0, slow path: 0
 fast lock acquisition failures: 0, slow path: 0
TCP Semaphore      0x6AA22B60  FREE 

R1#

 

 

IP Routing Table 정보 조회하기

R1# show ip route 

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
C        1.1.1.1 is directly connected, Loopback0
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.1.1.0/24 is directly connected, FastEthernet0/0
L        10.1.1.1/32 is directly connected, FastEthernet0/0

R1#

 

 

BGP 이용하여 Network Route 광고(Advertisement)

##
## R1 라우터가 이웃 라우터에게 Advertisement하기
##

R1# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)# router bgp 100
R1(config-router)# network 1.1.1.1 mask 255.255.255.255   ## <-- Route 광고하기
R1(config-router)# end
*Jul  3 14:26:39.559: %SYS-5-CONFIG_I: Configured from console by console
R1#


##
## 이웃 라이터(예: R2)에서 수신한 Route Advertisement 정보를 확인
##

R2# show ip bgp summary 
BGP router identifier 2.2.2.2, local AS number 200
BGP table version is 2, main routing table version 2
1 network entries using 148 bytes of memory
1 path entries using 64 bytes of memory
1/1 BGP path/bestpath attribute entries using 136 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 372 total bytes of memory
BGP activity 1/0 prefixes, 1/0 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.1.1        4          100      83      82        2    0    0 01:11:20        1  ## <- 이 값이 1로 변경되었는지 확인
R2#

 

 

BGP Network Route 광고 정보 조회

##
## 라우터 R1에서 BGP 정보 조회
##

R1# show ip bgp
BGP table version is 2, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.1/32       0.0.0.0                  0         32768 i
 R1#
 
 
##
## 라우터 R2에서 BGP 정보 조회
##

R2# show ip bgp
BGP table version is 2, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.1/32       10.1.1.1                 0             0 100 i
R2#

 

 

 

 

 

 

 

반응형

 


 

작성일: 2023년 9월 19일

 

어찌저찌 하다가 얻어 걸린 정보라서 메모를 해둔다.  (곧 까먹을 것 같아서...)

 

##
## Google 검색어 입력란(Text Box)에 아래 문장을 입력하고 검색하기.
##

intitle:index.of ios parent directory bin

 

위 검색어로 검색하면, 아래와 같은 결과가 출력될 것이다.

 

 

검색 결과에 여러 웹 사이트가 있지만, 아래 웹 사이트 가장 괜찮은 것 같다.

 

 

Index of /pustaka/docs/GNS3/images

 

lms.onnocenter.or.id

 

위 웹 사이트에서 CISCO C7200 Router에 대한 ios를 다운로드한 후, 아래 동영상을 보면서 따라하면 아주 쉽게 GNS3에 Router Image를 등록할 수 있다.

 

 

 

 

반응형

우리 말과 글로 된 BFD 문서와 영상이 있다면 딱 좋겠지만, 이것저것 다 찾아보니... 설명이 주변을 맴도는 느낌이다.

(너무 간단하고 쉬운 기능이라서 오히려 우리 나라 IT 종사자들이 자료를 안 만든 것 같다)

 

그냥 아래 영어로 된 동영상을 보는 것이 괜찮다. 

비록 영어지만, 말을 엄청 쉽게 하기 때문에 그냥 천천히 보면 이해가 된다. 

 

https://www.youtube.com/watch?v=C2UVsyxfBzw&t=300s 

 

 

위 영상이 아래 영상보다 쉬운 예제이고, 또박또박 말을 해줘서 훨씬 이해가 잘 된다.

위 영상을 먼저 보고, 아래 영상을 보는 것을 추천~~~

 

 

https://www.youtube.com/watch?v=nSq-0NRZc_8 

 

반응형

이것저것 문서를 다 찾아보았지만 아래 Red Hat 설명이 제일 깔끔하고, 정확하다.

(Red Hat 검증팀이 직접 테스트해보면서, 그 절차를 문서화한 것이니까 당연히 정확할 듯)

 

 

16.9. DPDK 및 RDMA 사용 OpenShift Container Platform 4.10 | Red Hat Customer Portal

Access Red Hat’s knowledge, guidance, and support through your subscription.

access.redhat.com

 

 

Kubernetes Cluster에서 DKDP 테스트할 때, 필요한 예제 App과 Library !!!

 

 

GitHub - openshift/app-netutil: app-netutil is a library that provides API methods for applications to get pod network informati

app-netutil is a library that provides API methods for applications to get pod network information. - GitHub - openshift/app-netutil: app-netutil is a library that provides API methods for applicat...

github.com

 

 

GitHub - openshift/app-netutil: app-netutil is a library that provides API methods for applications to get pod network informati

app-netutil is a library that provides API methods for applications to get pod network information. - GitHub - openshift/app-netutil: app-netutil is a library that provides API methods for applicat...

github.com

 

 


 

아래 문서들은 호기심 해소를 위해 보면 좋은 자료들.

아직 내용을 다 읽어보진 않았지만, 설명 그림(illustration)이 괜찮게 보여서 인용해본다.

 

 

 

GitHub - intel/userspace-cni-network-plugin

Contribute to intel/userspace-cni-network-plugin development by creating an account on GitHub.

github.com

 

위 문서에 있는 이미지들...

 

 

 

 

 

MISC

Red Hat이 공식 Container Image Registry를 통해서 아래와 같이 제공하는 container image도 있기는 한데, 라이센스 문제나 비용 문제 때문에 쓸수 없으니까, 그냥 내용 참고만 하고 나중에 돈이 충분하게 생기면 한번 image pulling해서 써봐야겠다.

 

https://catalog.redhat.com/software/containers/openshift4/dpdk-base-rhel8/5e32be6cdd19c77896004a41?container-tabs=dockerfile&gti-tabs=registry-tokens 

 

Red Hat Ecosystem Catalog

Your role Select your roleArchitectDeveloperDevOps EngineerProduct ManagerSystems AdministratorOther

catalog.redhat.com

 

반응형

 

Netcat(nc) TCP, UDP를 통해 Peer(Client/Server) 연결하고, 데이터를 읽고 쓰는 유틸리티 프로그램이다.

 

대부분 개발자, 운영자가 아래와 같은 목적으로 NC 명령을 사용할 것이다.

 

1)  두 장비(Network Node) 간에 IP Network이 정상인지 확인하거나

2)  중간에 방화벽이 있다면, 방화벽 정책이 적용되었는지 직접 TCP, UDP 트래픽을 테스트하기 위해서 NC를 사용한다.

3)  서버 또는 클라이언트 한쪽만 개발(구현)한 뒤에 Peer를 시뮬레이션하기 위해서...  (즉, 시뮬레이터 만들기 귀찮아서 ㅋㅋ) 

 

 

 

설치

 

##
## Mac OS 에 설치하는 경우
##

$  brew install netcat


##
## Ubuntu 에 설치하는 경우
##

$  apt install -y netcat


##
## CentOS, Redhat 에 설치하는 경우
##

$  yum install -y nc

 

 

 

사용 방법 / 예제

 

장황하게 설명하는 것보다는 아래 화면 캡처 하나가 훨씬 이해하기 좋을 듯~~~

그냥 아래 화면처럼 따라하면 테스트가 잘 된다.

 

##
## Netcat Server
##

$  nc  -l  -p 9090


##
## Netcat Client
##

$  nc  10.10.5.3  9090

이것은 테스트 메시지이다. (enter key)
...
...
... 이런 식으로 메시지를 타이핑하면서 테스트한다 ...
...
...

^C

$

 

 

게시물 작성자: sejong.jeonjo@gmail.com

 

+ Recent posts