2009-05-28

Rewriting Windows connection

Windows' routing and firewall tools doesn't seem as powerful as I'm used to on Linux.

So to redirect an outgoing connection headed for 1.2.3.4 I add a custom route on the Windows machine, routing to a Fedora Linux machine 192.168.0.117:
route add 1.2.3.4 mask 255.255.255.255 192.168.0.117
On the linux machine I edit /etc/sysctl.conf
net.ipv4.ip_forward = 0
and run
sysctl -e -p /etc/sysctl.conf
In /etc/sysconfig/iptables I add
*nat
-A PREROUTING -p tcp -m tcp -d 1.2.3.4 -j DNAT --to-destination 192.168.1.7
-A POSTROUTING -p tcp -m tcp -d 192.168.1.7 -j SNAT --to-source 192.168.0.117
COMMIT
and restart iptables.

2009-03-29

Using the SUN java plugin in Firefox under Fedora

For some stupid reason the danish tax self-service doesn't work with openjdk. So I had to install the Sun version. I took the time to do it properly with alternatives:

Install Suns java:
rpm -ihv jre-6u12-linux-i586.rpm
Register it as a high priority alternative for libjavaplugin.so:
alternatives --install /usr/lib/mozilla/plugins /libjavaplugin.so libjavaplugin.so /usr/java/jre1.6.0_12 /plugin/i386/ns7/libjavaplugin_oji.so 20000
And select which alternative to use:
alternatives --config libjavaplugin.so