On Thu, Dec 29, 2016 at 04:14:52PM -0200, Till Kamppeter wrote:
> On 12/29/2016 02:37 PM, Stéphane Graber wrote:
> > > How can I assign a different name to a dummy interface? Can I freely choose
> > > a name somehow, for example "ippusbxd"? Or have I to use "dummy1", "dummy2",
> > > ... (loading the dummy kernel module with an option to support more than one
> > > interface)?
> > [email protected]:~# ip link add ippusbxd type dummy
> > [email protected]:~# ip link set ippusbxd up
> > [email protected]:~# ifconfig ippusbxd
> > ippusbxd: flags=195<UP,BROADCAST,RUNNING,NOARP> mtu 1500
> > inet6 fe80::3004:2dff:feb6:b5c7 prefixlen 64 scopeid 0x20<link>
> > ether 32:04:2d:b6:b5:c7 txqueuelen 1000 (Ethernet)
> > RX packets 0 bytes 0 (0.0 B)
> > RX errors 0 dropped 0 overruns 0 frame 0
> > TX packets 2 bytes 140 (140.0 B)
> > TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
> > Which gets you your own dummy device with its IPv6 link-local address.
> Thank you very much. I copied and pasted the commands and got an ifconfig
> output similar to yours, only with different IP and MAC addresses and
> different values in the statistics.
> Then I tried to bind to the IPv6 IP address of this entry, on port 60000 and
> this did not work.
> Do I have to create an additional IP address? If yes, how? Do I have to run
> additional commands (route?)? Which ones?
Link-local addresses are slightly special in that they are indeed link local.
So you can't bind fe80::3004:2dff:feb6:b5c7 as you could in theory have
the same address on multiple interfaces. Instead, you need to tell
bind() what interface to bind on. This is typically indicated as
[email protected]:~$ nc -l fe80::3004:2dff:feb6:b5c7 1234
nc: Invalid argument
^ Fails because the kernel doesn't know what interface you want.
[email protected]:~$ nc -l fe80::3004:2dff:feb6:b5c7%ippusbxd 1234