05-30-2022 04:31 AM
does GRE have a layer 4 header?
if yes which ports does it use?
05-30-2022 04:41 AM
Hi
GRE does not have Layer 4 header. GRE is a layer 3 protocol. Layer 4 header must be seing in TCP and UDP protocols.
05-30-2022 04:42 AM
No it doesn't as GRE is at the IP layer.
Jon
05-30-2022 04:44 AM
Dont have l4 port it have
Ip protocl number which is 47
05-30-2022 08:13 AM - edited 05-30-2022 08:13 AM
access-list 100 permit gre host x.x.x.x host y.y.y.y <- and I assume since you ask about the L4 port number you want to allow it port, but IOS already have IP protocol keyword you can use it for GRE which is as show above.
05-30-2022 09:01 AM - edited 05-31-2022 06:35 AM
"does GRE have a layer 4 header?"
Hmm, that's an interesting question.
Like ICMP, IGMP, TCP, UDP and many others, GRE is a defined protocol for IP. It like the others IP protocols, depends on IP, the L3 layer, to deliver the GRE packets.
Once a GRE packet is delivered, it's unwrapped to provide another IP packet. I.e. it's a bit more/different stack processing from OSI L3 packet delivery, alone, across a routed network, yet less than some other IP protocols considered full L4 protocols, like TCP or UDP using/having "port numbers" (which GRE does not).
However, if you equate GRE's encapsulated IP addresses to UDP ports numbers (both accomplish similar goals), and/or consider GRE RFC 2890 header fields (key field, sequence field), it's getting somewhat like other IP L4 transport protocols (i.e. end-to-end considerations beyond just what L3 considers).
In my (not so humble [laugh]) opinion, I would classify GRE, in the OSI model, as either 3+ or something like 3.5.
BTW, the Wiki article for the OSI model has, within this section Wiki OSI model L4, this statement "While Generic Routing Encapsulation (GRE) might seem to be a network-layer protocol, if the encapsulation of the payload takes place only at the endpoint, GRE becomes closer to a transport protocol that uses IP headers but contains complete Layer 2 frames or Layer 3 packets to deliver to the endpoint. L2TP carries PPP frames inside transport segments."
Personally, I don't consider Wiki articles to be totally authoritative, but I do find it interesting that GRE has a special mention. (NB: I checked Wiki after noting my thinking, above.)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide