I'm trying to write an IS-IS packet to gretap interface with ISO (0x00fe) protocol type. In this case there is no ethernet header so I'm using raw socket. The gretap always puts 0x6558 as the protocol type in the GRE header, is there a way I can make gretap use a different protocol type (ie 0x00fe) so the receiver is expecting to see IS-IS packet immediately after the GRE header (ie no ethernet header first)?
Follow-up:
I think the protocol type is hard-coded, ie (from ip_gre.c in kernel):
761 static netdev_tx_t gre_tap_xmit(struct sk_buff *skb,
762 struct net_device *dev)
763 {
...
776
777 __gre_xmit(skb, dev, &tunnel->parms.iph, htons(ETH_P_TEB));
778 return NETDEV_TX_OK;
The symbol ETH_P_TEB is the transparent ethernet bridge type (0x6558), so there's no option to set this value. This is unfortunate because if using raw socket we might want to generate a different encapsulation over the GRE. I will try modding the kernel module.
Asked by Barry
(21 rep)
Mar 17, 2023, 05:28 PM
Last activity: Mar 19, 2023, 06:14 AM
Last activity: Mar 19, 2023, 06:14 AM