[Ubuntu] How to setup VLAN on same subnet as Ethernet
So this is what i'm trying to do:
I have a physical NIC with dev name eth0 with ip 192.168.1.2 and gateway 192.168.1.1 and I want to setup a VLAN with ip 192.168.1.x and same gateway as eth0. Setting up the VLAN runs smoothly and i give the VLAN a iface name of eth0.10 and an ip of 192.168.1.69. Now when trying to establish a connection i get an error: Code:
filserver:~$ sudo ifup eth0.10 Please help! Settings: /etc/network/interfaces Code:
# The loopback network interface Settings: ifconfig Code:
filserver:~$ ifconfig Code:
filserver:~$ netstat -anr Code:
filserver:~$ ping -I eth0.10 www.dn.se Code:
filserver:~$ ping -I eth0.10 8.8.8.8 |
Quote:
When you create a VLAN interface, it is bound to a physical interface. Outgoing traffic from the VLAN interface will be encapsulated using 802.1q VLAN tags, so you'll need a 802.1q-capable host, switch or router at the other end for this to work. Also, having two NICs (one physical, one VLAN) in the same machine does not mean having two gateways. IP addresses are assigned per NIC, gateways are assigned per host. In any case, two NICs belonging to different VLANs cannot share the same gateway, as the NICs belong to different layer 2 networks. I may be wrong, but I think perhaps VLAN is not what you're looking for. Exactly what are you trying to accomplish? |
First of all, thank you for your reply.
I am testing a anonymizer service that is using OpenVPN. I'm running a server with rtorrent and apache2 for example and I only want to tunnel the traffic to and from rtorrent through the VPN. I have been testing this alot and concluded that it is a policy routing issue. First I've setup a VLAN on the 10.x.x.x IP range and everything worked fine, all but one simple little thing: I had no connection to the internet. DOH! i had forgotten the gateway and since i've only have one router/switch (DLink DIR-655) with the assigned ip 192.168.1.1 and from what I've learned the 10.x.x.x range cannot communicate with 192.168.1.0/24 so setting 192.168.1.1 as gateway for the VLAN did'nt work. Any tips? |
I've resolved this whit another nic.
|
All times are GMT -5. The time now is 03:34 AM. |