# Problem with ipv4+ipv6 and multiple ssid hostapd(workaround)

## Tender

Hello,

hostapd.conf

```

interface=wlp0s29f7u6

...

ssid=pizzapazzapizza

wpa_passphrase=............

wpa=2

...

bss=wlp0s29f7u6_0

ssid=pazzapizzapazza

wpa_passphrase=........

wpa=2

...

```

/etc/conf.d/net

```

...

config_wlp0s29f7u6="192.168.8.254/24 2001:1418:12b:3::1/64"

config_wlp0s29f7u6_0="192.168.7.254/24 2001:1418:12b:2::1/64"

...

```

I get

```

#ip addr

...

10: wlp0s29f7u6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

    link/ether b0:48:7a:94:de:86 brd ff:ff:ff:ff:ff:ff

    inet 192.168.8.254/24 brd 192.168.8.255 scope global wlp0s29f7u6

       valid_lft forever preferred_lft forever

    inet6 fe80::b248:7aff:fe94:de86/64 scope link 

       valid_lft forever preferred_lft forever

12: wlp0s29f7u6_0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

    link/ether b0:48:7a:94:de:87 brd ff:ff:ff:ff:ff:ff

    inet 192.168.7.254/24 brd 192.168.7.255 scope global wlp0s29f7u6_0

       valid_lft forever preferred_lft forever

    inet6 2001:1418:12b:2::1/64 scope global 

       valid_lft forever preferred_lft forever

    inet6 fe80::b248:7aff:fe94:de87/64 scope link 

       valid_lft forever preferred_lft forever

...
```

Why ip 2001:1418:12b:3::1 is not set in wlp0s29f7u6 ?

Thanks

Bug reported, https://bugs.gentoo.org/show_bug.cgi?id=562602Last edited by Tender on Sat Jan 23, 2016 4:39 pm; edited 3 times in total

----------

## Tender

Patched moving the ipv6 stuff from config_ to postup()

/etc/init.d/net

```

...

config_wlp0s29f7u6="192.168.8.254/24"

config_wlp0s29f7u6_0="192.168.7.254/24"

...

postup() {

        if [ "${IFACE}" == "wlp0s29f7u6_0" ]

        then

            /bin/ip addr add 2001:1418:12b:2::1/64 dev ${IFACE}

            /bin/ip addr add 2001:1418:12b:3::1/64 dev wlp0s29f7u6

        fi

        return 0

}

...
```

----------

## Tender

Better handling ipv4 and ipv6 by bridging the interfaces, edit /etc/conf.d/net removing postup stuff showed in the previous post and adding bridging:

```

...

modules_wlp0s29f7u6="!iwconfig !wpa_supplicant"

config_wlp0s29f7u6="null"

routes_wlp0s29f7u6=""

modules_wlp0s29f7u6_0="!iwconfig !wpa_supplicant"

config_wlp0s29f7u6_0="null"

routes_wlp0s29f7u6_0=""

bridge_br0="wlp0s29f7u6"

brctl_br0="setfd 0

sethello 10

stp off"

depend_br0() {

    need net.wlp0s29f7u6

}

config_br0="192.168.8.254/24 2001:1418:12b:2::1/64"

routes_br0=""

bridge_br1="wlp0s29f7u6_0"

brctl_br1="setfd 0

sethello 10

stp off"

depend_br1() {

    need net.wlp0s29f7u6_0

}

config_br1="192.168.9.254/24 2001:1418:12b:3::1/64"

routes_br1=""

...

```

add also the bridge handling, in /etc/init.d/hostapd:

```

...

start_post() {

    /etc/init.d/net.br0 start

    /etc/init.d/net.br1 start

}

stop_pre() {

    /etc/init.d/net.br0 stop

    /etc/init.d/net.br1 stop

}

...

```

----------

