/sbin/ifconfig -a | grep HWaddr
ls -l /sys/class/net
Setting up a static ip requires you to edit the file : /etc/network/interfaces.
Below is what this file looks like after all the appropriate setting are done .
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 10.0.0.41
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.1
dns-nameservers 10.0.0.1 8.8.8.8
dns-domain acme.com
dns-search acme.com
for example if you want a process running on 49161 to be accessible on 1521.
sudo iptables -t nat -A OUTPUT -o lo -p tcp --dport 1521 -j REDIRECT --to-port 49161