Fork me on GitHub
#off-topic
<
2016-02-08
>
borkdude10:02:26

I want to add some ips to lo0 like this: `

borkdude10:02:32

sudo ifconfig lo0 alias $KAFKA1
sudo ifconfig lo0 alias $KAFKA2
sudo ifconfig lo0 alias $KAFKA3

borkdude10:02:48

how can I do this on a Mac in for example .zshrc without getting a password prompt?

stian10:02:33

borkdude: save yourself some trouble and duplicate the network interface under system preferences -> network, then add IPs to the duplicated interfaces. simple_smile .zshrc runs every time you open up a (zsh)-shell, you probably don't want to add IPs every time you open up a terminal.

stian10:02:49

Proper way to run a script at startup on OS X is to use LaunchAgent / LaunchDaemon, but it's a bit of work to set up.

borkdude10:02:52

@stian: do you mean duplicate the wifi interface or what?

stian11:02:37

borkdude: then you should be able to edit the new interface, and assign it an ip.

borkdude11:02:43

ok, when I try this and add the ip 10.0.0.2 for example, the ping 10.0.0.2 I get a timeout

borkdude11:02:56

maybe I need to set the subnet mask also?

stian11:02:12

yeah, try that, 255.255.255.0 or so

borkdude11:02:39

@stian: hmm, one question though. When I add an IP, others in the same wifi network will go to my machine through that IP?

stian11:02:32

@borkdude: They should be able to reach that IP, yeah

stian11:02:01

@borkdude: Ah, sorry, i see above you specified lo0

stian11:02:10

@borkdude: Then this method probably won't work, I don't think you can add or clone a loopback device in the UI.

borkdude11:02:22

ok, thanks anyway simple_smile