I am trying to get low level socket programming in elixir
{:ok, socket} = :socket.open(:inet, :raw, :icmp)
:socket.bind(socket, %{:family => :inet, :port => 0})
:socket.ioctl(socket, :gifconf)
Gives me
{:ok, [%{addr: %{addr: {127, 0, 0, 1}, family: :inet, port: 0}, name: 'lo'}]}
But ip link gives me
#ip link
#1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
# link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
#2: veth0a@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default #qlen 1000
# link/ether 5e:c8:38:a3:e6:50 brd ff:ff:ff:ff:ff:ff link-netns netns_br0
How do you get these two interfaces?
For testing, you can create execute this script, A bunch of helper functions to create Linux bridges, network namespaces, and interconnect everything using veth pairs. · GitHub


















