WANem to route between machines?

2

I have installed WANem 3.0 Beta 2 on a physical machine with 2 interfaces, and I have 2 Linux boxes connected to it. Like so:

Linux1:100.100.100.2 <--> 100.100.100.1:WANem:200.200.200.1 <--> 200.200.200.2 Linux2

I have set each Linux box to use the WANem interface they are connected to as their gateway. Each Linux box can ping the addresses of both WANem interfaces (ie, Linux1 can ping both 100.100.100.1 and 200.200.200.1). However neither of them can ping each other. From reading tutorials, it seems that it should work by default, but it is not working. Does anyone know how to set up WANem to do this kind of routing? I'm not familiar with the WANem shell.

Thanks!

EDIT: It seems that in this configuration you need to manually add IP forwarding - in the WANem shell I typed:

echo 1 > /proc/sys/net/ipv4/ip_forward

and I was able to ping both endpoints from each other. This is just a temporary change, so if you reboot it will revert to not forwarding. I haven't tried it yet but apparently this is controlled by the file /etc/network/options, so you can edit this and change ip_forward=no to ip_forward=yes and the change should be permanent.

user2792137

Posted 2015-06-12T18:23:58.167

Reputation: 21

Answers

0

A bit late to the show here, but as there have been no new releases of WANem since this was posted, it's relevant.

There was actually a Debian Squeeze bug that was present in the version of knoppix that WANem 3.0 was based on that complicates this a bit.

The solution is to add the setting net.ipv4.ip_forward = 1 to /etc/sysctl.conf (because in Debian Squeeze, the /etc/network/options was deprecated).

This is only part of the solution though, due to the bug. Debian Squeeze executed /etc/init.d/procps (which applies the settings in sysctl configuration) before the modules for networking were loaded, thus they were ignored by the modules. To work around this, you need to restart the /etc/init.d/procps service in /etc/rc.local. Full credit for this workaround goes to this post by Vladislav Kononenko

The linked issue was based on a system that had an empty rc.local file, so use this example instead, as WANem has necessary logic in rc.local for it's startup.

rc.local

#!/bin/bash
#
# rc.local
#
# Load kernel variables from /etc/sysctl.d and /etc/sysctl.conf
/etc/init.d/procps restart

# Start local services after hardware detection
SERVICES="apache2 ajaxterm"

for i in $SERVICES; do
  [ -x /etc/init.d/"$i" ] && /etc/init.d/"$i" start >/dev/null 2>&1
done

exit 0

That will fix and enable ip_forwarding for you and will persist across reboots (if you've installed WANem to the harddrive of the VM with 0wn

Routhinator

Posted 2015-06-12T18:23:58.167

Reputation: 51