You are not logged in.

#1 2013-10-31 21:10:02

abali
Member
Registered: 2013-10-31
Posts: 4

Virtual network interfaces?

I have Arch Linux running on a LAN consisting of multiple computers and a router towards internet via ADSL. The Arch Linux machine receives its LAN IP via DHCP from the router and generates heavy traffic that stays within the LAN and some traffic that goes out to the internet via the router, all flowing through the same physical network interface.

I would like to be able to measure these two traffics separately in an easy and straightforward way and I was thinking that maybe if they could be split to two different virtual interfaces despite being on the same physical interface, that would be super easy as I would not have to mess with packet-level data. Also stuff like vnstat could work as I would just simply have LAN traffic shown on one virtual interface and internet traffic shown on an other.

However despite some googling I am not able to figure out how this could work at all. Do you have any pointers that could be helpful? I would prefer that both virtual interfaces receive a different IP from the router via DHCP.

Offline

#2 2013-11-01 13:13:10

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,489

Re: Virtual network interfaces?

Welcome to the Arch forum.
Virtual interfaces eq.  vlan interfaces with linux onboard magic:

ip link add link eth0 name eth.10 type vlan id 10
ip link add link eth0 name eth.20 type vlan id 20

Maybe that's all you need.

Offline

#3 2013-11-01 19:12:52

abali
Member
Registered: 2013-10-31
Posts: 4

Re: Virtual network interfaces?

Well thanks for reply but VLAN is something quite different and would require all devices on the LAN to be VLAN-aware.  I was rather thinking about aliases (eth0:1, eth0:2 etc).

Offline

#4 2013-11-01 19:25:41

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,489

Re: Virtual network interfaces?

abali wrote:

Well thanks for reply but VLAN is something quite different and would require all devices on the LAN to be VLAN-aware.

Why?
You wrote in your first post 

abali wrote:

I would prefer that both virtual interfaces receive a different IP from the router via DHCP

Offline

#5 2013-11-01 20:53:12

abali
Member
Registered: 2013-10-31
Posts: 4

Re: Virtual network interfaces?

Because VLAN tags all packets and those packets are received by only the designated devices. And that's not my objective and not all my devices are VLAN aware. I do not want to interfere with packets leaving the machine, I just want a logical separation internally, by routing traffic via two virtual interfaces.

Offline

#6 2013-11-01 21:21:17

abali
Member
Registered: 2013-10-31
Posts: 4

Re: Virtual network interfaces?

However vnstat manual says that:

Virtual and aliased interfaces cannot be monitored because the kernel doesn't provide traffic information for that type of interfaces. Such interfaces are usually named eth0:0, eth0:1, eth0:2 etc. where eth0 is the actual interface being aliased.

Which is bad news as it compromises the original goal. So VLAN is not feasible due to lack of device support, interface aliases would not work due to lack of kernel features, any further ideas? Basically I would like vnstat to show statistics separately for internet-bound traffic and local traffic, on a machine with a single NIC.

Offline

Board footer

Powered by FluxBB