Witam
To będzie długie... Wciąż próbuję zgłębić temat vlan-ów ale coś czuję że po drodze popsułem. Niestety nie moge znaleść przyczyny nieprawidłowego działania sieci.Ale do rzeczy...
SWITCH:
Mam dwa switche TPLINK TL-SL2452WEB spięte 1 portem tak jak w instrukcji tplinka http://www.tp-link.com.pl/faq-294.html. Oba switche mają na stałe przypisany adres z puli dla sieci vlan20 (odpowiednio 192.168.2.1 i 192.168.2.2).
Sieć LAN podłączona z eth1 na port GGA1, vlany mają ID odpowiednio 20,30 i 40. Zakładam że opis tplinka wyczerpuje moje potrzeby (przynajmniej na tym etapie).
SERWER:
ETH0- NET
ETH1- LAN (vlan20 vlan30)
Vlany ustawiłem zgodnie z opisem na stronie: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Configure_802_1Q_VLAN_Tagging_Using_the_Command_Line.html
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPV6INIT=no
# cat /etc/sysconfig/network-scripts/ifcfg-vlan20
VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
DEVICE=vlan20
PHYSDEV=eth1
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:30:4F:25:75:EA
IPADDR=192.168.2.10
NETMASK=255.255.255.0
NETWORK=192.168.2.0
USERCTL=no
NM_CONTROLLED=no
IPV6INIT=no
ARPCHECK=no
# cat /etc/sysconfig/network-scripts/ifcfg-vlan30
VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
DEVICE=vlan30
PHYSDEV=eth1
ONBOOT=yes
HWADDR=00:30:4F:25:75:EA
IPADDR=192.168.3.10
NETMASK=255.255.255.0
NETWORK=192.168.3.0
USERCTL=no
NM_CONTROLLED=no
BOOTPROTO=static
IPV6INIT=no
ARPCHECK=no
# ifconfig
eth0 Link encap:Ethernet HWaddr 20:CF:30:B6:44:13
inet addr:192.168.0.249 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6698 errors:0 dropped:0 overruns:0 frame:0
TX packets:210 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:597891 (583.8 KiB) TX bytes:23683 (23.1 KiB)
eth1 Link encap:Ethernet HWaddr 00:30:4F:25:75:EA
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:450 errors:0 dropped:0 overruns:0 frame:0
TX packets:243 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:50370 (49.1 KiB) TX bytes:30310 (29.5 KiB)
Interrupt:19 Base address:0xcc00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:26 errors:0 dropped:0 overruns:0 frame:0
TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2912 (2.8 KiB) TX bytes:2912 (2.8 KiB)
vlan20 Link encap:Ethernet HWaddr 00:30:4F:25:75:EA
inet addr:192.168.2.10 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:111 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:13969 (13.6 KiB)
vlan30 Link encap:Ethernet HWaddr 00:30:4F:25:75:EA
inet addr:192.168.3.10 Bcast:192.168.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:105 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:13717 (13.3 KiB)
# ip -d link show vlan20
5: vlan20@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 00:30:4f:25:75:ea brd ff:ff:ff:ff:ff:ff
vlan id 20 <REORDER_HDR>
[root@test ~]# ip -d link show vlan30
6: vlan30@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 00:30:4f:25:75:ea brd ff:ff:ff:ff:ff:ff
vlan id 30 <REORDER_HDR>
Dodałem vlany do /etc/hosts. Na oba interfejsy da się puścić pinga
# ping vlan20
PING vlan20 (192.168.2.10) 56(84) bytes of data.
64 bytes from vlan20 (192.168.2.10): icmp_seq=1 ttl=64 time=0.037 ms
64 bytes from vlan20 (192.168.2.10): icmp_seq=2 ttl=64 time=0.023 ms
^C
--- vlan20 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1741ms
rtt min/avg/max/mdev = 0.023/0.030/0.037/0.007 ms
# ping vlan30
PING vlan30 (192.168.3.10) 56(84) bytes of data.
64 bytes from vlan30 (192.168.3.10): icmp_seq=1 ttl=64 time=0.039 ms
64 bytes from vlan30 (192.168.3.10): icmp_seq=2 ttl=64 time=0.023 ms
^C
--- vlan30 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1298ms
rtt min/avg/max/mdev = 0.023/0.031/0.039/0.008 ms
Tablica routingu wygląda tak:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 vlan30
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 vlan20
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1005 0 0 vlan20
169.254.0.0 0.0.0.0 255.255.0.0 U 1006 0 0 vlan30
0.0.0.0 192.168.0.240 0.0.0.0 UG 0 0 0 eth0
Mam nadzieję, że jak do tej pory jest wszystko ok.
W kolejnym kroku idąc za sugesią Pawła Kraszewskiego (dzięki!) skonfigurowałem dhcp bez shared-network
ddns-update-style interim;
ignore client-updates;
authoritative;
default-lease-time 21600;
max-lease-time 86400;
option domain-name-servers 444.333.222.111;
option domain-name "domena.pl";
#+++++++++++++++++++++++++++++++++++ Wydział1 ++++++++++++++++++++++++++++++++++++++++++++++++++#
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.10;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.2.255;
}
host USER {USER;hardware ethernet F0:4D:A2:A6:3A:2B;fixed-address 192.168.2.101;}
#+++++++++++++++++++++++++++++++++++ Wydział2 +++++++++++++++++++++++++++++++++++++++++++++++++++#
subnet 192.168.3.0 netmask 255.255.255.0 {
option routers 192.168.3.10;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.3.255;
}
host USER2 {USER2;hardware ethernet F0:4D:A2:A6:3A:2B;fixed-address 192.168.3.101;}
# cat /etc/sysconfig/dhcpd
# Command line options here
DHCPDARGS="vlan20 vlan30"
# service dhcpd restart
Wyłączanie dhcpd: [ OK ]
Uruchamianie dhcpd: [ OK ]
...
Apr 28 13:32:18 test dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1
Apr 28 13:32:18 test dhcpd: Copyright 2004-2010 Internet Systems Consortium.
Apr 28 13:32:18 test dhcpd: All rights reserved.
Apr 28 13:32:18 test dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Apr 28 13:32:18 test dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Apr 28 13:32:18 test dhcpd: Wrote 0 deleted host decls to leases file.
Apr 28 13:32:18 test dhcpd: Wrote 0 new dynamic host decls to leases file.
Apr 28 13:32:18 test dhcpd: Wrote 0 leases to leases file.
Apr 28 13:32:18 test dhcpd: Listening on LPF/vlan30/00:30:4f:25:75:ea/192.168.3.0/24
Apr 28 13:32:18 test dhcpd: Sending on LPF/vlan30/00:30:4f:25:75:ea/192.168.3.0/24
Apr 28 13:32:18 test dhcpd: Listening on LPF/vlan20/00:30:4f:25:75:ea/192.168.2.0/24
Apr 28 13:32:18 test dhcpd: Sending on LPF/vlan20/00:30:4f:25:75:ea/192.168.2.0/24
Apr 28 13:32:18 test dhcpd: Sending on Socket/fallback/fallback-net
Wpinam LAN w switche na port GGA1:
Apr 28 13:42:19 test kernel: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
Apr 28 13:42:19 test kernel: ADDRCONF(NETDEV_CHANGE): vlan30: link becomes ready
Apr 28 13:42:19 test kernel: ADDRCONF(NETDEV_CHANGE): vlan20: link becomes ready
Pomyślałem, że cas na próbę. Przepinam kompa na port w sieci vlan20 i.... lipa.
Apr 26 16:58:01 test kernel: martian source 192.168.0.255 from 192.168.0.105, on dev eth1
Apr 26 16:58:01 test kernel: ll header: ff:ff:ff:ff:ff:ff:f0:4d:a2:a6:3a:2b:08:00
Jak na moje oko chyba coś z routingiem ale głowy nie dam.
Cierpliwca który dotarł do tego momentu proszę o pomoc albo chociaż jakąś sugestię gdzie szukać rozwiązania.
Pozdrawiam
Mariusz
Witam
Pulą adresów dla sieci vlan będzie zarządzał serwer dhcp. Na razie jest tam przypisany jeden komp na testy. Konfig wrzuciłem wcześniej.
# cat /proc/sys/net/ipv4/ip_forward
1
Być może że skopana jest konfiguracja switcha. W pomocy TPLIK nie chcieli ze mną rozmawiać gdyż ten model nie jest już produkowany i wsparcie go już nie obejmuje.
Konfiguracja switcha1 ... trochę tego będzie... ale może komuś się też przyda:
(http://thumbnails115.imagebam.com/48138/60815c481379656.jpg) (http://www.imagebam.com/image/60815c481379656)
(http://thumbnails115.imagebam.com/48138/0ae4a0481379657.jpg) (http://www.imagebam.com/image/0ae4a0481379657)
(http://thumbnails116.imagebam.com/48138/1c81dc481379660.jpg) (http://www.imagebam.com/image/1c81dc481379660)
(http://thumbnails116.imagebam.com/48138/b021c2481379662.jpg) (http://www.imagebam.com/image/b021c2481379662)
(http://thumbnails115.imagebam.com/48138/27714a481379665.jpg) (http://www.imagebam.com/image/27714a481379665)
Możesz mieć rację że z trunkowaniem mogę mieć coś skopane...
Pozdrawiam
Mariusz
(http://www.imagebam.com/image/6c5d37481379666)
Witam
Po krótkiej przerwie wracam do tematu. W momencie gdy podłączam kompa do portu należącego do vlan20 tcpdump pokazuje to:
# tcpdump -i eth1 -e
tcpdump: WARNING: eth1: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
11:42:16.123826 00:1d:09:d1:8f:ba (oui Unknown) > Broadcast, ethertype IPv4 (0x0800), length 342: 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:1d:09:d1:8f:ba (oui Unknown), length 300
11:42:20.123413 00:1d:09:d1:8f:ba (oui Unknown) > Broadcast, ethertype IPv4 (0x0800), length 342: 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:1d:09:d1:8f:ba (oui Unknown), length 300
11:42:29.123487 00:1d:09:d1:8f:ba (oui Unknown) > Broadcast, ethertype IPv4 (0x0800), length 342: 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:1d:09:d1:8f:ba (oui Unknown), length 300
11:42:45.123599 00:1d:09:d1:8f:ba (oui Unknown) > Broadcast, ethertype IPv4 (0x0800), length 342: 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:1d:09:d1:8f:ba (oui Unknown), length 300
11:43:16.125125 00:1d:09:d1:8f:ba (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: Request who-has 169.254.1.142 tell 169.254.1.142, length 46
11:43:16.214704 00:1d:09:d1:8f:ba (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: Request who-has 169.254.1.142 tell 169.254.1.142, length 46
11:43:17.214740 00:1d:09:d1:8f:ba (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: Request who-has 169.254.1.142 tell 169.254.1.142, length 46
11:43:18.227933 00:1d:09:d1:8f:ba (oui Unknown) > 01:00:5e:00:00:16 (oui Unknown), ethertype IPv4 (0x0800), length 60: 169.254.1.142 > igmp.mcast.net: igmp v3 report, 1 group record(s)
11:43:18.231099 00:1d:09:d1:8f:ba (oui Unknown) > 01:00:5e:7f:ff:fa (oui Unknown), ethertype IPv4 (0x0800), length 175: 169.254.1.142.atc-lm > 239.255.255.250.ssdp: UDP, length 133
11:43:18.291167 00:1d:09:d1:8f:ba (oui Unknown) > Broadcast, ethertype IPv4 (0x0800), length 110: 169.254.1.142.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST
11:43:19.040786 00:1d:09:d1:8f:ba (oui Unknown) > Broadcast, ethertype IPv4 (0x0800), length 110: 169.254.1.142.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST
11:43:19.214736 00:1d:09:d1:8f:ba (oui Unknown) > 01:00:5e:00:00:16 (oui Unknown), ethertype IPv4 (0x0800), length 60: 169.254.1.142 > igmp.mcast.net: igmp v3 report, 1 group record(s)
11:43:19.790879 00:1d:09:d1:8f:ba (oui Unknown) > Broadcast, ethertype IPv4 (0x0800), length 110: 169.254.1.142.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST
Jak widzę "ethertype IPv4 (0x0800)" to na moje niewprawne oko nie wygląda to na tagowanie.
Czy obsługa vlanów zależy od wsparcia sprzętowego (karty sieciowej)? Ja mam RTL-8100/8101L/8139 ... Pytam się bo pierwszą konfigurację vlanów próbowałem skonfigurować na bazie plików ifcfg.
Potem drugą konfigurację zrobiłem za pomocą komendy ip. Efekt w sumie ten sam ale... zastanawia mnie komunikat centosa . Według instrukcji redhata powinienem otrzymać taki komunikat:
$ip -d link show vlan20
...
vlan protocol 802.1Q id 20 <REORDER_HDR>
... a u mnie jest tak:
$ip -d link show vlan20
....
vlan id 20 <REORDER_HDR>
Czy przypadkiem tak nie jest, że jest vlan ale bez wsparcia protokołu 802.1Q?
Pozdrawiam
Mariusz