2

I have 4 VLANs created and I'm trying to use my Ubuntu machine as the DNS,DHCP, and L3 router. I want my 4 VLANs separated but still able to talk each other. Here is a bit about my setup.

Cable modem (Bridged)-->Ubuntu Server box (see below)-->Dell Power connect 2824 (in Managed mode) - L2 switch w/ IP address of 192.168.1.1

(4 VLANs setup within the Dell L2 switch) vlan1 (Mgmt) 192.168.1.0/24

vlan10 (home network) 192.168.10.0/24

vlan20 (Storage/Backups/Media server) 192.168.20.0/24

vlan30 (Work) 192.168.30.0/24

Ubuntu server 14.4 LTS eth0 - Cable modem IP (WAN) Netmask 255.255.224.0

eth1 - LAN side - 192.168.10.2 Netmask 255.255.255.0

I can NOT get the static routes setup on this to save my life. On Ubuntu server DNS works great. DHCP hands out addresses fine only for the 192.168.10.x network. It will not hand out addresses for the other VLANs. I assume that will work once we get all of the VLANs talking properly.

I understand the concepts but need specifics of what to change to get this working and routes should be persistent upon reboot. Thank you for the assist.


ip address show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:23:7d:f3:10:d2 brd ff:ff:ff:ff:ff:ff
    inet 70.115.129.7/19 brd 255.255.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::223:7dff:fef3:10d2/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:23:7d:f3:10:d0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.2/24 brd 192.168.10.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::223:7dff:fef3:10d0/64 scope link
       valid_lft forever preferred_lft forever


ip route show

default via 70.115.128.1 dev eth0
70.115.128.0/19 dev eth0  proto kernel  scope link  src 70.115.129.7
192.168.10.0/24 dev eth1  proto kernel  scope link  src 192.168.10.2

The new routing table after the VLAN interfaces were configured on the Linux router:

$ ip r s
default via 70.115.128.1 dev eth0
70.115.128.0/19 dev eth0 proto kernel scope link src 70.115.129.7
192.168.1.0/24 dev eth1.1 proto kernel scope link src 192.168.1.10
192.168.10.0/24 dev eth1.10 proto kernel scope link src 192.168.10.2
192.168.20.0/24 dev eth1.20 proto kernel scope link src 192.168.20.1

Many Thanks, Derek

  • I do not agree that this question to be closed. Even if this question is for a home config, I think it could help junior system admins to configure the network for a small company. – Mircea Vutcovici Jun 7 '16 at 21:11
0

On Linux server you need to create the vlan interfaces and assign static IP addresses. Follow the official Ubuntu documentation for details 1.

Configure DHCP to listen to all VLANs except the one facing the cable modem. You will need separate DHCP subnet for each VLAN. Make sure that you send via DHCP as default route the IP of the VLAN interface directly connected with that VLAN.

Use tshark/wireshark/tcpdump for debugging. Use them on both VLAN interfaces and on ethernet interface. You can filter for DHCP packets only if you have too much traffic:

Could you please edit your question and add the output of following commands from the router:

ip address show
ip route show

Edit /etc/network/interfaces and make sure you have for each VLAN a vlan interface configured. Here is only VLAN10:

# Disable IP on eth1, we are not using the native VLAN
iface eth1 inet manual

# VLAN 10 - home network
auto eth1.10
iface eth1.10 inet static
    address 192.168.10.1/24
    vlan-raw-device eth1

Make sure that eth1 has no IP assigned. you will assign IP addresses on VLAN interfaces (like eth1.10).

  • Added sorry I couldn't get the formatting right when it saved.. Here is a sample declaration from one of the vlans from dhcpd.conf as an example. # Vlan 20 - Storage Network subnet 192.168.20.0 netmask 255.255.255.0 { range 192.168.20.2 192.168.20.10; default-lease-time 600; max-lease-time 7200; #option routers 192.168.10.2; option broadcast-address 192.168.20.255; option subnet-mask 255.255.255.0; #option domain-name-servers 192.168.10.2, 209.18.47.62, 209.18.47.61; #hardware ethernet cc:e1:d5:8c:13:a6; #fixed-address 192.168.20.5; #} – dsmigelski Jun 6 '16 at 18:54
  • You need to create the VLAN interfaces on the router. Make sure that the switch port that is connected to the router is configured to have 802.1Q VLAN encapsulation and all VLANs are allowed on this port. See: wiki.ubuntu.com/vlan – Mircea Vutcovici Jun 6 '16 at 18:58
  • Yes I had some trouble getting those vlans created on the router. Followed wiki.ubuntu.com/vlan but I wasn't sure based on my setup what to ip addresses/settings to configure. – dsmigelski Jun 6 '16 at 19:03
  • meant to type...I wasn't sure based on my setup what ip address/settings to configure exactly and on what device (eth1?). Do you have an example based on my settings? – dsmigelski Jun 6 '16 at 19:09
  • As an example? auto eth1.1 iface eth1.1 inet static address 192.168.1.10/24 vlan-raw-device eth1 auto eth1.10 iface eth1.10 inet static address 192.168.10.1/24 vlan-raw-device eth1 auto eth1.20 iface eth1.20 inet static address 192.168.20.1/24 vlan-raw-device eth1 – dsmigelski Jun 6 '16 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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