아마도 간단한 대답이 있을 것 같은데, 찾을 수 없는 것 같습니다. 저는 멀티 홈 Debian Stable(최신)을 실행 중이고 인터페이스 eth1에는 IPv4 및 IPv6 주소가 필요합니다. 내 /etc/network/interfaces는 다음과 같습니다:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
up ip -6 address add 2001:470:28:5b2::1/64 dev $IFACE
문제는 인터페이스에 IPv6 주소가 아닌 IPv4 주소만 할당된다는 것입니다. 내가 무엇을 놓치고 있나요?
달리는 동안ifup-av:
g00nz@debie:~$ sudo ifup -av
[sudo] password for g00nz:
run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
Configuring interface eth1=eth1 (inet)
run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
ip addr add 192.168.1.2/255.255.255.0 broadcast 192.168.1.255 dev eth1 label eth1
RTNETLINK answers: File exists
Failed to bring up eth1.
run-parts --exit-on-error --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/avahi-daemon
run-parts: executing /etc/network/if-up.d/mountnfs
run-parts: executing /etc/network/if-up.d/openssh-server
run-parts: executing /etc/network/if-up.d/upstart
run-parts: executing /etc/network/if-up.d/wpasupplicant
eth1이 구성되어 있고 IPv6 주소를 추가할 수 없는 것 같지만 basprompt에서 이 작업을 수행하면 작동합니다.
sudo ip -6 addr add 2001:470:28:5b2::1/64 dev eth1
그리고 확인ifconfig eth1:
g00nz@debie:~$ sudo ip -6 addr add 2001:470:28:5b2::1/64 dev eth1
g00nz@debie:~$ sudo ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:24:9b:08:4b:aa
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: 2001:470:28:5b2::1/64 Scope:Global
inet6 addr: fe80::224:9bff:fe08:4baa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4254 errors:0 dropped:2080 overruns:0 frame:0
TX packets:305 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:469773 (458.7 KiB) TX bytes:45395 (44.3 KiB)
누구나? :(
/알았다
좋아, 한번 시도해 보고 이제 이것을 내 /etc/network/interfaces에 추가하십시오:
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
iface eth1 inet6 static
address 2001:470:28:5b2::1
netmask 64
그런데 확인해 보니IP 하나나는 가지고있다:
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:24:9b:08:4b:aa brd ff:ff:ff:ff:ff:ff
inet 192.168.1.2/24 brd 192.168.1.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::224:9bff:fe08:4baa/64 scope link
valid_lft forever preferred_lft forever
나는 주장하지 않습니다 :(
ifup에서 여전히 오류가 발생합니다.
g00nz@debie:~$ sudo ifup -av
[sudo] password for g00nz:
run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
Configuring interface eth1=eth1 (inet)
run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
ip addr add 192.168.1.2/255.255.255.0 broadcast 192.168.1.255 dev eth1 label eth1
RTNETLINK answers: File exists
Failed to bring up eth1.
run-parts --exit-on-error --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/avahi-daemon
run-parts: executing /etc/network/if-up.d/mountnfs
run-parts: executing /etc/network/if-up.d/openssh-server
run-parts: executing /etc/network/if-up.d/upstart
run-parts: executing /etc/network/if-up.d/wpasupplicant
g00nz@debie:~$
답변1
ifup
인터페이스에 이미 IPv4 주소가 있고 두 번 추가할 수 없기 때문에 프로그램이 실행되지 않을 수 있습니다 . IPv6 라인에도 도달하지 않습니다. 가능하다면 모든 주소가 제거되도록 인터페이스를 닫았다가 다시 열어야 합니다.
IPv6 구성은 다르게 수행되어야 합니다.
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
iface eth1 inet6 static
address 2001:470:28:5b2::1
netmask 64
필요한 경우 게이트웨이를 추가할 수도 있습니다.
netmask 24
추신: 많은 사람들이 IPv4도 사용할 수 있다는 사실 을 모르는 것 같습니다 . 당신은 그것을 철자 할 필요가 없습니다 netmask 255.255.255.0
.