How to assign 2 IP adresses ?

How to assign 2 IP adresses ?

Postby denjolras » Thu Jan 03, 2019 11:01 pm

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 ?
denjolras
 
Posts: 1
Joined: Sun Dec 17, 2017 4:11 pm

Re: How to assign 2 IP adresses ?

Postby Jocko » Fri Jan 04, 2019 10:24 am

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
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France


Return to Lacie 5big Network vs2

Who is online

Users browsing this forum: Google [Bot] and 9 guests