Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a DAAP server with multiple VLAN interfaces. I would like to get traffic forwarded on all of the VLANs. Forwarded from eth0 to eth1.010* I've got the switch configured to be a trunk port with the correct VLANs, and I enabled /proc/sys/net/ipv4/ip_forward

But that doesn't seem to be doing the trick. Is there anything else I need to do?

Here is my ifconfig results, as you can see the VLAN interfaces aren't really getting any traffic:

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)

Here is my /etc/network/interfaces file:

# 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

Thank you for any help, I've been working on this for quite a while.

share|improve this question

3 Answers 3

I haven't done this on Ubuntu but here's my research so far:

You need to stick

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

in a startup script.

The interfaces file would look something like this:

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

You will use your own IPs in the interfaces file, obviously. Let us know if it worked.

References: 1 2

share|improve this answer

If I'm reading your question correctly, you are looking for bridging. Bridging forwards all traffic from one interface to another.

You will need to install bridge-utils package and setup your configuration as follows:

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

No configuration is required for the individual ports.

This will configure the ports to be in one bridge and should make everything accessible. You can see the state of the bridge with brctl command.

share|improve this answer
    
Thanks for the reply, but with these changes none of the eth1.* interfaces have IP addresses anymore. –  chris Aug 5 '10 at 13:56
    
the IP address assigned to the bridge is available from those networks. The interfaces themselves shouldn't have an address at all. –  Ressu Aug 5 '10 at 14:33
    
If each interface does not have an address how can I have one listening on each subnet / VLAN? –  chris Aug 5 '10 at 15:13
    
The bridging takes care of that. The individual interfaces are now slave interfaces to the br0 interface which is the one that replies to incoming packets from the network. –  Ressu Aug 5 '10 at 15:48
    
I need an IP address on each subnet since the DAAP protocol is not routable across subnets, and computers accessing this server need to be on the same subnet. Is there an easy way to get this working? –  chris Aug 5 '10 at 17:50
up vote 0 down vote accepted

It worked! I've got a separate problem with DAAP now, but I think it's Avahi related. I'll try to work through that myself. Thanks a ton.

share|improve this answer
1  
What was the solution to make it work? –  Li Lo Aug 6 '10 at 18:10
    
Your VLAN configuration but also I had the switch misconfigured. I had port15 on switch1 configured as the trunk port, and the server was plugged into port15 switch2. –  chris Aug 6 '10 at 19:38
1  
You should then mark the answer as helpful and accepted so people know what was the solution. And perhaps comment on the answer with details on what you had to do differently (if anything). Cheers! –  Li Lo Aug 6 '10 at 23:29
1  
chris, can you mark Li Lo's answer as the answer for the question, rather than posting your success message as an answer itself? –  SpamapS Aug 9 '10 at 5:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.