I bumped into InsecureMag (https://www.helpnetsecurity.com/insecuremag-archive/) - the free magazine on security. As I'm interested in it I decided to check it out. It's totally free. But being lazy I wanted to have all the issues on my harddisk. As usual bash comes with help:
#!/bin/bash
for i in {1..49}; do
link="https://www.helpnetsecurity.com/dl/insecure/INSECURE-Mag-$i.pdf"
wget -c "$link"
done
Have a nice reading :)
Sunday, February 21, 2016
Raspberry Pi - Setting Static IP address
For Christmas I bought for myself :) Raspberry Pi and installed Raspbian and OpenELEC on this. For now I usually use it as low-energy uploader/downloader or photo batch processor.
I want to have remote access to it also from outside my home network. By default Raspbian uses DHCP to obtain IP address from my home DHCP server. As I need to forward ports from my ISP router to my Raspberry PI, I need to give it always static IP address. I've been messing around with it a bit until I figured it out. Here is the recipe:
1. Turn off dhcp client which will always override things
$ sudo update-rc.d dhcpcd disable
You can also do it old school way by removing execute right:
$ sudo chmod a-x /etc/init.d/dhcpcd
2. Add the following lines to /etc/network/interfaces (the bold ones are new)
auto lo
auto eth0
iface lo inet loopback
#iface eth0 inet manuala
iface eth0 inet static
address 192.168.1.100
gateway 192.168.1.254
netmask 255.255.255.0
3. We need /etc/resolv.conf with static dns entry. This file is always rewritten by resolvconf utility, so we need to change it. In /etc/resolvconf.conf we add one line:
name_servers=192.168.1.254
My nameserver is my gateway at the same time.
4. Restart networking services by:
$ sudo /etc/init.d/networking restart
Works for me. We can check if everything is ok running:
$ /sbin/ifconfig
I want to have remote access to it also from outside my home network. By default Raspbian uses DHCP to obtain IP address from my home DHCP server. As I need to forward ports from my ISP router to my Raspberry PI, I need to give it always static IP address. I've been messing around with it a bit until I figured it out. Here is the recipe:
1. Turn off dhcp client which will always override things
$ sudo update-rc.d dhcpcd disable
You can also do it old school way by removing execute right:
$ sudo chmod a-x /etc/init.d/dhcpcd
2. Add the following lines to /etc/network/interfaces (the bold ones are new)
auto lo
auto eth0
iface lo inet loopback
#iface eth0 inet manuala
iface eth0 inet static
address 192.168.1.100
gateway 192.168.1.254
netmask 255.255.255.0
3. We need /etc/resolv.conf with static dns entry. This file is always rewritten by resolvconf utility, so we need to change it. In /etc/resolvconf.conf we add one line:
name_servers=192.168.1.254
My nameserver is my gateway at the same time.
4. Restart networking services by:
$ sudo /etc/init.d/networking restart
Works for me. We can check if everything is ok running:
$ /sbin/ifconfig
Etykiety:
configuration,
dhcp,
network,
networking,
raspberry pi,
raspbian,
static ip
Subscribe to:
Posts (Atom)