hg612 shared wan/lan cable guide
1 - login to telnet on the hg612 and run the following command, adjust for your own preference, my example is using the 192.168.3.x subnet, this is something that you will have to do on every reboot of the device.
ifconfig br1 192.168.3.1 netmask 255.255.255.0
2 - on your router run the folliowing commands, again adjust as required. This command is for iptables 1.4+
Also the correct ethernet device needs to be chosen. The correct ethernet device depends on the router model and type of internet connection.
On my asus router using sky dhcp the ethernet device on the wan port is eth0, the correct device should be identifiable by having the internet ip assigned to it. check with ifconfig.
ifconfig eth0:1 192.168.3.253 netmask 255.255.255.0
iptables -t nat -I POSTROUTING ! -s $(nvram get lan_ipaddr) -d 192.168.3.0/24 -j SNAT --to 192.168.3.253
At this point the hg612 is not pingable because the firewall is blocking the traffic.
The easy way to fix this is login to the GUI, click on advanced, then firewall, change firewall level to disabled and then click submit. This change will survive reboots.
A more proper way to fix is do this edit the ip filtering on the hg612. But I see no way in the GUI to do this. It seems to be a read only screen.
After disabling the firewall the hg612 should be pingable from the router and pc.
Below is output of my testing, I tested over one of my router's lan ports, so these commands are adjusted.
Basically lan2 from my hg612 is connected to my laptop which itself is not connected to rest of my lan.
Lan1 is connected to my router in one of the lan ports.
Can see here, br0 has my lan ip bound to it.
br0 Link encap:Ethernet HWaddr 08:62:66:96:AF:E0
inet addr:192.168.1.253 Bcast:192.168.1.255 Mask:255.255.255.0
I add a 192.168.3.x ip to the br0 interface as so.
admin@RT-AC68U:/jffs/scripts# ifconfig br0:1 192.168.3.253 netmask 255.255.255.0
Can check as so.
admin@RT-AC68U:/jffs/scripts# ifconfig br0:1
br0:1 Link encap:Ethernet HWaddr 08:62:66:96:AF:E0
inet addr:192.168.3.253 Bcast:192.168.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Here is the iptables command
admin@RT-AC68U:/jffs/scripts# iptables -t nat -I POSTROUTING ! -s $(nvram get lan_ipaddr) -d 192.168.3.0/24 -j SNAT --to 192.168.3.253
admin@RT-AC68U:/jffs/scripts#
ping from router
admin@RT-AC68U:/jffs/scripts# ping 192.168.3.1
PING 192.168.3.1 (192.168.3.1): 56 data bytes
64 bytes from 192.168.3.1: seq=0 ttl=64 time=2.087 ms
64 bytes from 192.168.3.1: seq=1 ttl=64 time=0.445 ms
64 bytes from 192.168.3.1: seq=2 ttl=64 time=0.406 ms
64 bytes from 192.168.3.1: seq=3 ttl=64 time=0.414 ms
64 bytes from 192.168.3.1: seq=4 ttl=64 time=0.416 ms
ping from pc
C:\Windows\system32>ping 192.168.3.1
Pinging 192.168.3.1 with 32 bytes of data:
Reply from 192.168.3.1: bytes=32 time<1ms TTL=63
Reply from 192.168.3.1: bytes=32 time<1ms TTL=63
Reply from 192.168.3.1: bytes=32 time<1ms TTL=63
Reply from 192.168.3.1: bytes=32 time<1ms TTL=63
Ping statistics for 192.168.3.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
I can telnet from the pc no problem.
Hope this helps.