vishvananda / netlink

Simple netlink library for go.
Apache License 2.0
2.82k stars 737 forks source link

Simulate bridge fdb append #1000

Open kazimsarikaya opened 2 months ago

kazimsarikaya commented 2 months ago

Hello i am writing a program to simulate this commands (ip addresses and ids are arbitrary):

ip link add vxlan0 type vxlan id 42 dev eth1 dstport 0 
bridge fdb append to 00:00:00:00:00:00 dst 192.168.123.12 dev vxlan0
ip a a dev vxlan0 10.47.252.1/22 
ip l set dev vxlan0 up
ip r add 10.32.4.0/22 via 10.47.252.2

The second line

bridge fdb append to 00:00:00:00:00:00 dst 192.168.123.12 dev vxlan0

is completed by

https://gist.github.com/kazimsarikaya/0a1878bcfa2697d041cf003d3c926864

The main append is at line 67. inside if (disabled by false) I am using netlink.NeighAppend method. At else part I am using bridge command.

Else part works as expected. However if part cannot for. If I enable (I dont know it is correct) AF_BRIDGE it gives Operation not supported.