0

I'm looking after to use a setup with that objectives in mind:

  1. Create a subinterface on interface GigabitEthernet0/0/1
  2. create a Vlan and assign it to that subinterface
  3. create a vrrf and assign it to that subinterface
  4. 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:

https://www.mustbegeek.com/configure-vrf-in-cisco-ios-router/

https://www.cisco.com/c/en/us/support/docs/multiprotocol-label-switching-mpls/mpls/24508-internet-access-mpls-vpn.html

https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucme/vrf/design/guide/vrfDesignGuide.html#wp998688

https://learningnetwork.cisco.com/s/question/0D53i00000Kt2zbCAB/how-to-configure-vlans-on-cisco-router

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr_dhcp/configuration/xe-16/dhcp-xe-16-book/config-dhcp-server-xe.html#GUID-0C4F21C0-650F-4652-A621-9FB49202767C

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 8.26.56.26
   dns-server 198.153.192.1
   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.

1.Seems up:

#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.

1 Answer 1

3

EDITED:

Here are a few things to check:

Can your PC really send tagged frames (most PCs can't)?

  1. Your VRF is named VRF200, but your config shows VLAN200
  2. Be sure you enter

vrf forwarding VRF200

before you enter the ip address

ip address 192.168.20.1 255.255.255.0
1
  • That was the solution. thank you ofr the hint :D Dec 11, 2020 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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