Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
title/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

# The primary network interface
auto em1
iface em1 inet static
        address 10.1.1.22
        netmask 255.255.255.0
        network 10.1.1.0
        broadcast 10.1.1.255
        gateway 10.1.1.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 8.8.8.8
        up ip netns add isolated
        up ip link set dev p4p2 netns isolated
        up ip netns exec isolated ip addr add 192.168.2.1/24 dev p4p2
        up ip netns exec isolated ip link set p4p2 up

#auto p4p2
#iface p4p2 inet static
#        address 192.168.2.1
#        netmask 255.255.255.0

auto p4p1.10
iface p4p1.10 inet static
    address 192.168.0.2
    netmask 255.255.255.0
    vlan-raw-device p4p1

auto p4p1.20
iface p4p1.20 inet static
    address 192.168.1.2
    netmask 255.255.255.0
    vlan-raw-device p4p1

auto p4p1.30
iface p4p1.30 inet static
    address 192.168.2.2
    netmask 255.255.255.0
    vlan-raw-device p4p1

In this file we added need to add seperated name space called isolated in which we put p4p2 interface. In order to have any action with that interface it is necessary to type ip netns exec isolated before any known command. For example, to see configuration on that interface we need to type the following:

...

Code Block
title/etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

8021q

In this file we added need to add 8021q in order to support tagging.

...