I'm looking after to use a setup with that objectives in mind:
- Create a subinterface on interface GigabitEthernet0/0/1
- create a Vlan and assign it to that subinterface
- create a vrrf and assign it to that subinterface
- declare a dhcp server and attach it to that subinterface. 4)route to wan from vlan.
The idea is to have a layer 2 and 3 separate isolated virtual networks.
The sites a was reading where:
The Code I produced is:
enable configure terminal ip cef ip dhcp database disk0:router-dhcp timeout 60 ip dhcp database disk0:router-dhcp write-delay 60 ip dhcp bootp ignore end enable configure terminal ip vrf VRF200 RD 68686:200 route-target export 68686:200 route-target import 68686:200 ip route vrf VRF200 0.0.0.0 0.0.0.0 192.168.20.1 ip dhcp excluded-address 192.168.20.1 192.168.20.110 ip dhcp excluded-address 192.168.20.210 192.168.20.255 ip dhcp pool VLAN200 network 192.168.20.0 255.255.255.0 default-router 192.168.20.1 class VLAN200 dns-server 220.127.116.11 dns-server 18.104.22.168 domain-name localdomain lease infinite vrf VRF200 excluded-address 192.168.20.1 192.168.20.110 excluded-address 192.168.20.210 192.168.20.255 end interface GigabitEthernet0/0/1.200 description VLAN200 encapsulation dot1q 200 ip address 192.168.20.1 255.255.255.0 no shutdown vrf forwarding VLAN200 duplex auto speed auto exit
Is just a prove of concept, I'm not experienced on cisco, and evidently this code is not working. I attach a interface to GigabitEthernet0/0/1 from my PC tagged with vlan200 and no ping into GigabitEthernet0/0/1.200 and no dhcp.
Any guide will be very welcome.
Yes, this card can send tagged frames. Used it a lot before. I have a router mikrotik and I can use the vlan200 without problems if I plug the wire into it.
#show interface GI0/0/1.200 GigabitEthernet0/0/1.200 is up, line protocol is up Hardware is ISR4331-3x1GE, address is 00a3.d1ab.d5dc (bia 00a3.d1ab.d5dc) Description: VLAN200 Internet address is 192.168.20.1/24 MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation 802.1Q Virtual LAN, Vlan ID 200. ARP type: ARPA, ARP Timeout 04:00:00 Keepalive not supported Last clearing of "show interface" counters never
I didn't setup a Spaning Tree so last commands do not aply.
After a few tests I was doing again step by step the config and testing. The vlan seems ok, and after setup ip by hand I can ping...
#ping 192.168.20.111 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.20.111, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Them I setup the DHCP server and seems ok too:
#Show ip dhcp binding Bindings from all pools not associated with VRF: IP address Client-ID/ Lease expiration Type State Interface Hardware address/ User name 192.168.20.111 0118.31bf.d040.62 Infinite Automatic Active GigabitEthernet0/0/1.200
So the problem of my setup has to be related to VRF.
Thank you for your help.