-1

I am very new to networking. I have two VLANs, and want to read and transfer shared files between them. I cannot add a new router. I have access to a server which can be accessed by both the VLANs through intranet. How can I do this using the server? Thanks!

1 Answer 1

1

You didn't provide an OS for the server machine, so I'm going to make several assumptions here. You can use iptables for this on Linux servers (i.e. configure the server to act as a router).

First, you need to enable IP routing on the server machine: sysctl -w net.ipv4.conf.all.forwarding=1

Let's assume the vlans are both connected to the server on eth1 and eth0, then you need to configure iptables rules as such:

-A FORWARD -i eth1 -o eth2 -j ACCEPT
-A FORWARD -i eth2 -o eth1 -j ACCEPT

Then on each vlan machine, you need to configure the default gateway to be the server IP, or configure a routing rule as such:

route add -net <SUBNET IP> netmask 255.255.255.0 gw <SERVER IP>

Where <SUBNET> is the ip address range in the other VLAN and <SERVER IP> is the router's IP.

I suggest if this is your first time using custom routing on a Linux server, you should probably find an IPTables tutorial to understand exactly what's going on here. This solution will produce a simple route between the two VLANs, but in order to have WAN access you'll have to use custom routes on the VLAN machines (as opposed to merely changing their default gateway to the server IP). This assumes the VLAN connected machines are all running Linux too.

You must log in to answer this question.

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