Page 1 of 1

How to assign 2 IP adresses ?

PostPosted: Thu Jan 03, 2019 11:01 pm
by denjolras
Hello
I use the Lacie at Home, with 2 internet providers, so 2 network.

I would like to assign to 2 IP adresses to my NAS.

With a standard linux, I will add a eth0.0
But how to do with the fvdwsl firmware ?

Thanks.

ps:
for now, I've added a line in /etc/init.d/rc.banner :
exec("/sbin/ifconfig eth0:0 192.168.0.133 netmask 255.255.255.0 up", $out, $ret)

is it the best way to do ?

Re: How to assign 2 IP adresses ?

PostPosted: Fri Jan 04, 2019 10:24 am
by Jocko
Hi denjolras,

denjolras wrote:exec("/sbin/ifconfig eth0:0 192.168.0.133 netmask 255.255.255.0 up", $out, $ret)
No iit is not enough
And I advice not to edit these files in /etc/init.d but use the cron boot feature with a custom script !

As you have two ethernet ports eth0 (LAN1) and eth1 (LAN2), we will try to set one for each Inthernet provider.

So disable any ethernet bonding in lan setup menu and open a shell terminal

I assume your 2d ISP router has this address 192.168.0.1 then do
Code: Select all
/sbin/ifconfig eth1 192.168.0.133 netmask 255.255.255.0 up
/sbin/route del default gw 0.0.0.0 dev eth1
/sbin/route add default gw 192.168.0.1 dev eth1
echo nameserver 192.168.0.1 >> /etc/resolv.conf
(be careful use really '>>')

Check if you see the NAS on your 2d LAN and post
Code: Select all
route