0

I did configure a static IP for my home wifi connection, but now I wanna add another static IP for using it in another network but I don't know how to do it.

Right now I have the following configuration for my home:

/etc/network/interfaces

iface wlan0 inet static
     address 192.168.100.100
     netmask 255.255.255.0
     network 192.168.100.0
     broadcast 192.168.100.255
     gateway 192.168.100.1

But I want to add for my outside network as this:

iface wlan0 inet static
     address 10.20.15.51
     netmask 255.255.255.0
     network 10.20.15.0
     broadcast 10.20.15.255
     gateway 10.20.15.1

Any suggestion? I am running Raspbian over NOOBS, on a Rasbperry Pi 3

Joshua Salazar
  • 131
  • 1
  • 6
  • Do you want to have the same interface wlan0 two ip addresses or do you want two interfaces wlan0 and wlan1, each with its ip address? – Ingo Apr 10 '18 at 14:53
  • In whatever way such that my rasp can have a static IP with my home wifi and another with my lab wifi – Joshua Salazar Apr 10 '18 at 18:51
  • What OS? Is there any reason you ignored the warning "# Please note that this file is written to be used with dhcpcd

    For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'"? And lastly WHY static - DHCP should work automatically?

    – Milliways Apr 10 '18 at 23:18

1 Answers1

1

I don't think this is what you want to do... you've only got one wifi adapter, so both IP addresses will have the same MAC address. That's allowable, but without some routing/networking configuration, it may not accomplish your objective - whatever that is.

Seamus
  • 21,900
  • 3
  • 33
  • 70
  • Explain it then, please. I only want to have a different static IP, depending on the different wifi – Joshua Salazar Apr 10 '18 at 18:57
  • I'm just saying that I don't think you can have them simultaneously, and it seems the config data you've presented would try to do that. I think you need some way to determine which (single) configuration to use. – Seamus Apr 10 '18 at 19:08