Network(②static vs. dhcp ③설정(gui, cli)③명령어(ip link, ip addr, ip route, ifconfig, route, ping, arp, hostname))
* 강사님 정리 메모장 : 1월15일_3평일리2.txt
* static vs. dhcp
공인 IP(고정 IP, static) |
VMware (유동IP, dhcp) (NAT) |
1 --| ... | → Host ID // 사용 가능한 IP 주소 253 --| 254 → Gateway // 외워!
|
192.168.46. 1 → DHCP (Dynamic Host Configration Protocol) // 자동 2 → Gateway // 프로그램이라 변경 가능 3 --| ... | → Host ID // 사용 가능한 IP 주소 254--| |
Q)
0 ~ 255 => 256개 - 2(Net, broad) = 254
인터넷 한다 => 254 -1 (Gate) = 253
cf) Bridge
윈도우즈 IP 영역대 따라감
* 네트워크 설정
1> GUI에서 작업 (Graphic 모드)
관리자로 로그인 → 프로그램 → 시스템 도구 → 설정 → 네트워크 → 톱니바퀴 클릭
[IPv4]
주소(A) : 자동(DHCP)가 기본값으로 되어있음
수동 → 자동(DHCP) → 기존에 적었던 서버 내용 지우고 → 적용
→ 유선 적용 끔> 켬
주소(A) : 수동으로 작업시 아래를 참고
cf) Windows에서 ipconfig을 참고
C:\Users\user>ipconfig /all | more
- 리눅스에서 주소에 입력할 내용은 [자세히보기]에 IPv4주소를 그대로 씀
- 리눅스에서 네트마스크는 윈도우(cmd)에 서브넷 마스크를 그대로 입력
- 리눅스에 게이트웨이는 윈도우(cmd)에 기본 게이트웨이를 그대로 입력
- 리눅스에 서버에는 윈도우에 DNS 서버를 그대로 입력
→ 적용
→ 유선 적용 끔> 켬
2> CLI에서 작업 (Text 모드)
- nmtui(명령어)
(CentOS 7 이전에는 system-config-network 였음)
[사용형식]
# nmtui
연결 편집 → 오.버 클릭 → OK Enter
ens32 → 오.버 눌러서 편집 Enter
IPv4 설정에서 <자동>으로 기본값임
IPv4 설정에서 <수동>으로 작업시 아래를 참고
- IPv4 설정에서 <자동>을 <수동>으로 변경 후 <보기>를 enter
- 주소: <추가 ...> enter 192.168.46.90/24 (네트웍마스크가 없으므로 prefix 기록)
cf) 255.255.255.0 => prefix : 24
- 게이트웨이 : Windows의 기본 게이트웨이 입력
- DNS 서버 : <추가 ...> enter → Windows의 DNS 서버 입력
- 맨 밑 하단 자동으로 연결과 모든 사용자에게 ~ 문구에 반드시 체크 → OK
→ Back → 연결 활성화로 이동 → OK
→ <비활성화> enter 치고 다시 <활성화> → <비활성화> → Back → 종료
[확인]
vmware 상단 텝 소리 아이콘 클릭 → 유선 연결됨 클릭 → 유선 네트워크 설정
→ 톱니바퀴 버튼 클릭 → IPv4 에서 내가 설정한 IP 확인!
3> 네트워크 설정 파일에서 작업 (vi 문서 편집기 에서)
/etc/sysconfig/network-scripts/ifcfg-장치명
BOOTPROTO=dhcp -> 자동
BOOTPROTO=static -> 수동
ONBOOT=yes -> 자동으로 연결함
ONBOOT=no -> 자동으로 연결 안 함
BOOTPROTO=static으로 할 경우 아래를 참고!
BOOTPROTO=static
맨 마지막 줄에 빈 줄 생성하고 작업
17 IPADDR=Linux IP Address
18 PREFIX=24 // C class
19 GATEWAY=Windows의 게이트웨
20 DNS1=168.126.63.1
위 설정이 다 되면 저장하고 종료
:wq
network service를 적용하기 위해서 아래에 명령어를 입력
# systemctl restart network.service
위 작업을 하신 뒤 반드시 CentOS 7을 재부팅!
// 1> 자동 → 수동
[root@localhost ~]#
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]#
[root@localhost network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@localhost network-scripts]# ls
ifcfg-ens32 ifdown-isdn ifup-bnep ifup-routes
ifcfg-lo ifdown-post ifup-eth ifup-sit
ifdown ifdown-ppp ifup-ib ifup-tunnel
ifdown-Team ifdown-routes ifup-ippp ifup-wireless
ifdown-TeamPort ifdown-sit ifup-ipv6 init.ipv6-global
ifdown-bnep ifdown-tunnel ifup-isdn network-functions
ifdown-eth ifup ifup-plip network-functions-ipv6
ifdown-ib ifup-Team ifup-plusb
ifdown-ippp ifup-TeamPort ifup-post
ifdown-ipv6 ifup-aliases ifup-ppp
[root@localhost network-scripts]#
[root@localhost network-scripts]# vi ifcfg-ens32
1 TYPE=Ethernet
2 PROXY_METHOD=none
3 BROWSER_ONLY=no
4 BOOTPROTO=static # dhcp : 자동 | static : 수동
5 DEFROUTE=yes
6 IPV4_FAILURE_FATAL=no
7 IPV6INIT=yes
8 IPV6_AUTOCONF=yes
9 IPV6_DEFROUTE=yes
10 IPV6_FAILURE_FATAL=no
11 IPV6_ADDR_GEN_MODE=stable-privacy
12 NAME=ens32
13 UUID=f1b3d718-1761-44c9-8bd0-c6b2811898fc
14 DEVICE=ens32
15 ONBOOT=yes # yes : 자동으로 연결 | no : 연결 안함
16 IPV6_PRIVACY=no
17 IPADDR=192.168.46.90
18 PREFIX=24
19 GATEWAY=192.168.46.254
20 DNS1=168.126.63.1
:wq
[root@localhost network-scripts]#
[root@localhost network-scripts]# systemctl restart network.service
// 2> 수동 → 자동
[root@localhost network-scripts]# ls
ifcfg-ens32 ifdown-ib ifdown-sit ifup-eth ifup-post network-functions
ifcfg-lo ifdown-ippp ifdown-tunnel ifup-ib ifup-ppp network-functions-ipv6
ifdown ifdown-ipv6 ifup ifup-ippp ifup-routes
ifdown-Team ifdown-isdn ifup-Team ifup-ipv6 ifup-sit
ifdown-TeamPort ifdown-post ifup-TeamPort ifup-isdn ifup-tunnel
ifdown-bnep ifdown-ppp ifup-aliases ifup-plip ifup-wireless
ifdown-eth ifdown-routes ifup-bnep ifup-plusb init.ipv6-global
[root@localhost network-scripts]#
[[root@localhost network-scripts]# vi ifcfg-ens32
1 TYPE=Ethernet
2 PROXY_METHOD=none
3 BROWSER_ONLY=no
4 BOOTPROTO=dhcp
5 DEFROUTE=yes
6 IPV4_FAILURE_FATAL=no
7 IPV6INIT=yes
8 IPV6_AUTOCONF=yes
9 IPV6_DEFROUTE=yes
10 IPV6_FAILURE_FATAL=no
11 IPV6_ADDR_GEN_MODE=stable-privacy
12 NAME=ens32
13 UUID=f1b3d718-1761-44c9-8bd0-c6b2811898fc
14 DEVICE=ens32
15 ONBOOT=yes
16 IPV6_PRIVACY=no
[root@localhost network-scripts]#
[root@localhost network-scripts]# systemctl restart network.service
[root@localhost network-scripts]#
* 네트워크 명령어
# ip link
- 네트워크 연결 상태를 확인
# ip addr
- IP Address를 확인
# ip route
- 라우팅 테이블을 확인
# ifconfig
- NIC(Network Interface Card), LAN Card, Ethernet Card와 서브넷 마스크 등 이외에 항목을 확인할 때
cf) 확인 가능 항목
- MAC 주소
- Broadcast
- subnetmask(netmask)
- MTU(Maximum Transfer Unit)
- RX packets(부팅 후 현재까지 받은 패킷 수)
- TX packets(부팅 후 현재까지 보낸 패킷 수)
- Gateway
1) 장치를 활성화 또는 비활성화
사용형식
# ifconfig [interface] up(활성화) | down(비활성화)
2) IP Address를 임시로 변경
사용형식
# ifconfig [interface] IP Address
# route
- 라우팅 테이블을 작성하거나 확인
사용형식
route
→ 현재 라우팅 테이블을 출력
라우팅 테이블
- 패킷을 목적지까지 보낼 때 어디로 보내야 할지를 지정해주는 지시자
패킷
- 데이터를 보낼 때 자른 단위
[root@localhost network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 100 0 0 ens32
192.168.46.0 0.0.0.0 255.255.255.0 U 100 0 0 ens32
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
1) 항목
ㆍDestination
- 목적지
ㆍGateway
- 게이트웨이
ㆍGenmask
- 넷마스크
ㆍFlags → 형식
U : 인터페이스가 UP(활성화)
UG : 게이트웨이의 라우터가 UP(활성화)
ㆍMetric
- 다음 나아가야할 라우터와의 거리
ㆍRef
- 라우터에 대한 참조 수
ㆍUse
- 라우터를 찾아본 횟수
ㆍIface
- 인터페이스
2) 라우터 추가
Tip. 라우터를 먼저 추가해야 게이트웨이를 추가할 수 있다!
# route add -net IP대역대 netmask 넷마스크 dev장치명 // 네트워크 대역대 (호스트 no! : 특정 ip 지정)
3) 게이트웨이 추가
# route add default gw 게이트웨이 dev 장치명
# route
# ip route // 게이트웨이 설정 확인
4) 게이트웨이 삭제
추가(add)를 삭제(del)로 변경하면 됨
# ping
- 네트워크가 정상적으로 동작중인지 확인
- 특정 호스트로 ICMP (Internet Control Message Protocol)
에코(echo) 메시지를 사용해서 원격 호스트가 다시 로컬 호스트로 응답하도록 함
- 테스트 용도
사용형식
ping [option] 인자값 Server-IP 또는 Domain
option
-c : count. 패킷을 보낼 횟수를 지정 (기본값으로는 무제한)
-i : interval. 패킷을 보낼 간격을 지정 (기본값으로는 1초)
일반 사용자 계정은 0.2초까지 관리자는 0.2초 이내까지
-s : size. 패킷을 보낼 크기를 지정(기본값으로는 64byte, 8byte 헤더값)
-t : ttl의 값을 수동으로 지정(기본값으로는 보내는 쪽 서버의 기본값.
Windows는 128
Unix, Linux는 64)
TTL(Time To Live) : 라우터를 거칠때 마다 -1씩 감소.
네트워크상에서 패킷이 무한루프에 빠지는 것을 방지하기 위함
traceroute
- 네트워크 통신 경로를 확인하는 명령어로 패킷이 목적지까지 전달되는 경로(과정)를 확인
- ICMP를 이용하여 TTL값을 포함하고 패킷을 전송하여 반환값을 출력
cf. windows에서는 tracelt ??
사용형식
traceroute [option] Servier-IP 또는 Domain
hop은 라우터와 라우터 2대 사이에 다음 번 나아가야할 수
cf) https://www.iplocation.net
: ip 검색
ARP (Address Resolution Protocol)
- 동일한 네트워크 내에 존재하는 호스트들의 IP Address와 MAC(Media Access Control) 주소를
확인하는 명령어
- 실제로 네트워크상에서의 통신은 MAC 주소를 이용함
- IP Address를 MAC 주소로 변환
사용형식
arp [option]
option
-a : 현재 프로토콜 데이터를 ARP 항목에 표시
hostname
- 호스트의 이름을 붙이기 위해서 설정
사용형식
hostname
- 현재 호스트 네임을 출력
hostname 종류
static(고정) hostname
- 전통적인 호스트 네임
transient(일시적인) hostname
- 커널에서 관리하는 동적 호스트 네임
pretty hostname
- static, transient은 문자에 제한이 있는데
pretty는 사용자가 자유롭게 호스트 네임을 설정할 수 있고
UTF-8 문자셋을 이용하여 한글로도 설정할 수 있음
/etc/hostname
- hostname 설정파일
(참고로 CentOS7 이전에는 /etc/sysconfig/network 파일)
로그인 후 → 프로그램 → 시스템도구 →설정 → 공유에서 설정이 가능함 // GUI 모드
# hostnamectl(명령어)
ex) hostnamectl set-hostname 호스트네임
보통 호스트 네임은 도메인이 없으면 "이름.회사"
hostname 상태 확인
hostnamectl status
// ip link
[root@localhost network-scripts]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
link/ether 00:0c:29:20:b1:9d brd ff:ff:ff:ff:ff:ff
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT qlen 1000
link/ether 52:54:00:f3:fc:be brd ff:ff:ff:ff:ff:ff
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN mode DEFAULT qlen 1000
link/ether 52:54:00:f3:fc:be brd ff:ff:ff:ff:ff:ff
[root@localhost network-scripts]#
// ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:20:b1:9d brd ff:ff:ff:ff:ff:ff
inet 192.168.46.90/24 brd 192.168.46.255 scope global dynamic ens32
valid_lft 6961sec preferred_lft 6961sec
inet6 fe80::b667:4fa:73e1:b47b/64 scope link tentative dadfailed
valid_lft forever preferred_lft forever
inet6 fe80::b6bb:2ca6:5b43:667f/64 scope link tentative dadfailed
valid_lft forever preferred_lft forever
inet6 fe80::917e:8459:f241:af22/64 scope link tentative dadfailed
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000
link/ether 52:54:00:f3:fc:be brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 1000
link/ether 52:54:00:f3:fc:be brd ff:ff:ff:ff:ff:ff
// ip route
[root@localhost network-scripts]# ip route
default via 192.168.46.254 dev ens32 proto static metric 100
192.168.46.0/24 dev ens32 proto kernel scope link src 192.168.46.90 metric 100
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
[root@localhost network-scripts]#
// ifconfig
[root@localhost network-scripts]# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.46.90 netmask 255.255.255.0 broadcast 192.168.46.255
inet6 fe80::b667:4fa:73e1:b47b prefixlen 64 scopeid 0x20<link>
inet6 fe80::b6bb:2ca6:5b43:667f prefixlen 64 scopeid 0x20<link>
inet6 fe80::917e:8459:f241:af22 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:20:b1:9d txqueuelen 1000 (Ethernet)
RX packets 26435 bytes 11620094 (11.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4954 bytes 528282 (515.9 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 1 (Local Loopback)
RX packets 36 bytes 3096 (3.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 36 bytes 3096 (3.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:f3:fc:be txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost network-scripts]#
// 네트웍 장비 활성화, 비활성화 (ifconfig ens32 up | down)
[root@localhost network-scripts]# ifconfig ens32 down // vmware 위에 연결 아이콘 사라지는거 확인
[root@localhost network-scripts]#
[root@localhost network-scripts]# ifconfig ens32 up // vmware 위에 연결 아이콘 나타나는거 확인
[root@localhost network-scripts]#
// ip 임시 변경 (ifconfig 장치명 up | down)
[root@localhost network-scripts]# ifconfig | head -n5
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.46.90 netmask 255.255.255.0 broadcast 192.168.46.255
inet6 fe80::b667:4fa:73e1:b47b prefixlen 64 scopeid 0x20<link>
inet6 fe80::b6bb:2ca6:5b43:667f prefixlen 64 scopeid 0x20<link>
inet6 fe80::917e:8459:f241:af22 prefixlen 64 scopeid 0x20<link>
[root@localhost network-scripts]#
[root@localhost network-scripts]# ifconfig ens32 192.168.46.91 // 임시 변경
[root@localhost network-scripts]#
[root@localhost network-scripts]# ifconfig ens32 | head -2
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.46.91 netmask 255.255.255.0 broadcast 192.168.46.255 // 네트워크 설정 탭에서도 변경 확인!
[root@localhost network-scripts]#
[root@localhost network-scripts]#
[root@localhost network-scripts]# ifconfig ens32 192.168.46.90 // 원상태로 돌림
[root@localhost network-scripts]#
[root@localhost network-scripts]# ifconfig | head -2
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.46.90 netmask 255.255.255.0 broadcast 192.168.46.255
[root@localhost network-scripts]#
[root@localhost network-scripts]# ifconfig ens32 down // ens32 비활성화
[root@localhost network-scripts]#
[root@localhost network-scripts]# ifconfig ens32 up // ens32 활성화
[root@localhost network-scripts]#
// route
[root@localhost network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 100 0 0 ens32
192.168.46.0 0.0.0.0 255.255.255.0 U 100 0 0 ens32
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
// 라우터 추가
[root@localhost network-scripts]# route add -net 192.168.47.0 netmask 255.255.255.0 ens32
[root@localhost network-scripts]#
[root@localhost network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 100 0 0 ens32
192.168.46.0 0.0.0.0 255.255.255.0 U 100 0 0 ens32
192.168.47.0 0.0.0.0 255.255.255.0 U 0 0 0 ens32
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
// 라우터, 게이트웨이 추가 및 삭제
[root@localhost network-scripts]# route add -net 192.168.47.0 netmask 255.255.255.0 ens32
[root@localhost network-scripts]#
[root@localhost network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 100 0 0 ens32
192.168.46.0 0.0.0.0 255.255.255.0 U 100 0 0 ens32
192.168.47.0 0.0.0.0 255.255.255.0 U 0 0 0 ens32
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
[root@localhost network-scripts]#
[root@localhost network-scripts]# route add default gw 192.168.47.254 dev ens32
[root@localhost network-scripts]#
[root@localhost network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 0 0 0 ens32
default gateway 0.0.0.0 UG 100 0 0 ens32
192.168.46.0 0.0.0.0 255.255.255.0 U 100 0 0 ens32
192.168.47.0 0.0.0.0 255.255.255.0 U 0 0 0 ens32
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
[root@localhost network-scripts]#
[root@localhost network-scripts]# ip route
default via 192.168.47.254 dev ens32
default via 192.168.46.254 dev ens32 proto static metric 100
192.168.46.0/24 dev ens32 proto kernel scope link src 192.168.46.90 metric 100
192.168.47.0/24 dev ens32 scope link
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
[root@localhost network-scripts]#
[root@localhost network-scripts]# route del -net 192.168.47.0 netmask 255.255.255.0 ens32
[root@localhost network-scripts]#
[root@localhost network-scripts]# route del default gw 192.168.47.254 dev ens32
[root@localhost network-scripts]#
[root@localhost network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 100 0 0 ens32
192.168.46.0 0.0.0.0 255.255.255.0 U 100 0 0 ens32
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
// ping
[root@localhost network-scripts]# ping 192.168.46.81 // 강사님 ip addr
PING 192.168.46.81 (192.168.46.81) 56(84) bytes of data.
64 bytes from 192.168.46.81: icmp_seq=1 ttl=64 time=1.23 ms
64 bytes from 192.168.46.81: icmp_seq=2 ttl=64 time=0.648 ms
64 bytes from 192.168.46.81: icmp_seq=3 ttl=64 time=0.573 ms
64 bytes from 192.168.46.81: icmp_seq=4 ttl=64 time=0.652 ms
^C
--- 192.168.46.81 ping statistics ---
40 packets transmitted, 40 received, 0% packet loss, time 39015ms
rtt min/avg/max/mdev = 0.563/0.685/1.636/0.182 ms
[root@localhost network-scripts]#
[root@localhost network-scripts]# ping www.google.co.kr
PING www.google.co.kr (172.217.26.3) 56(84) bytes of data.
64 bytes from nrt20s02-in-f3.1e100.net (172.217.26.3): icmp_seq=1 ttl=54 time=32.7 ms
^C
--- www.google.co.kr ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 32.755/32.806/32.894/0.218 ms
[root@localhost network-scripts]#
[root@localhost network-scripts]# ping www.facebook.com
PING star-mini.c10r.facebook.com (31.13.68.35) 56(84) bytes of data.
64 bytes from edge-star-mini-shv-01-icn1.facebook.com (31.13.68.35): icmp_seq=1 ttl=54 time=2.15 ms
^C
--- star-mini.c10r.facebook.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 2.159/2.540/3.194/0.464 ms
[root@localhost network-scripts]#
[root@localhost network-scripts]# ping www.naver.com
PING www.naver.com.nheos.com (210.89.164.90) 56(84) bytes of data.
^C
--- www.naver.com.nheos.com ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 6001ms
[root@localhost network-scripts]#
[root@localhost network-scripts]# ping www.daum.net
PING www.g.daum.net (203.133.167.81) 56(84) bytes of data.
^C
--- www.g.daum.net ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2000ms
[root@localhost network-scripts]#
[root@localhost network-scripts]# ping www.nexon.com
PING www.g.nexon.com (183.110.0.23) 56(84) bytes of data.
^C
--- www.g.nexon.com ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5000ms
[root@localhost network-scripts]# ping www.netmarble.com
PING www.netmarble.com (183.110.55.42) 56(84) bytes of data.
^C
--- www.netmarble.com ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
[root@localhost network-scripts]#
[root@localhost network-scripts]# ping www.kgitbank.co.kr
PING www.kgitbank.co.kr (210.116.103.32) 56(84) bytes of data.
^C
--- www.kgitbank.co.kr ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1000ms
[root@localhost network-scripts]# ping www.navermail.com
PING gaja79.com (182.162.73.77) 56(84) bytes of data.
64 bytes from 182.162.73.77 (182.162.73.77): icmp_seq=1 ttl=54 time=2.61 ms
^C
--- gaja79.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 2.617/2.706/2.780/0.086 ms
[root@localhost network-scripts]#
// 우리나라꺼 왜 안됨?
// 차단한듯???
[root@localhost ~]# ifconfig | head -2
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.46.90 netmask 255.255.255.0 broadcast 192.168.46.255
[root@localhost ~]#
[root@localhost ~]# ping-c 4 192.168.46.90
bash: ping-c: 명령을 찾을 수 없습니다...
[root@localhost ~]# ping -c 192.168.46.90
Usage: ping [-aAbBdDfhLnOqrRUvV64] [-c count] [-i interval] [-I interface]
[-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos]
[-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option]
[-w deadline] [-W timeout] [hop1 ...] destination
Usage: ping -6 [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface]
[-l preload] [-m mark] [-M pmtudisc_option]
[-N nodeinfo_option] [-p pattern] [-Q tclass] [-s packetsize]
[-S sndbuf] [-t ttl] [-T timestamp_option] [-w deadline]
[-W timeout] destination
[root@localhost ~]# ping -c 4 192.168.46.90
PING 192.168.46.90 (192.168.46.90) 56(84) bytes of data.
64 bytes from 192.168.46.90: icmp_seq=1 ttl=64 time=0.033 ms
64 bytes from 192.168.46.90: icmp_seq=2 ttl=64 time=0.030 ms
64 bytes from 192.168.46.90: icmp_seq=3 ttl=64 time=0.031 ms
64 bytes from 192.168.46.90: icmp_seq=4 ttl=64 time=0.031 ms
--- 192.168.46.90 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.030/0.031/0.033/0.004 ms
[root@localhost ~]#
[root@localhost ~]# ping -c 4 -i 0.2 192.168.46.90
PING 192.168.46.90 (192.168.46.90) 56(84) bytes of data.
64 bytes from 192.168.46.90: icmp_seq=1 ttl=64 time=0.031 ms
64 bytes from 192.168.46.90: icmp_seq=2 ttl=64 time=0.085 ms
64 bytes from 192.168.46.90: icmp_seq=3 ttl=64 time=0.033 ms
64 bytes from 192.168.46.90: icmp_seq=4 ttl=64 time=0.033 ms
--- 192.168.46.90 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 601ms
rtt min/avg/max/mdev = 0.031/0.045/0.085/0.023 ms
[root@localhost ~]# ping -c 4 -s 1000 192.168.46.81
PING 192.168.46.81 (192.168.46.81) 1000(1028) bytes of data.
1008 bytes from 192.168.46.81: icmp_seq=1 ttl=64 time=1.29 ms // 기본값이 8byte이므로 1008
1008 bytes from 192.168.46.81: icmp_seq=2 ttl=64 time=0.828 ms
1008 bytes from 192.168.46.81: icmp_seq=3 ttl=64 time=0.931 ms
1008 bytes from 192.168.46.81: icmp_seq=4 ttl=64 time=0.917 ms
--- 192.168.46.81 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 0.828/0.993/1.296/0.179 ms
[root@localhost ~]# traceroute www.google.co.kr
traceroute to www.google.co.kr (216.58.197.227), 30 hops max, 60 byte packets
1 gateway (192.168.46.254) 1.201 ms 1.895 ms 2.655 ms
2 * * *
3 * * *
4 112.188.1.141 (112.188.1.141) 18.508 ms 18.486 ms 18.456 ms
5 112.174.105.89 (112.174.105.89) 18.639 ms 112.174.18.113 (112.174.18.113) 18.616 ms 112.174.105.21 (112.174.105.21) 18.583 ms
6 112.174.47.238 (112.174.47.238) 18.552 ms 112.174.47.190 (112.174.47.190) 11.820 ms 112.174.47.238 (112.174.47.238) 11.780 ms
7 72.14.209.154 (72.14.209.154) 32.444 ms 34.300 ms 35.704 ms
8 * 108.170.242.161 (108.170.242.161) 37.218 ms 38.891 ms
9 72.14.237.223 (72.14.237.223) 41.187 ms 41.086 ms 72.14.238.99 (72.14.238.99) 32.467 ms
10 nrt13s49-in-f3.1e100.net (216.58.197.227) 31.926 ms 31.022 ms 32.261 ms
[root@localhost ~]# arp -a
gateway (192.168.46.254) at 88:36:6c:0f:73:ec [ether] on ens32
? (192.168.46.81) at 00:0c:29:03:ba:93 [ether] on ens32 // 강사쌤 ip ping 한 흔적
[root@localhost ~]#
[root@localhost ~]# ifconfig | head -2
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.46.90 netmask 255.255.255.0 broadcast 192.168.46.255
[root@localhost ~]# hostname // 서버명
localhost.localdomain
[root@localhost ~]#
[root@localhost ~]# ls -l /etc/hostname
-rw-r--r--. 1 root root 22 10월 11 15:28 /etc/hostname
[root@localhost ~]#
[root@localhost ~]# cat /etc/hostname
localhost.localdomain
[root@localhost ~]#
[root@localhost ~]# hostnamectl set-hostname Junga.kgitbank
[root@localhost ~]#
[root@localhost ~]# cat /etc/hostname
junga.kgitbank
[root@localhost ~]#
[root@localhost ~]# hostnamectl status
Static hostname: junga.kgitbank
Pretty hostname: Junga.kgitbank
Icon name: computer-vm
Chassis: vm
Machine ID: 81f1ecc87e7847218970d205d125a000
Boot ID: 3f498d999d9846faaad52275a4a5d6fb
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-693.2.2.el7.x86_64
Architecture: x86-64
'BigData_Off1 > 리눅스2' 카테고리의 다른 글
File Service 1(①ftpSvc1(vsftpd)) (0) | 2018.01.22 |
---|---|
Remote Service 4(⑥remoSvc4(vnc viewer)⑥방화벽 설정(CLI)) 3.ftp Service(①FtpSvc1(vsftpd)) (0) | 2018.01.19 |
Remote Service 3(④remoSvc2(openssh) ⑤remoSvc3(scp)) (0) | 2018.01.18 |
Remote Service 2(③remoSvc1(telnet) ④remoSvc2(openssh)) (0) | 2018.01.17 |
Remote Service 1(①Centos 버전 비교 ②Systemd/Service 작동법 ③remoSvc1(telnet) ③-2 방화벽(GUI)) (0) | 2018.01.16 |