Search This Blog

Monday, June 16, 2014

Ubuntu - setup port forwarding

To enable port forwarding on Ubuntu:

nano /etc/sysctl.conf


Restart the system and check whether ip forwarding is enabled:
cat /proc/sys/net/ipv4/ip_forward   - NETWORK you're forwarding the traffic TO - NETWORK you're forwarding the traffic FROM
IP - just your ip address in network taken from eth0 interface

IP="$(ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}')"
iptables -t nat -A POSTROUTING -s -d -j SNAT --to-source $IP
iptables -t nat -A POSTROUTING -s -d -j SNAT --to-source

#forward :5556 ( network) -> :22 ( network)
iptables -t nat -A PREROUTING -p tcp --dport 5556 -j DNAT --to
iptables -A FORWARD -p tcp -d --dport 5556 -j ACCEPT

Thursday, June 12, 2014

Android - change MAC address of eth0

Requirements: root & busybox

To change:
ifconfig eth0 hw ether 00:11:b2:13:14:55

To check your current MAC address:
iplink show eth0

Thursday, June 5, 2014

Ubuntu 14.04 x64 - install NTP service

sudo apt-get install openntpd

sudo nano /etc/openntpd/ntpd.conf

add lines:
listen on *

sudo service openntpd restart