Hello fellow members . I'm new to this forum, and need your guidance.
I'm fairly new to setup of up a VLANs and trying to learn and setup different VLANs, so I can configure them on Esx and XenServer lab hosts.
Here is my network setup.
Got 2 routers
- NetGear R7000 (Primary Router) - running ASUSWRT-MERLIN
- Linksys WRT54G (Bridge mode) - running DD WRT - acting as a switch
I have R7000 (RouterA) upstairs connected to cable modem, serving clients mainly via Wifi and computers connected via Ethernet. Second WRT54 (RouterB) resides in basement wifi disabled connected to my ESX host.
Two routers are connected: LAN port from Router A connected to LAN port 1 on Router B (bridged connection)
Port 1 connected to Router A
Port 2 VLAN : 10.1.2.x
Port 3/4 - default
If I plug devices into port 3&4 on router B, they get the IP address on Router A and can access the internet. However the devices connected to VLAN2, cannot communicate to internet or with devices connected on primary router.
I understand I need to do some nating on Router A, to allow devices on Router B (VLAN2) to connect on the internet. Based on my research I came up with below to be added to nat-start script.
#ifconfig eth0:0 192.168.2.10 netmask 255.255.255.0 up
#iptables -t nat -A PREROUTING -i eth0 -d 192.168.2.10 -j DNAT --to-destination 10.1.2.0
#iptables -t nat -I POSTROUTING -s 10.1.2.0 -j SNAT --to 192.168.2.10
Q1: Is above code correct ?
Q2: What is required for devices on router B (VLAN 2) to be able to talk to devices connected on Router A and vice versa?
Kindly let me know if you need more info.
Thanks
CT