Ethernet
Ethernet
The standard technology for wired LANs. MAC address-based communication. 1Gbps and 10Gbps speeds.
Ethernet
The standard technology for wired LANs. MAC address-based communication. 1Gbps and 10Gbps speeds.
Ethernet is the de facto standard technology for wired LANs (Local Area Networks). It was invented by Robert Metcalfe at Xerox PARC in 1973 and standardized as IEEE 802.3. As the most common way to connect computers and network equipment in offices, data centers, and homes, Ethernet is used by more than 95% of the world's wired networks.
Ethernet identifies devices using MAC (Media Access Control) addresses. A MAC address is a unique identifier consisting of 48 bits (6 bytes), in a format such as "00:1A:2B:3C:4D:5E". It is assigned to the network interface card (NIC) at manufacture and serves as the basis for frame transmission at the data link layer (OSI Layer 2).
Ethernet speeds started at 10Mbps and have evolved through Fast Ethernet (100Mbps), Gigabit Ethernet (1Gbps), 10GbE, 25GbE, 40GbE, and 100GbE. In modern data centers, 400GbE and 800GbE are also being introduced. In ordinary homes and offices, Gigabit Ethernet (1000BASE-T) is the standard, and it can connect over CAT5e or CAT6 cable up to 100m.
An Ethernet frame consists of a Preamble (8 bytes), destination/source MAC addresses (6 bytes each), Type/Length (2 bytes), Payload (46–1500 bytes), and FCS (4 bytes). A switch learns the MAC address table and forwards frames only to the destination port, thereby improving network efficiency. VLANs make it possible to logically separate a physical network.
import subprocess
import re
from scapy.all import Ether, ARP, srp, get_if_hwaddr, conf
# 현재 시스템의 MAC 주소 확인
def get_mac_address():
mac = get_if_hwaddr(conf.iface)
print(f"내 MAC 주소: {mac}")
return mac
# 네트워크 장치 스캔 (ARP 사용)
def scan_network(ip_range):
"""같은 LAN 내의 활성 장치들을 스캔"""
# Ethernet 프레임 + ARP 요청
ether = Ether(dst="ff:ff:ff:ff:ff:ff") # 브로드캐스트
arp = ARP(pdst=ip_range)
packet = ether / arp
result = srp(packet, timeout=3, verbose=0)[0]
devices = []
for sent, received in result:
devices.append({
'ip': received.psrc,
'mac': received.hwsrc
})
return devices
# 사용 예시
if __name__ == "__main__":
get_mac_address()
# 192.168.1.0/24 네트워크 스캔
print("\n네트워크 스캔 중...")
devices = scan_network("192.168.1.0/24")
print(f"\n발견된 장치: {len(devices)}개")
print("-" * 45)
print(f"{'IP 주소':<20} {'MAC 주소':<20}")
print("-" * 45)
for device in devices:
print(f"{device['ip']:<20} {device['mac']:<20}")
# MAC 주소 확인
ip link show # Linux
ifconfig # macOS/Linux
ipconfig /all # Windows
# 네트워크 인터페이스 상세 정보 (이더넷 속도 포함)
ethtool eth0 # 링크 속도, 듀플렉스 모드 확인
ethtool -i eth0 # 드라이버 정보
ethtool -S eth0 # 통계 (패킷 수, 에러 등)
# 이더넷 속도 변경 (1Gbps full-duplex)
sudo ethtool -s eth0 speed 1000 duplex full autoneg off
# ARP 테이블 확인 (IP-MAC 매핑)
arp -a # 모든 ARP 엔트리
ip neigh show # Linux (최신 방식)
# 같은 LAN 내 장치 스캔 (nmap)
nmap -sn 192.168.1.0/24 # Ping 스캔
nmap -sP 192.168.1.0/24 # 빠른 호스트 발견
# 스위치의 MAC 주소 테이블 확인 (Cisco)
# show mac address-table
# show mac address-table dynamic
# VLAN 설정 확인 (Linux)
cat /proc/net/vlan/config
ip -d link show eth0.100
# tcpdump로 이더넷 프레임 캡처
sudo tcpdump -i eth0 -e -c 10
# -e: 이더넷 헤더 출력, -c: 패킷 수 제한
const os = require('os');
const { exec } = require('child_process');
const { promisify } = require('util');
const execAsync = promisify(exec);
// 시스템의 모든 네트워크 인터페이스 MAC 주소 확인
function getNetworkInterfaces() {
const interfaces = os.networkInterfaces();
const results = [];
for (const [name, addrs] of Object.entries(interfaces)) {
for (const addr of addrs) {
if (addr.mac && addr.mac !== '00:00:00:00:00:00') {
results.push({
interface: name,
mac: addr.mac,
ip: addr.address,
family: addr.family,
internal: addr.internal
});
}
}
}
return results;
}
// 이더넷 인터페이스 정보 출력
const interfaces = getNetworkInterfaces();
console.log('네트워크 인터페이스 목록:\n');
interfaces.forEach(iface => {
if (!iface.internal) { // 외부 인터페이스만
console.log(`인터페이스: ${iface.interface}`);
console.log(` MAC 주소: ${iface.mac}`);
console.log(` IP 주소: ${iface.ip} (${iface.family})`);
console.log('');
}
});
// ARP 테이블 조회 (같은 LAN 내 장치)
async function getArpTable() {
try {
const { stdout } = await execAsync('arp -a');
console.log('ARP 테이블 (IP-MAC 매핑):\n');
console.log(stdout);
} catch (err) {
console.error('ARP 테이블 조회 실패:', err.message);
}
}
getArpTable();
"We'll build the server room backbone with 10GbE and connect each rack with a 1GbE switch. CAT6A cable supports up to 10Gbps, and a future upgrade to 25GbE is also possible. We'll choose a Layer 3 switch so that it can also handle routing between VLANs."
"A MAC flooding attack is suspected. The switch's MAC table is full, so it is broadcasting to all ports like a hub. We need to configure port security to limit the number of MAC addresses per port. For now, we'll shut down that port."
"An Ethernet frame consists of the destination MAC, source MAC, EtherType, payload, and FCS. The switch learns the source MAC and stores it in the table, then looks up the destination MAC in the table and forwards only to the corresponding port. If it isn't in the table, it floods. This is the biggest difference from a hub."
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
If you use CAT5 cable for Gigabit, the connection works, but speed drops and errors increase. Use at least CAT5e for 1Gbps and CAT6A or higher for 10Gbps.
If a loop occurs between switches, a broadcast storm paralyzes the network. Be sure to enable STP (Spanning Tree Protocol), and configure RSTP for fast recovery on critical servers.
If one side is set to Auto and the other to Fixed, a speed/duplex mismatch occurs. Use Auto-negotiation on both sides, or fix both sides to the same value.
Limit MAC addresses with port security, separate broadcast domains with VLANs, and tag VLANs with 802.1Q trunking. Secure bandwidth and redundancy for critical links with Link Aggregation (LACP).