우분투 15.10 네트워크 문제

우분투 15.10 네트워크 문제

최근 Ubuntu 15.10을 사용하여 가상 머신을 배포했는데 네트워크를 올바르게 구성하는 데 문제가 있습니다. 참고: OS를 설치할 때 네트워크 설정을 요청하지 않았기 때문에 IP(DHCP로부터)를 얻습니다. 설치 후 해당 IP를 통해 서버에 액세스할 수 있습니다. 그런데 계속해서 서버에 다른 IP(10.100.144.115)를 추가하려고 하는데 서버에서 수신이 되지 않습니다.

이것이 /etc/network/interfaces에 있는 것입니다:

root@blah20:/etc/network# cat 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 ens33
iface lo inet loopback

# The primary network interface – use DHCP to find our address
auto ens33
iface ens33 inet static
address 10.100.144.142
netmask 255.255.255.0
broadcast 10.100.144.255
gateway 10.100.144.1
dns-nameserver 8.8.8.8

# The secondary IP – This one is very important as it hosts the Portal.
auto ens33
iface ens33:0 inet static
address 10.100.144.115
netmask 255.255.255.0
gateway 10.100.144.1
root@blah20:/etc/network#

네트워크를 다시 시작하면 첫 번째 IP만 얻습니다.

root@blah20:/etc/network# ifconfig
ens33     Link encap:Ethernet  HWaddr 00:50:56:a4:5e:35
          inet addr:10.100.144.142  Bcast:10.100.144.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fea4:5e35/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:482877 errors:2 dropped:2 overruns:0 frame:0
          TX packets:44446 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:108341017 (108.3 MB)  TX bytes:14661830 (14.6 MB)
          Interrupt:19 Base address:0x2000

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:1724 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1724 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:170653 (170.6 KB)  TX bytes:170653 (170.6 KB)

root@blah20:/etc/network#

다양한 방법을 시도했지만 아무것도 작동하지 않는 것 같습니다. 누구든지 내가 뭘 잘못하고 있는지 말해 줄 수 있나요? CentOS나 다른 버전에서는 이런 문제가 발생한 적이 없습니다.

답변1

내 생각에 문제는 당신이 가지고 있다는 것입니다자동 ens33다시 교체하다자동 ens33:0두 번째 섹션에서. 현재로서는 구성을 통해 다음을 수행할 수 있습니다.ifup ens33:0수동으로 시작하십시오.

답변2

위의 내 의견은 올바르지 않습니다. 두 개의 별도 섹션이 필요하지만 인터페이스 이름은 동일해야 합니다. 그리고 두 번 할 필요도 없습니다 auto.

문서의 수정된 부분은 다음과 같습니다.

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface – use DHCP to find our address
auto ens33
iface ens33 inet static
address 10.100.144.142
netmask 255.255.255.0
gateway 10.100.144.1
dns-nameserver 8.8.8.8

# The secondary IP – This one is very important as it hosts the Portal.
iface ens33 inet static
address 10.100.144.115
netmask 255.255.255.0

(기본적으로 브로드캐스트 주소는 마지막 유효한 주소이므로 명시적인 설명이 필요하지 않습니다.)

여기서는 DHCP를 사용하지 않으므로 첫 번째 설명이 올바르지 않습니다.

address아래와 같이 주소 뒤에 접두사를 지정하여 선택적으로 합계 라인을 결합할 수 있습니다 .netmask

# The primary network interface – use DHCP to find our address
auto ens33
iface ens33 inet static
address 10.100.144.142/24
gateway 10.100.144.1
dns-nameserver 8.8.8.8

# The secondary IP – This one is very important as it hosts the Portal.
iface ens33 inet static
address 10.100.144.115/24

관련 정보