본문 바로가기
IT/python

vmware workstation, GNS3 설치 및 구성#1

by 미니두부김밥 2021. 9. 18.
반응형

ㅇ 본 포스팅은 파이썬 네트워크 자동화 책을 보며 따라하는 실습 포스팅.


포스팅 내용

ㅇ vmware workstation 설치 후 ubuntu, centos 설치, gns3 vm.ova 불러오기

ㅇ 각 vm들 통신 확인


- 실습의 호환성을 위해 vmware workstation을 12.5.9 버전으로 설치

workstation 12.5.9 version


- Host-only 모드 : VMnet1과 연결되며, vm은 가상 DHCP에서 IP를 할당받아 사용하게 된다.

가상 네트워크 어댑터의 3가지 모드

- Bridge 모드 : vm이 호스트와 같은 네트워크에서 동작하게 된다. 실제 DHCP 서버로부터 IP를 할당받아 사용하게 된다.

- NAT 모드 : vm이 호스트에서 NAT되어 가상 DHCP 서버로부터 IP를 할당받게 된다.

 

가상 DHCP 설정


- ubuntu 설치. lab의 호환성을 위해 18.04.5 설치

ubuntu 18.04.5

- 설치완료 후 외부 ping test

Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-147-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Tue Jul 13 06:36:14 UTC 2021

  System load:  0.14               Processes:            183
  Usage of /:   12.9% of 29.40GB   Users logged in:      1
  Memory usage: 22%                IP address for ens33: 192.168.122.129
  Swap usage:   0%


69 packages can be updated.
1 update is a security update.

New release '20.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


Last login: Tue Jul 13 06:34:27 2021
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ 
tark@ubuntu18s4:~$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.122.129  netmask 255.255.255.0  broadcast 192.168.122.255
        inet6 fe80::20c:29ff:fe60:3f11  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:60:3f:11  txqueuelen 1000  (Ethernet)
        RX packets 148  bytes 36403 (36.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 139  bytes 20590 (20.5 KB)
        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  (Local Loopback)
        RX packets 100  bytes 7920 (7.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 100  bytes 7920 (7.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tark@ubuntu18s4:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=35.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=128 time=37.8 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=128 time=40.6 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=128 time=37.5 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 35.500/37.899/40.643/1.833 ms
tark@ubuntu18s4:~$

- root 접속을 위한 root pw 설정

tark@ubuntu18s4:~$ sudo passwd
[sudo] password for tark: 
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

- root 계정 ssh 접속을 위한 설정

tark@ubuntu18s4:~$ sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
[sudo] password for tark: 
tark@ubuntu18s4:~$ sudo service ssh restart

- gui 설치를 위한 tasksel 설치

tark@ubuntu18s4:~$ sudo apt-get install tasksel
[sudo] password for tark: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  laptop-detect tasksel-data
The following NEW packages will be installed:
  laptop-detect tasksel tasksel-data
0 upgraded, 3 newly installed, 0 to remove and 65 not upgraded.
Need to get 40.2 kB of archives.
After this operation, 312 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 tasksel-data all 3.34ubuntu11 [5,476 B]
Get:2 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 tasksel all 3.34ubuntu11 [28.7 kB]
Get:3 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 laptop-detect all 0.16 [6,016 B]
Fetched 40.2 kB in 1s (30.2 kB/s)   
Preconfiguring packages ...
Selecting previously unselected package tasksel-data.
(Reading database ... 67143 files and directories currently installed.)
Preparing to unpack .../tasksel-data_3.34ubuntu11_all.deb ...
Unpacking tasksel-data (3.34ubuntu11) ...
Selecting previously unselected package tasksel.
Preparing to unpack .../tasksel_3.34ubuntu11_all.deb ...
Unpacking tasksel (3.34ubuntu11) ...
Selecting previously unselected package laptop-detect.
Preparing to unpack .../laptop-detect_0.16_all.deb ...
Unpacking laptop-detect (0.16) ...
Setting up laptop-detect (0.16) ...
Setting up tasksel (3.34ubuntu11) ...
Setting up tasksel-data (3.34ubuntu11) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

- sudo tasksel로 tasksel 실행 후 ubuntu desktop 설치

-GUI 사용 가능(snapshot 설정)

snapshot 설정


- CentOS 7 설치

최대한 책과 버전을 맞춘다. 7.9다

- CentOS 설치 완료 및 통신 확인

잘 된다.


- GNS3 VM.ova 불러오기 후 확인

정상. 책과 동일한 2.1.11 버전으로 download

#2 이어서

반응형

댓글