내 컴퓨터에는 네트워크 카드가 하나만 있습니다.
lshw -class network
WARNING: you should run this program as super-user.
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:06:00.0
logical name: enp6s0
version: 15
serial:
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.10.0-8-amd64 duplex=full ip=192.168.31.43 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:32 ioport:f000(size=256) memory:fcd04000-fcd04fff memory:fcd00000-fcd03fff
*-network:0
description: Ethernet interface
physical id: 1
logical name: anbox0
serial:
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=192.168.250.1 link=no multicast=yes
*-network:1
description: Ethernet interface
physical id: 2
logical name: lxcbr0
serial:
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=10.0.3.1 link=no multicast=yes
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
모든 IP 주소 표시:
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether xxxxxxxxxxxxxxxxxxxx brd ff:ff:ff:ff:ff:ff
inet 192.168.31.43/24 brd 192.168.31.255 scope global dynamic enp6s0
valid_lft 37676sec preferred_lft 37676sec
inet 192.168.31.42/24 brd 192.168.31.255 scope global secondary enp6s0
valid_lft forever preferred_lft forever
inet6 fe80::2e0:70ff:fec2:2e91/64 scope link
valid_lft forever preferred_lft forever
3: anbox0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether brd ff:ff:ff:ff:ff:ff
inet 192.168.250.1/24 scope global anbox0
valid_lft forever preferred_lft forever
inet6 fe80::bce8:93ff:fe88:11c1/64 scope link
valid_lft forever preferred_lft forever
4: lxcbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether brd ff:ff:ff:ff:ff:ff
inet 10.0.3.1/24 brd 10.0.3.255 scope global lxcbr0
valid_lft forever preferred_lft forever
내 컴퓨터에 IP 주소가 두 개 있는 이유는 무엇입니까 192.168.31.43
?192.168.31.42
운영 체제 정보:
cat /etc/issue
Debian GNU/Linux 11 \n \l
네트워크 구성 파일:
cat /etc/network/interfaces
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
allow-hotplug enp6s0
iface enp6s0 inet dhcp
내 로컬 네트워크는 어떤 IP 주소를 사용합니까?
sudo nmap -sP 192.168.31.0/24
Starting Nmap 7.80 ( https://nmap.org ) at 2021-08-21 21:41 HKT
Nmap scan report for XiaoQiang (192.168.31.1)
Host is up (0.00026s latency).
Nmap scan report for 192.168.31.42
Host is up.
Nmap scan report for 192.168.31.43
Host is up.
Nmap done: 256 IP addresses (3 hosts up) scanned in 1.98 seconds
192.168.31.1
인터넷과 인트라넷을 연결해주는 라우터입니다.
두 개의 IP를 동시에 사용하시겠습니까 192.168.31.42
? 192.168.31.43
간단한 홈 라우터와 결합된 새 컴퓨터를 로컬 네트워크에 추가하세요.
sudo nmap -sP 192.168.31.0/24
Starting Nmap 7.80 ( https://nmap.org ) at 2021-08-21 21:41 HKT
Nmap scan report for XiaoQiang (192.168.31.1)
Host is up (0.00026s latency).
MAC Address: (Unknown)
Nmap scan report for 192.168.31.70
Host is up (0.000057s latency).
MAC Address: 00:E0:72:64:2C:19 (Lynk)
Nmap scan report for 192.168.31.42
Host is up.
Nmap scan report for 192.168.31.43
Host is up.
Nmap done: 256 IP addresses (4 hosts up) scanned in 1.98 seconds
새 컴퓨터의 IP는 입니다 . "192.168.31.42 192.168.31.43" 192.168.31.70
에서 연결을 시도합니다 .192.168.31.70
and
ssh [email protected]
ls /home/debian
content1
ctrl+D ,exit the connection
ssh [email protected]
ls /home/debian
content2
뭔가 이상한 일이 일어납니다: content1 == content2 ! 두 IP가 동시에 동일한 네트워크 카드를 가리킵니다! !