ifconfig
명령을 실행하는 동안 다음과 같은 출력이 나타납니다. eth1
내 Python 서버가 실행 중인 포트의 IP 주소가 필요합니다 .
eth0 Link encap:Ethernet HWaddr 08:00:27:CE:08:3D
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fece:83d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2474 errors:0 dropped:0 overruns:0 frame:0
TX packets:1511 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:204674 (199.8 KiB) TX bytes:158605 (154.8 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:18:CF:85
inet6 addr: **fe80::a00:27ff:fe18:cf85/64** Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20998 errors:0 dropped:0 overruns:0 frame:0
TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1648690 (1.5 MiB) TX bytes:10524 (10.2 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet6 addr: fe80::1/128 Scope:Link
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:340 (340.0 b) TX bytes:515 (515.0 b)
inet6 addr: fe80::a00:27ff:fe18:cf85/64
for는 eth1
표준 IP 주소 형식이 아닙니다. IP 주소를 얻으려면 어떻게 해야 하나요?eth1
편집 1:명령 결과 ip
:
[root@localhost config]# ip a l dev eth1
eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:18:cf:85 brd ff:ff:ff:ff:ff:ff
inet6 fe80::a00:27ff:fe18:cf85/64 scope link
valid_lft forever preferred_lft forever
답변1
fe80::/64
에 예약된 IPv6 주소입니다.로컬 링크. ip a l dev eth1
이 특정 인터페이스에 IP 주소를 표시하는 데 충분해야 합니다(DHCP 서버를 통해 할당되거나 획득된 경우).
읽을 가치가 있는: