4

I am working with an embedded system in my lab and to remotely access the board, I have given a static IP to the board on Ethernet connection. The problem is - due to security reasons Ethernet connection cannot access general internet. The only way to access internet is by using wlan0. By default, Ethernet connection is preferred over wireless.

Is there a method by which I can remotely access the board using Ethernet? and whenever I run a command which required general internet connection ( such as sudo apt-get update), the board uses wlan0 to access internet!

Hizqeel
  • 1,887
  • 28
  • 22
  • 24

1 Answers1

0

You can assign a different IP address to each network interface or have them assigned by the DHCP server on their respective network (the default if you don't assign an IP manually). You already assigned an IP address to the wired network interface and I would guess that the wireless network has a DHCP server, so you can just leave that at its default configuration.

You should now be able to

  • reach the host from both networks through their respective IP addresses (unless an intermediate network component like a firewall blocks such traffic) and

  • access the internet through the wireless interface, because the DHCP server should have submitted a gateway address, so the host's networking layer can set up an appropriate route to public internet.

  • The wired connection should have no internet access unless you set up a gateway and/or route for it.

If you want to restrict inbound SSH traffic to one interface you can configure the SSH server to only listen to connections coming through that interface:

  1. In /etc/ssh/sshd_config uncomment or add a ListenAddress entry with the static IP address of that interface, e. g.:

    ListenAddress 10.0.23.42
    

    You can specify ListenAddress if you want to listen to multiple interfaces or IP versions (e. g. in a dual-stack setup with IPv4 and IPv6 on the same interface).

  2. Restart the SSH server:

    sudo service ssh restart
    
David Foerster
  • 35,754
  • 55
  • 92
  • 145
  • Hey David , thanks for the answer. But I have a problem. I remotely accessed my embedded board using the ethernet ( which has a static IP). But when I ran the command ifconfig - it doesn't show any IP assigned to wlan0. So , I think the eth0 is given precedence over wlan0 and that's why whenever my eth0 is connected, the board doesn't use wlan0. How can I change this – kshitij srivastava Jul 11 '16 at 20:54
  • If the wireless network doesn't have an IP address assigned, either something in the wireless stack doesn't work or the network has no DHCP server to assign IP addresses to network clients. It would help if you included the output of `ifconfig eth0`, `ifconfig wlan0`, and `iwconfig wlan0` (or whatever the interface names are) in your question. – David Foerster Jul 12 '16 at 10:07