Ubuntu – Making the sftp server and still not know the cause of problem


I building a linux server and today I have a problem. I'm using ubuntu for user not ubuntu server.
My server use 2 ways to connect and use 2 different router

*1: Using an 4 ports LAN card to make a bonding mode, the router have gateway, the IP of bonding is .The bonding is working good, I can easy connect to sever.

*2: Using normal internet port on mainboard, gateway is, IP for server is . This connection use for SFTP server.

Check this pictures to see my connection:
ifconfig -a ifconfig -a

I make a sftp server using openssh, here is my test case using filezilla:

  • Connect to server via LAN ip and external ip of router working

  • Connect to server via LAN ip working

  • Connect via external ip of router not working

The result of not work test from filezilla:

Status: Connecting to…

Response: fzSftp started, protocol_version=8

Command: open "Deadlinesftp@" 3389

Error: Network error: Connection timed out

Error: Could not connect to server

I have already do the port redirection on router, and this router work well with another windows server. I feel like something in ubuntu OS is blocking the connection via external ip of, I turned off the ubuntu firewall and still not work. I have to focus on because this is the internet line use for ftp or sftp, can't use another one.

Does anyone here know why and can help me with this problem please.

Thank you so much.

Best Answer

The issue here is that you can only have one default gateway and you have two and enp5s0 is defined first, so that takes all traffic and enp6s0 gets none...

That leaves you with the following possibilities:
(all are mutually exclusive, the higher the number, the more difficult)

  1. You can have one of the two IPs face the internet (default) and the other one internal only. (static routes)
  2. You need to add a 3rd external Internet router (E.G. A Cisco ISR 111x with dual WAN ports) that will bond the 2 external routers you already have and will save state for the external connections and set that router as the default gateway for both (on different IP addresses)
  3. You can bond both NICs together and let the bond save state: you have no control over what goes where: the bond does that for you like the third router would do in hardware.
  4. You can split up the internet in 2 and define half of all Internet address ranges on #5 (Let's say all of the USA; static routes) and all of the rest of the world on #6 (default).
Related Question