web-development-kb-ko.site

VLAN 전달을 어떻게 설정합니까?

여러 VLAN 인터페이스가있는 DAAP 서버가 있습니다. 모든 VLAN에서 트래픽을 전달하고 싶습니다. eth0에서 eth1.010으로 전달 * 스위치가 올바른 VLAN이있는 트렁크 포트이며 / proc/sys/net/ipv4/ip_forward

그러나 그것은 트릭을 수행하지 않는 것 같습니다. 내가해야 할 다른 일이 있습니까?

VLAN 인터페이스에 실제로 트래픽이 발생하지 않음)을 볼 수 있듯이 ifconfig 결과는 다음과 같습니다.

eth0      Link encap:Ethernet  HWaddr 00:14:d1:10:ca:fc  
          inet addr:192.168.1.20  Bcast:172.21.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:536 errors:0 dropped:0 overruns:0 frame:0
          TX packets:259 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:264232 (258.0 KiB)  TX bytes:37425 (36.5 KiB)
          Interrupt:20 Base address:0xe000 

eth1      Link encap:Ethernet  HWaddr 00:1c:c4:31:28:22  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:303 errors:0 dropped:0 overruns:0 frame:0
          TX packets:202 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:225213 (219.9 KiB)  TX bytes:47118 (46.0 KiB)
          Interrupt:17 

eth1.0101 Link encap:Ethernet  HWaddr 00:1c:c4:31:28:22  
          inet addr:172.17.1.20  Bcast:172.17.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:9076 (8.8 KiB)

eth1.0102 Link encap:Ethernet  HWaddr 00:1c:c4:31:28:22  
          inet addr:172.18.1.20  Bcast:172.18.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:9076 (8.8 KiB)

eth1.0103 Link encap:Ethernet  HWaddr 00:1c:c4:31:28:22  
          inet addr:172.19.1.20  Bcast:172.19.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:9076 (8.8 KiB)

eth1.0104 Link encap:Ethernet  HWaddr 00:1c:c4:31:28:22  
          inet addr:172.20.1.20  Bcast:172.20.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:9076 (8.8 KiB)

eth1.0105 Link encap:Ethernet  HWaddr 00:1c:c4:31:28:22  
          inet addr:172.21.1.20  Bcast:172.21.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:9076 (8.8 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:113 errors:0 dropped:0 overruns:0 frame:0
          TX packets:113 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:20777 (20.2 KiB)  TX bytes:20777 (20.2 KiB)

내/etc/network/interfaces 파일은 다음과 같습니다.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# Automagically configured network interfaces
auto eth0
auto eth1.0101
auto eth1.0102
auto eth1.0103
auto eth1.0104
auto eth1.0105

iface eth0 inet static
   address 192.168.1.20
   netmask 255.255.0.0
   gateway 192.168.1.3
   network 172.21.0.0
   broadcast 172.21.255.255

iface eth1.0101 inet static
   address 172.17.1.20
   netmask 255.255.255.0


iface eth1.0102 inet static
   address 172.18.1.20
   netmask 255.255.255.0


iface eth1.0103 inet static
   address 172.19.1.20
   netmask 255.255.255.0


iface eth1.0104 inet static
   address 172.20.1.20
   netmask 255.255.255.0


iface eth1.0105 inet static
   address 172.21.1.20
   netmask 255.255.255.0

도움을 주셔서 감사합니다.이 작업은 꽤 오랫동안 진행되었습니다.

3
chris

효과가 있었다! DAAP와는 별도로 문제가 있지만 Avahi와 관련이 있다고 생각합니다. 나는 그것을 스스로 해결하려고 노력할 것이다. 엄청 고마워.

0
chris

우분투에서 이것을하지 않았지만 여기까지의 연구가 있습니다.

당신은 스틱해야합니다

vconfig add eth1 101  
vconfig add eth1 102  
vconfig add eth1 103  
vconfig add eth1 104  
vconfig add eth1 105

시작 스크립트에서.

인터페이스 파일은 다음과 같습니다.

auto lo
iface lo inet loopback
auto eth0 eth1 vlan2 vlan3 vlan4 vlan5
iface eth0 inet dhcp

# VLAN 1 - native management VLAN
iface eth1 inet static
        address 10.0.0.1
        netmask 255.255.255.224
        vlan_raw_device eth1

# VLAN 2 - DMZ
iface vlan2 inet static
        address 10.0.0.33
        netmask 255.255.255.224
        vlan_raw_device eth1

# VLAN 3 - Accounting
iface vlan3 inet static
        address 10.0.0.65
        netmask 255.255.255.224
        vlan_raw_device eth1

# VLAN 2 - DMZ
iface vlan2 inet static
        address 10.0.0.33
        netmask 255.255.255.224
        vlan_raw_device eth1

# VLAN 3 - Accounting
iface vlan3 inet static
        address 10.0.0.65
        netmask 255.255.255.224
        vlan_raw_device eth1

# VLAN 4 - Engineering
iface vlan4 inet static
        address 10.0.0.97
        netmask 255.255.255.224
        vlan_raw_device eth1

# VLAN 5 - Sales & Marketing
iface vlan5 inet static
        address 10.0.0.129
        netmask 255.255.255.224
        vlan_raw_device eth1

인터페이스 파일에서 자신의 IP를 사용하게 될 것입니다. 작동하는지 알려주세요.

참조 : 12

4
Li Lo

내가 당신의 질문을 올바르게 읽고 있다면, 당신은 브리징을 찾고 있습니다. 브리징은 한 인터페이스에서 다른 인터페이스로 모든 트래픽을 전달합니다.

Bridge-utils 패키지를 설치하고 다음과 같이 구성을 설정해야합니다.

auto br0
iface br0 inet static
  address 192.168.1.20
  netmask 255.255.0.0
  gateway 192.168.1.3
  bridge_ports eth0 eth1.0101 eth1.0102 eth1.0103 eth1.0104 eth1.0105

개별 포트에는 구성이 필요하지 않습니다.

이렇게하면 포트가 하나의 브리지에 있도록 구성되며 모든 것이 액세스 가능해야합니다. brctl 명령으로 브릿지의 상태를 볼 수 있습니다.

0
Ressu