반응형
○ 테스트 환경
1. 버추얼 박스 - 우분투 (20 LTS)
○ IP, Mac 주소 확인하는 방법 (ifconfig)
1. 터미널 찾을 열고 ifconfig를 입력.
2. ifconfig가 없을 경우 sudo apt-get install ifconfig를 통해 설치.
ubuntu@ubuntu-VirtualBox:~$ ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.43 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::4bf:bc22:aed4:e75a prefixlen 64 scopeid 0x20<link>
ether 08:00:27:22:4b:21 txqueuelen 1000 (Ethernet)
RX packets 24875 bytes 3805603 (3.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2272 bytes 231801 (231.8 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 456 bytes 39404 (39.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 456 bytes 39404 (39.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
- enp0s3 : 네트워크 인터페이스 이름
- inet : IP 주소(IPv4)
- inet6 : IP 주소 (IPv6)
- ether : Mac 주소
lo (IP 127.0.0.1)는 자기 자신(루프백) 에요.
아래는 ifconfig의 옵션으로 IP, Mac 주소 변경 등 네트워크에 관련된 설정을 보거나 변경할 수 있어요.
ubuntu@ubuntu-VirtualBox:~$ ifconfig -h
Usage:
ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]
[add <address>[/<prefixlen>]]
[del <address>[/<prefixlen>]]
[[-]broadcast [<address>]] [[-]pointopoint [<address>]]
[netmask <address>] [dstaddr <address>] [tunnel <address>]
[outfill <NN>] [keepalive <NN>]
[hw <HW> <address>] [mtu <NN>]
[[-]trailers] [[-]arp] [[-]allmulti]
[multicast] [[-]promisc]
[mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]
[txqueuelen <NN>]
[[-]dynamic]
[up|down] ...
<HW>=Hardware Type.
List of possible hardware types:
loop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial Line IP)
slip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP) adaptive (Adaptive Serial Line IP)
ash (Ash) ether (Ethernet) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) rose (AMPR ROSE) tunnel (IPIP Tunnel)
ppp (Point-to-Point Protocol) hdlc ((Cisco)-HDLC) lapb (LAPB)
arcnet (ARCnet) dlci (Frame Relay DLCI) frad (Frame Relay Access Device)
sit (IPv6-in-IPv4) fddi (Fiber Distributed Data Interface) hippi (HIPPI)
irda (IrLAP) ec (Econet) x25 (generic X.25)
eui64 (Generic EUI-64)
<AF>=Address family. Default: inet
List of possible address families:
unix (UNIX Domain) inet (DARPA Internet) inet6 (IPv6)
ax25 (AMPR AX.25) netrom (AMPR NET/ROM) rose (AMPR ROSE)
ipx (Novell IPX) ddp (Appletalk DDP) ec (Econet)
○ IP 변경하는 방법
1. ifconfig [NIC 인터페이스 이름] [변경할 IP 주소]
(예 : ifconfig eth0 192.168.1.10)
2. 해당 방식으로 IP를 변경하는 방식은 시스템 재부팅 시 저장되지 않으니 참고하세요.
○ Max 주소 변경하는 방법
- ifconfig [NIC 인터페이스 이름] hw ether [변경할 Mac 주소]
/etc/init.d/networking stop
ifconfig eth0 hw ether 00:01:02:03:04:05
/etc/init.d/networking start
반응형