Jump to content

Hi guys, I have a Raspberry Pi with 2 ethernet interfaces(one onboard and one via usb). I have internet from 2 service providers, say A and B. Now, my main network devices are on a router connected to A and I have one ethernet port on the pi connected to this. I have the other port connected to B and the pi is the only device on that network. The pi is a server pulling content off the net and storing on a usb hdd. How can i make it so that all internet access is via B and the pi is sill accessable for SMB via A. Sorry for everything in a single para. Your help would be appreciated.

Link to comment
https://linustechtips.com/topic/368449-raspberry-pi-networking-help/
Share on other sites

Link to post
Share on other sites

Hi guys, I have a Raspberry Pi with 2 ethernet interfaces(one onboard and one via usb). I have internet from 2 service providers, say A and B. Now, my main network devices are on a router connected to A and I have one ethernet port on the pi connected to this. I have the other port connected to B and the pi is the only device on that network. The pi is a server pulling content off the net and storing on a usb hdd. How can i make it so that all internet access is via B and the pi is sill accessable for SMB via A. Sorry for everything in a single para. Your help would be appreciated.

You need to remove the gateway from eth0 (A) and set the gateway on eth1 (B )

To do this edit your network interfaces via this command:   sudo nano /etc/network/interfaces

Edit as need be then do CTRL X, ENTER  to save

 

Heres and example of one of mine with multiple interfaces.  you can use # to comment out lines you dont need to run:

 

auto lo

iface lo inet loopback

iface eth0 inet static

address 5.102.70.74

netmask 255.255.255.0

#gateway 5.102.70.2

iface eth1 inet static

address 192.168.0.223

netmask 255.255.255.0

gateway 192.168.0.1

 

Link to post
Share on other sites

Hi,

Thanks for your help. Just 2 questions. The IP address I put for the gateway must be that of the router out which device?

And how do I implement this on a server running Windows( not asking how to SSH in, asking how to set the gateway for a windows PC)

Link to post
Share on other sites

Hi,

Thanks for your help. Just 2 questions. The IP address I put for the gateway must be that of the router out which device?

And how do I implement this on a server running Windows( not asking how to SSH in, asking how to set the gateway for a windows PC)

The gateway IP must be the router on the network that you are connecting through.

 

on a server running windows you need to go to, start, control panel, network and internet,  network sharing center,  click the "change adapter settings" link on the left.  you should see your network adapters,  chose one,  right click it,  click propoties,  click IPV4 then click propotes,  here you can change the IP addess for the adapter,

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×