DAY3


DA3

vlan 만들기


config t
vlan 2
name Professor
exit
interface fastethernet1/2
switchport mode access
switchport access VLAN 2
exit
interface fastethernet1/0
switchport mode trunk
exit
exit

show interface trunk



Bootstrap Example

라우터 설정


[R1]
config t
hostname jjcom
interface fastethernet0/0
ip address 192.168.0.254 255.255.255.0
no shutdown
exit
interface fastethernet0/0.2
encapsulation dot1q 2
ip address 192.168.1.254 255.255.255.0
no shutdown
exit
config t
interface serial1/0
ip address 1.1.1.37 255.255.255.252
no shutdown
exit

show running-config
show ip interface brief

*라우팅 테이블
ip route 192.168.2.0 255.255.255.0 1.1.1.38



[R2]
config t
hostname JYB
interface fastethernet0/0
ip address 192.168.2.254 255.255.255.0
no shutdown
exit
config t
interface serial1/0
ip address 1.1.1.38 255.255.255.252
no shutdown
exit

ip route 192.168.0.0 255.255.255.0 1.1.1.37
ip route 192.168.1.0 255.255.255.0 1.1.1.37

(or ip route 0.0.0.0 0.0.0.0 1.1.1.37)




Bootstrap Example

kali


ip addr
ip가 10.0.2.15/24인 것을 확인한다.

네트워크 설정
NAT(10.0.2.15) -> 어댑터에 브릿지(192.168.0.122)

*ip 설정
kali
192.168.0.1 / 255.255.255.0 / 192.168.0.254
dns 192.168.2.1 (192.168.2.xxx 만들 예정)

sudo passwd (kali/123456/123456)
su

*ip 추적
nmap -v -sS -O 192.168.1.0/24 > result.txt
192.168.1.xxx인 ip를 추적한다.

*텔넷을 이용해 라우터 침입하기
telnet 192.168.0.254 (123456)
이때, 라우터에 텔넷 설정이 되어있어야 한다.
jjcom>_ 사용자모드
jjcom#_ 관리자모드
관리자 모드로 변환 : en (123456)

*텔넷을 이용한 침투 막는 법
Access list (4종류)
1. 표준 엑세스 리스트 : 출발지 ip 주소를 참조하여 막는 방법
ex) 192.168.0.xxx를 막아라~



Bootstrap Example

텔넷 설정


*라우터 텔넷 활성화
config t
enable secret 123456

config t
line vty 0 4
password 123456
login
exit

config t
ip domain-name st.kr
crypto key generate rsa
2048
ip ssh version 2
line vty 0 4
transport input telnet

show crypto key mypubkey rsa


config t
line con 0
exec-time 0 0

표준 ACL 과 확장 ACL
표준 ACL(1-99) : 출발지 IP주소만 참조하여 패킷을 필터링 함
확장 ACL : 출발지 및 목적지 ip주소와 TCP,UDP,포트 번호를 참조하여 패킷을 필터링 함

*막는 방법
config t
access-list 1 deny 192.168.0.1 0.0.0.0
access-list 1 permit any
interface fastethernet0/0
ip access-group 1 in
exit