Hi,
I am using two wireless routers to which I can connect from my desktop PC. The first router serves as an internet gateway whereas the second one is used to connect a single PC with static IP 192.168.2.3. The two routers also possess static IPs, namely 192.168.2.1 for the internet gateway and 192.168.2.2, respectively. I am currently using the following script to connect to either routers:
So I am connecting to the internet router via WPA-Supplicant and to my simple network via WEP. The script is used to switch between both networks in this context.
As this solution is somehow cumbersome I am searching for an alternative way to connect both routers with my desktop PC.
So it would be nice, if there's a possibility to integrate both networks (with ideally little effort) so that I can set up a internet connection using destination 192.168.2.1 and reach the second PC by calling address 192.168.2.3 at the same time. How could this requirement be realised? (links?)
Maybe there's a possibility to create two interfaces wlan0 and wlan1 by extending wlans_ath0 in /etc/rc.conf, so that interface wlan0 need not to destroyed before each connection.
And one second question: After having connected to my WEP-network, two IP-addresses are assigned to interface wlan0 (see the following output of ifconfig). I would expect only IP 192.168.2.112 which is assigned by the above listed script.
Output of ifconfig after connection to 192.168.2.2:
And that's the output of ifconfig after a connection to 192.168.2.1 has been established:
I am using two wireless routers to which I can connect from my desktop PC. The first router serves as an internet gateway whereas the second one is used to connect a single PC with static IP 192.168.2.3. The two routers also possess static IPs, namely 192.168.2.1 for the internet gateway and 192.168.2.2, respectively. I am currently using the following script to connect to either routers:
Code:
ifconfig wlan0 destroy
ifconfig wlan0 create wlandev ath0 up
if [ "$1" = "WLAN2" ]; then
ifconfig wlan0 inet 192.168.2.112 netmask 255.255.255.0 ssid WLAN2 authmode shared wepmode on weptxkey 1 wepkey 1:0x.... up
else
wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &
fi
So I am connecting to the internet router via WPA-Supplicant and to my simple network via WEP. The script is used to switch between both networks in this context.
As this solution is somehow cumbersome I am searching for an alternative way to connect both routers with my desktop PC.
So it would be nice, if there's a possibility to integrate both networks (with ideally little effort) so that I can set up a internet connection using destination 192.168.2.1 and reach the second PC by calling address 192.168.2.3 at the same time. How could this requirement be realised? (links?)
Maybe there's a possibility to create two interfaces wlan0 and wlan1 by extending wlans_ath0 in /etc/rc.conf, so that interface wlan0 need not to destroyed before each connection.
Code:
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
And one second question: After having connected to my WEP-network, two IP-addresses are assigned to interface wlan0 (see the following output of ifconfig). I would expect only IP 192.168.2.112 which is assigned by the above listed script.
Output of ifconfig after connection to 192.168.2.2:
Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 00:1b:9e:4e:31:a9
inet6 fe90::31b:9fff:fe4e:24ab%wlan0 prefixlen 64 scopeid 0xa
inet 192.168.2.112 netmask 0xffffff00 broadcast 192.168.2.255
inet 192.168.2.101 netmask 0xffffff00 broadcast 192.168.2.255
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet OFDM/48Mbps mode 11g
status: associated
ssid WLAN2 channel 8 (2447 MHz 11g) bssid 00:13:bc:68:1d:c4
regdomain 101 indoor ecm authmode SHARED privacy ON deftxkey 1
wepkey 1:104-bit txpower 20 bmiss 7 scanvalid 60 bgscan
bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS
wme burst
And that's the output of ifconfig after a connection to 192.168.2.1 has been established:
Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 00:2b:9e:5e:a1:c9
inet6 fe80::22b:9aff:ff4e:41c9%wlan0 prefixlen 64 tentative scopeid 0xa
inet 192.168.2.100 netmask 0xffffff00 broadcast 192.168.2.255
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet OFDM/12Mbps mode 11g
status: associated
ssid WLAN channel 8 (2447 MHz 11g) bssid 00:12:cf:9e:af:04
regdomain 101 indoor ecm authmode WPA2/802.11i privacy ON
deftxkey UNDEF AES-CCM 3:128-bit AES-CCM 4:128-bit txpower 20 bmiss 7
scanvalid 450 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7
roam:rate 5 protmode CTS wme burst roaming MANUAL