I need to create a hotspot setup using hostapd for EAP-SIM,EAP-AKA and EAP-AKA' and test it with wpa_supplicant.
Currently I am able to use hostapd for WPA-PSK authentication, hostapd2.4 is used for this setup.I have modified the hostapd.conf for supporting hotspot but when I try to connect , the network will be always in scanning state and won't connect. The necessary parameters for HS20 in wpa_supplicant is also enabled.
The following are the supplicant parameters,
build configuration:
CONFIG_INTERWORKING=y
CONFIG_HS20=y
wpa_supplicant configuration:
Enable Interworking
interworking=1
Enable Hotspot 2.0
hs20=1
auto_interworking=1
Also have specified a credentials block which takes necessary parameters for authentication with hostapd.
Using wpa_supplicantv2.5.I also have a dhcp server running for assigning IP address and also a milenage db running for EAP-SIM,EAP-AKA and EAP-AKA' authentication.
Can anyone suggest what are the necessary basic setup for enabling hotspot in hostapd?
Step 1 :
iw list Check AP is listed
Step 2 :
sudo vim hostapd.conf
-------------------------- interface=wlan0 driver=nl80211 ssid=ath9k_SSID #SSID hw_mode=g channel=1 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=3 wpa_passphrase=12345678
#password wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP CCMP rsn_pairwise=CCMP
#comment last 4 lines for Open
Step 3 :
sudo vim /etc/dhcp/dhcpd.conf
-------------------------- default-lease-time 600; max-lease-time 7200; subnet 192.168.1.0 netmask 255.255.255.0 { range
192.168.1.170 192.168.1.200; option routers 192.168.1.254; option domain-name-servers 192.168.1.1, 192.168.1.2; option domain-name "mydomain.example"; }
Step 4 :
sudo vim /etc/network/interfaces
-------------------------- auto wlan0 iface wlan0 inet static address 192.168.1.250 netmask 255.255.255.0
Step 5 :
sudo /etc/init.d/isc-dhcp-server stop sudo service network-manager stop sudo killall wpa_supplicant ps -N | grep -i hostapd # make sure there are no hostapd/wpa_supplicant processes are running
Step 6 :
Remove ethernet cable sudo ifconfig wlan0 192.168.1.169 netmask
255.255.255.0 sudo /etc/init.d/isc-dhcp-server restart => to set IP for STA sudo ./hostapd ./hostapd.conf -dddt Step 7: Connect from another device. Should be able to see the IP assigned.
Related
Recently we brought raspberry pi 3b.Beginning we used to access the internet using an ethernet cable and it used to connect properly but now raspberry pi is not able to reach the gateway itself and it's taking its default IP address i.e 169.xxx.xxx.xx.
what would be the issue?we tried to reinstalling the operating system again the same issue .it worked for one day after that same problem.so please help me to solve the issue.
Finally, I am able to figure it out after trial and error method. I have missed "auto eth0" before the iface statement i.e
auto eth0
iface eth0 inet static
address xxx.xxx.xxx.xxx
network 255.255.255.0
gateway xxx.xxx.xxx.xxx
dns-nameservers 8.8.8.8
Assuming that you have a windows computer available, open cmd and run the following command:
ipconfig
note down the values that display. Now on your pi, enter the command
sudo nano /etc/network/interfaces
This will open the network interfaces file. Look for the line similar to 'inet eth0 inet manual' Then remove this line and everything to do with the eth0 interface, since we are going to start over.
in the interfaces file, add the following section:
auto eth0
inet eth0 inet static
address xxx.xxx.xxx.xxx
network 255.255.255.0
gateway xxx.xxx.xxx.xxx
dns-nameservers 8.8.8.8
Replace the x in address with the first 3 groups of the value taken from the windows system. For example, if the ip address on the windows system was 192.168.0.221, enter 192.168.0.xxx
The last group of xxx for address should be something unique to everything else on your network.
'gateway' should be whatever the gateway value in windows was (assuming these machines are on the same network)
[Ctrl]+[x], Save changes
reboot via
sudo reboot
once the system has rebooted
ifconfig eth0
should list the new settings. Test them by pinging the below address (google)
sudo ping 8.8.8.8
This is my first time when I am setting up LXD to run multiple containers. I have done all the configuration steps but my container not getting IP address from DHCP server which is running inside my organization. Please help me out.
I am using Bridge interface profile. Below are changes I have made:
root#DMG-LXD-TVM2:~# vi /etc/network/interfaces
auto br0
iface br0 inet dhcp
bridge-ports ens32
bridge-ifaces ens32
iface ens32 inet dhcp
root#DMG-LXD-TVM2:~# lxc list
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
| Continer1 | RUNNING | | | PERSISTENT | 0 |
IP and interface details what i setup on my ubuntu machine
Dhcp message when doing ifdown eth0 && ifup eth0 inside container
This is an older question, but I decided to answer it, since I got stuck on the same topic and the solution isn't exactly obvious.
If you want your container to obtain its ip configuration from an external device (e.g. internet router, company dhcp server), you need to tell it so, at creation time. This is done via a configuration parameter pair user.network_mode=dhcp
Since this configuration is in "user" space, it is not normed, but works on ubuntu 16.04. For details see: https://github.com/lxc/lxd/blob/master/doc/configuration.md
Step 1: create bridge on the host in /etc/network/interfaces
auto br0
iface br0 inet dhcp
bridge_ports ens32
bridge_stp off
bridge_fd 0
Step 2: create you own lxd profile called mydhcp
lxd profile create mydhcp
or reconfigure your default lxd configuration by calling
sudo dpkg-reconfigure -p medium lxd
(You need to choose at the first prompt and add on the second prompt, then enter your bridge's name)
If you use your own profile, edit it
lxc profile edit mydhcp
paste the following
name: mydhcp
config:
user.network_mode: dhcp
description: Profile for creating dhcp containers
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
(Note the spaces - this is a YAML file, the spaces matter!)
Step 3: create a new container using you mydhcp profile
lxc launch ubuntu:16.04 mydhcpcontainer -p mydhcp -c user.network_mode=dhcp
if you changed the default lxd configuration in the previous step, just enter
lxc launch ubuntu:16.04 mydhcpcontainer -c user.network_mode=dhcp
Check your new container's ip address with
lxc exec mydhcpcontainer -- ifconfig
I am developing a kernel feature, using User-Mode-Linux.
I compiled 3.12.38 from source and downloaded a Debian fs.
However, I am not able to seet-up networking using following options here.
Are there any good source or info to go with this.
I have internet on wlan0.
EDIT:
I start with eth0=tuntap,,,192.168.0.254
and then inside UML UML# ifconfig eth0 192.168.0.253 up
I only get the output as:
modprobe tun
ifconfig tap0 192.168.0.252 netmask 255.255.255.255 up
route add -host 192.168.0.253 dev tap0
As mentioned, output is lacking a bit and more over a ping to 192.168.0.254 doesn't seems to work, with 100% packet loss.
Let us follow the steps to establish the following Topology:
VM-tap0(192.168.6.6)-------------(192.168.6.8)eth0-UML1-eth1(192.168.20.1)----------------eth1-(192.168.20.2)UML2
here, UML1 and UML2 are two UML instances running on VM as a host.
All uml_console commands are suppose to run on VM host.
Tun/Tap config:
VM <------>UML1 (ley us first establish the connection between VM host and UML1)
#host as root :
chmod 777 /dev/net/tun
tunctl -u vm -t tap0 (here vm is the VM user name)
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp
ifconfig tap0 192.168.6.6 up
./linux ubda=CentOS6.x-x86-root_fs umid=debian1 [separate terminal]
uml_mconsole debian1 config eth0=tuntap,tap0
route add -host 192.168.6.8 dev tap0
route add -net 192.168.20.0 netmask 255.255.255.0 gw 192.168.6.8 dev tap0
#uml1
eth0=tuntap,tap0
ifconfig eth0 192.168.6.8 up
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
Now UML1<-------------->UML2
./linux ubda=CentOS6.x-x86-root_fs2 umid=debian2 [separate terminal]
uml_mconsole debian1 config eth1=mcast (if these commands fails, it means you have not compile the UML kernel with multicast ineterface enabled in )
uml_mconsole debian2 config eth1=mcast
again #uml1
ifconfig eth1 192.168.20.1 up
#uml2
ifconfig eth1 192.168.20.2 up
route add -net 192.168.6.0 netmask 255.255.255.0 gw 192.168.20.1 dev eth1
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/eth1/proxy_arp
Try ping UML2 from VM and vice versa. You should be able to ping in both directions.
The TunTap documentation on the vtun site points out that the driver is only supported till Linux kernel 2.4. Is there any way to get it to run on 2.6 and 3.2 versions of Linux?
A cat on the device shows:
# cat /dev/net/tun
cat: File descriptor in bad state
I tried installing directly from the rpm file to see how far I could go and got:
# rpm -i tun-1.1-6.rh71.i386.rpm
error: Failed dependencies:
/bin/sh is needed by tun-1.1-6.i386
Is there any way I can get this to work on linux 2.6+ or are there any good alternatives to tuntap that you are aware of?
The tuntap documentation is outdated. Also, in newer versions of linux, you might need to use
tunctl
instead of
ip tuntap add
To install tunctl on debian Squeeze, install the package 'uml-utilities' which provides the tunctl command. You can add a new tunnel using
tunctl -t tun1
Use the below script to create it automatically, just copy the contents in to a file.sh, change the "ETHOIPADDR" to your ip address, similarly also the change the gateway and broadcast address and run the script with sudo permission.
#!/bin/sh
#
# script to bring up the tun device in QEMU in bridged mode
# first parameter is name of tap device (e.g. tap0)
#
# some constants specific to the local host - change to suit your host
#
ETH0IPADDR=192.168.0.3
GATEWAY=192.168.0.1
BROADCAST=192.168.0.255
#
# First take eth0 down, then bring it up with IP address 0.0.0.0
#
/sbin/ifdown eth0
/sbin/ifconfig eth0 0.0.0.0 promisc up
#
# Bring up the tap device (name specified as first argument, by QEMU)
#
/usr/sbin/openvpn --mktun --dev $1 --user `id -un`
/sbin/ifconfig $1 0.0.0.0 promisc up
#
# create the bridge between eth0 and the tap device
#
/usr/sbin/brctl addbr br0
/usr/sbin/brctl addif br0 eth0
/usr/sbin/brctl addif br0 $1
#
# only a single bridge so loops are not possible, turn off spanning tree protocol
#
/usr/sbin/brctl stp br0 off
#
# Bring up the bridge with ETH0IPADDR and add the default route
#
/sbin/ifconfig br0 $ETH0IPADDR netmask 255.255.255.0 broadcast $BROADCAST
/sbin/route add default gw $GATEWAY
#
# stop firewall - comment this out if you don't use Firestarter
#
/sbin/service firestarter stop
I'm creating a simple p2p application. To test this I'd like to be able to simulate a simple network of about 2-3 computers, such that each instance of the application thinks its on a different computer and talking with others over the network. I considered qemu, but haven't managed to get networking working using VDE or TUN/TAP. is their any other solution?
You might have better luck using VMs running on something like Virtual PC (Sun's Virtual Box is another good alternative).
Here are example using vde and qemu. Not require to configure firewall/routing. Much more simple to setup. Do not need root privilege to run qemu. Easy to use. Tested and working.
# brctl addbr br0
# brctl addif br0 eth0
# dhclient br0
# vde_tunctl -u testuser -t tap0
# ifconfig tap0 up
# brctl addif br0 tap0
# brctl setfd br0 0
$ vde_switch -d -s /tmp/vde0 -M /tmp/vde0mgmt
$ vde_plug2tap -d -s /tmp/vde0 tap0
$ vdeqemu -hda testdisk1.qcow2 ... -net nic,macaddr=... -net vde,sock=/tmp/vde0
$ vdeqemu -hda testdisk2.qcow2 ... -net nic,macaddr=... -net vde,sock=/tmp/vde0
You might refer to simple diagram at
http://selamatpagicikgu.wordpress.com/2011/06/08/quickhowto-qemu-networking-using-vde-tuntap-and-bridge/
I recently set up a small network using VirtualBox and VDE on my laptop that cannot reach the internet. VirtualBox 4.0.6 natively integrates with VDE. Setting up VDE should be as simple as starting your switch:
vde_switch -s /tmp/switch1
Then, selecting "VDE Adapter" as your network adapter for each of your VMs and specifying the name of your adapter as the following will connect all of your VMs to the same switch so they can communicate:
/tmp/switch1
Alternatively (and more simply), you could just choose "Internal Network" as your network adapter and specify the same name for the network in each of your VMs to connect them all together in VBox.