Jump to content
XPEnology Community

Use Xpenology as a basic router


Recommended Posts

I found this when looking around. And it seems to work rather well


My situation


Xpenology setup

Trantors 4.3-3810 V1.4beta


3 Lan ports


Eth0 > Internal for NFS PXE booting etc which has an IP 192.168.0.x

Eth1 > Nothing

Eth2 > Connected to my router/internet which has an IP 10.0.0.x


What I wanted was to be able to PXE boot and install Operating systems to systems on the 192.168.0.x port of the Xpenology box


Fuddled my way around and half got ubuntu 12.04 PXE booting and installing....but it wants to get out to the internet and grab the latest packages at installation time.


Which it cannot do.


But searching around I found a guide,,, so will post it here in case others need something similar


ssh into your Xpenology box

change to this directory



inside you will notice a file



what we will do is create another file and call it



to do this type in


touch S01iptables_nat.sh


this will create a blank file


now we need to change the privilages of this file to match all the others

to do that use chmod command and we want 755 as the privilages (read write execute / read execute / read execute)


chmod 755 S01iptables_nat.sh


now we can edit the new file using vi


vi S01iptables_nat.sh


press i (for insert)

and enter the following


# Script to enable port forwarding and IP Masquerading, to share
# the primary internet connection to the second port of DS412+

# Enable port forwarding, in case not enabled by default
echo 1 > /proc/sys/net/ipv4/ip_forward

# Load the required modules
/usr/syno/etc.defaults/rc.d/S01iptables.sh load_nat_mod forwarding_test

# Define the masquerading rule
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE


note the last line

/sbin/iptables -t nat -A POSTROUTING -o eth3 -j MASQUERADE


make sure that is the internet facing network port which in my case happens to be eth3....yours might be eth0 if you have a basic setup.


reboot and test to see if you can reach the internet from and internal device.


live happy. :grin:


info taken from mortral @ the Synology forums



As you can see below..... the traffic passing out and back from eth0 through to eth3 :ugeek:





Link to comment
Share on other sites

If its of any use for you, synology DSM has built-in feature for sharing connection so if you find those configuration scripts, you may see how they do it. This feature is only activated when you have VPN, PPTP,PPoE login to your ISP connection. LAN port can be shared for internal devices to use the same tunnel.

Link to comment
Share on other sites

  • 1 year later...

Hello all,


I was trying this too but it works very well. But i have a problem with speed. I have 1GB WAN Connection but maxim download speed is 220mbps.


I check the CPU when i do the speedtest but is at 30%. Any help? I think PPPoe connection slow this...


Any advice are welcome

Link to comment
Share on other sites

  • Create New...