3

I have 2 subnets 192.168.1.0/24 and 192.168.2.0/24 and one suse linux server. The linux has 2 interfaces, eth0 and eth1. I want to configure the suse linux server as a router so that I can make these 2 subnets communicate with each other.

These are my steps:

  1. set the linux eth0 ip as 192.160.1.254,eth1 ip 192.168.2.254

  2. add route in linux:

    route add -net 192.168.1.0 netmask 255.255.255.0 dev eth0 
    route add -net 192.168.2.0 netmask 255.255.255.0 dev eth1
    

  3. set 192.168.1.0/24 gw as 192.168.1.254,and 192.168.2.0/24 gw as 192.168.2.254

I am not sure if this will work or not? Or is there some step I'm missing?

2 Answers 2

4

You need at least one other step:

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

I don't think you need the explicit route commands above. Simply setting up the two interfaces and allowing forwarding should satisfy your routing requirement.

Check the output of your routing table with:

netstat -rn
1
  • 2
    Agreed, there is no need for the extra routing rules.
    – David
    Jun 24, 2011 at 2:11
0

I have not used SuSE in many years but here is a how-to from Novell that should get you up and running if you are using X. http://www.novell.com/coolsolutions/feature/11505.html

If you are not using X, follow this tutorial (although some files may be in different places on SuSE): http://www.ducea.com/2006/08/01/how-to-enable-ip-forwarding-in-linux/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .