I created a web server in my ec2 instance, with this script
in the user data
#!/bin/bash
sudo su
yum install -y httpd.x86_64
systemctl start httpd.service
systemctl enable httpd.service
echo "Hello world from $(hostname -f)"> /var/www/html/index.html
The problem is if I open the public IP in the browser, it won't work it shows "This site can’t be reached"
even if I made all traffic allowed still it won't work, what seems to be the problem ?!
I tried more than 10 instances and still the same issues
enter image description here
My purpose is to download nagios for business purpose. I started a Linux machine(Centos 7) but could not install packages. Then I concluded that it is because of a network problem
I tried the following troubleshooting steps
ping ip-addr
ping google.com
It shows Network unreachable
but ping 127.0.0.1 works
What may be the problem
I think you have not setup your network card with a proper outgoing connection.
Try following this tutorial Centos Network Setup to get you going ...
Yes I tried to follow the steps mentioned in the manual. But after edit connection when
I give the followimng command service network restart. It shows the following error
Job for network.service failed as the control process failed with the error code
systemctl restart network shows the same too
I'm trying to enable serial-getty#ttyS0.service to output getty to serial console as well as tty0.
I have tried running systemctl enable serial-getty#ttyS0 but I suspect that systemd might not be running when late_command is running.
Then I tried making the symlink manually with ln -s /lib/systemd/system/serial-getty#.service /etc/systemd/system/getty.target.wants/serial-getty#ttyS0.service and after the install getty.target.wants only contains getty#tty1.service.
I can't use console=tty0 console=ttyS0,115200n8 kernel parameter because then messages from the init system and the system logger will only appear on the first serial port and I want them to appear on tty0.
Does anyone have any experience or any idea on how to enable services in preseed config?
Thanks.
I have got 2 Raspberry Pis, running Raspbian, up-to-date. Each Pi has exactly one Bluetooth USB dongle. I can make them communicate via RFCOMM using this.
Now, I would like to establish a proper IP layer over the Bluetooth physical link. As far as I understand, I have to use PAN (Personal Area Network), that should create a network interface I could manage with ifconfig. I am trying to adapt this tutorial, but I am stuck at an invalid exchange error.
On RPi0, I run
$ sudo pand --nodetach --listen --master --role=NAP
pand[2313]: Bluetooth PAN daemon version 4.99
On RPi1, I run
$ pand --nodetach --connect 00:1A:7D:DA:71:16
pand[2323]: Bluetooth PAN daemon version 4.99
pand[2323]: Connecting to 00:1A:7D:DA:71:16
pand[2323]: Connect to 00:1A:7D:DA:71:16 failed. Invalid exchange(52)
I cannot find any relevant information about this error code. Any idea how I could solve this ? Or am I mistaken and should I use something else instead of PAN ?
Thanks in advance !
EDIT:
When specifying the Bluetooth device I want to listen on, I get another error message. It doesn't really make sense either, since I do not run any other Bluetooth server.
$ sudo pand -i 00:1A:7D:DA:71:16 --nodetach --listen --role=NAP
pand[2582]: Bluetooth PAN daemon version 4.99
pand[2582]: Bind failed. Address already in use(98)
So things seem to have changed quite a lot recently and the Pi comes with Bluez 5.23 in 2016.
Having just spent two days, these steps have solved it for my pi but might help for any Debian Jessie install. I hope so. Tested on a new pi, running jessie with fresh install just now. This will give a bluetooth pan bridged to your eth0 network (and thus use your existing dhcp/dns server etc). This is my first post, so please forgive stupidity around the various conventions here. I hope this helps someone and saves you a little time.
This is prbably not an optimal solution (I'm no guru), and I'd love to hear about some improvements.
Install some things (python stuff will help with scritps):
sudo apt-get install bridge-utils bluez python-dbus python-gobject
Download two very cool python scripts, put them in /usr/local/bin and chmod both perhaps to 755 depending on who needs access to execute...
blueagent5
and bt-pan. Many thanks and homage to their respective authors. Gosh this kind of thing saves so much time and misery.
Now, we need a bridge. Add the following to the end of /etc/network/interfaces
auto pan0
iface pan0 inet dhcp
bridge_stp off
bridge_ports eth0
I rebooted at about this time to make sure all was as it would be normally.
sudo reboot
Log back in and we issue
modprobe bnep
hciconfig hci0 lm master,accept
ip link set pan0 up
If you don't want pin prompt, don't do this next step. To ensure we get a PIN prompt, issue this...
hciconfig hci0 sspmode 0
Start PAN using the special magic in the bt-pan script. It doesn't return, so add an ampersand at the end.
bt-pan server pan0 &
Start the bluetooth security agent with wonderful ease and confidence. Optionally set a pin (it defaults to 0000).
blueagent5 --pin 4321 &
Okay, one last thing. Forward the network. This will only work if there is no fancy authentication at the router/dhcp, if there is, you may need to look further to solve this issue.
sysctl -w net.ipv4.ip_forward=1
iptables -A INPUT -i pan0 -j ACCEPT
iptables -A FORWARD -i pan0 -j ACCEPT
Once done, you may need to save these iptables settings and reinstate them each time the system boots.
Tiptoe over to your tablet or whatever you are trying to connect to the internet. Open Bluetooth in your settings. Pair with 4321 as your pin, and connect to the local network.
But you didn't need to tiptoe after all, it all seems quite robust to me. Enjoy!
After a lot of struggle, this is how I got it working. Let's hope it can help someone else. Long story short, edit /etc/bluetooth/main.conf to include this line:
DisablePlugins = network
Restart the bluetooth service.
sudo service bluetooth restart
FYI, here is my command for the "server" :
sudo pand -i 00:1A:7D:DA:71:14 --listen --master --role=NAP
And for the "client":
sudo pand --nodetach --connect 00:1A:7D:DA:71:14
Then you can just use ifconfig, ping, ssh... usual stuff. You might want to take a look here, it was useful to me.
A bluez-tools package is available on raspbian with the same functionality as the aforementioned python scripts. original answer
Here's how you can setup a bluetooth pan on Raspbian.
This answer uses systemd/networkd but you could do something similar with an interfaces file and dnsmasq if you wanted.
Run:
sudo apt-get install bluez-tools
Create the following files:
/etc/systemd/network/pan0.netdev
[NetDev]
Name=pan0
Kind=bridge
/etc/systemd/network/pan0.network
[Match]
Name=pan0
[Network]
Address=172.20.1.1/24
DHCPServer=yes
/etc/systemd/system/bt-agent.service
[Unit]
Description=Bluetooth Auth Agent
[Service]
ExecStart=/usr/bin/bt-agent -c NoInputNoOutput
Type=simple
[Install]
WantedBy=multi-user.target
/etc/systemd/system/bt-network.service
[Unit]
Description=Bluetooth NEP PAN
After=pan0.network
[Service]
ExecStart=/usr/bin/bt-network -s nap pan0
Type=simple
[Install]
WantedBy=multi-user.target
Then run
sudo systemctl enable systemd-networkd
sudo systemctl enable bt-agent
sudo systemctl enable bt-network
sudo systemctl start systemd-networkd
sudo systemctl start bt-agent
sudo systemctl start bt-network
Finally to pair, run:
sudo bt-adapter --set Discoverable 1
Then, on the other device pair it and connect the network. Hopefully everything should just work after that.
#cowswithguns
Your solution works almost flawlessly except for
bt-pan server pan &
it should be
bt-pan server pan0 &
Works great with rpi3 and bluez5.X
Only caveat it still uses somehow the wifi. I am trying to ssh to rpi3 via bluetooth while rpi3 is associated with a device that provide its own AP for a one-to-one connection and this cuts off the bluetooth communication. Works only if the rpi3 is associated to a wifi AP.
I was trying to configure a static IP address on my Linux machine (Fedora 19 ). However when I was trying to restart my network.services using systemctl restart network.service, I was unable to do so.
[root#xyz network-scripts]# systemctl restart network.service
Job failed. See system journal and 'systemctl status' for details.
I tried to reboot my system and re execute the command, but still I am getting the same error. Also I am enable to access internet on my system.
Can anyone help me out with this.
To restart network services, you can use this command
service networking restart
You can also use
service networking stop
then
service networking start
restart the nm-applet with this command from terminal:
killall nm-applet; nohup nm-applet &
or restart the the network manager service using:
sudo systemctl restart network-manager
Restore radio frequencies by running the following command;
sudo service NetworkManager restart
If that does not work, run this one;
rfkill unblock wifi