Skip to content

Instantly share code, notes, and snippets.

@chibiegg
Created January 26, 2014 14:40
Show Gist options
  • Save chibiegg/8633731 to your computer and use it in GitHub Desktop.
Save chibiegg/8633731 to your computer and use it in GitHub Desktop.
import socket
import struct
sock = socket.socket(socket.AF_INET,socket.SOCK_RAW,89) #OSPF_IGP
data = [ 0x02,0x01,0x00,0x30, 10, 133, 0, 1,0x00,0x00,0x00,0x01,
0xe7,0x12,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0a,0x02,0x01,0x00,0x00,0x00,0x28, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
10, 255, 255, 2,
]
data_str = struct.pack("%dB"%len(data),*data)
sock.sendto(data_str,("172.30.133.13",0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment