Thursday, March 24, 2011

To get a Static IP Address from a DHCP Server (On Linux)

Thanks to Ivan.


Edit /etc/network/interfaces

Change settings to:

# The loopback network interface
auto lo
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
script grep
map eth0

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.35
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.1.255
gateway 192.168.1.254

Log4J Configuration

After a lot of headaches and retries, the log4j.properties config file that worked for me is this: http://www.benmccann.com/dev-blog/sample-log4j-properties-file/ . Simply placing this under src/main/resources works. I am using standard maven settings.