LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Vlan issue - main interface keeps getting an IP address (https://www.linuxquestions.org/questions/linux-networking-3/vlan-issue-main-interface-keeps-getting-an-ip-address-4175478810/)

Red Squirrel 09-27-2013 07:15 PM

Vlan issue - main interface keeps getting an IP address
 
I just setup vlans on my main server as I want to be able to bridge VMs to various vlans.

For some reason the main interface keeps getting the same IP as the main vlan (the one that is used to access the host). See here:

Quote:

[root@borg ~]#
[root@borg ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1C:C0:41:8F:97
inet addr:10.1.1.10 Bcast:10.1.255.255 Mask:255.255.0.0
inet6 addr: fe80::21c:c0ff:fe41:8f97/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:120660574 errors:0 dropped:236 overruns:0 frame:0
TX packets:424384218 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17608813742 (16.3 GiB) TX bytes:485458771832 (452.1 GiB)
Memory:e0600000-e0620000

eth0.2 Link encap:Ethernet HWaddr 00:1C:C0:41:8F:97
inet addr:10.1.1.10 Bcast:10.1.255.255 Mask:255.255.0.0
inet6 addr: fe80::21c:c0ff:fe41:8f97/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:405 errors:0 dropped:0 overruns:0 frame:0
TX packets:421 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:37730 (36.8 KiB) TX bytes:45851 (44.7 KiB)

eth0.3 Link encap:Ethernet HWaddr 00:1C:C0:41:8F:97
inet6 addr: fe80::21c:c0ff:fe41:8f97/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:30 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3540 (3.4 KiB) TX bytes:468 (468.0 b)

eth0.4 Link encap:Ethernet HWaddr 00:1C:C0:41:8F:97
inet6 addr: fe80::21c:c0ff:fe41:8f97/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:468 (468.0 b)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:343771 errors:0 dropped:0 overruns:0 frame:0
TX packets:343771 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:59498509 (56.7 MiB) TX bytes:59498509 (56.7 MiB)

virbr0 Link encap:Ethernet HWaddr 4A:AA:3A:B5:D1:3F
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::48aa:3aff:feb5:d13f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:5189 (5.0 KiB)

[root@borg ~]#

On a side note how do I disable the other interfaces from getting an ipv6 IP? I don't want them to be routable in any way shape or form, they are strictly there so I can bridge VMs to them (have not tested this yet but going to home/assume this works the way I think).

Here is the config for eth0:

ifcfg-eth0
Quote:

# Intel Corporation 82566DC-2 Gigabit Network Connection
DEVICE=eth0
BOOTPROTO=none
#BROADCAST=10.1.1.255
HWADDR=00:1c:c0:41:8f:97
#IPADDR=10.1.1.10
#NETMASK=255.255.0.0
#NETWORK=10.1.0.0
#GATEWAY=10.1.1.1
ONBOOT=yes
#NM_CONTROLLED=no
TYPE=Ethernet
Here is the config for eth0.2 (main vlan where server "resides" and is managed/accessed from)

ifcfg-eth0.2
Quote:

VLAN=yes
DEVICE=eth0.2
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=10.1.1.10
NETMASK=255.255.0.0
GATEWAY=10.1.1.1

If I change the IP of eth0.2 eth0 gets that IP. If I turn off eth0 it turns off all the vlans.. guessing this is normal behavior though.

Red Squirrel 09-27-2013 11:19 PM

Come to think of it, as far as functionality, everything seems to work fine. Playing around with VMs and such. Is this normal behavior?

Skaperen 09-28-2013 07:08 PM

Is the DHCP server connected to the LAN and VLAN involved? Or does some other device bridge them together? With the same MAC in both, a "same DHCP server" would be giving it the same IP it had before or on the other [V]LAN.

Red Squirrel 09-28-2013 07:19 PM

The firewall (pfsense) is what bridges them together, and does DHCP. The "eth0" equivalant interface on the firewall does not exist though, it's strictly vlan interfaces. I also have it set to bootproto=none, doesn't that mean, it should not be getting any IP or anything?


All times are GMT -5. The time now is 05:47 AM.