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.

  • Please add the output of route -eF
    – cmak.fr
    Jul 31, 2019 at 7:09
  • Check it here please i.stack.imgur.com/Mtac8.jpg
    – WillRock
    Jul 31, 2019 at 7:57
  • 1
    you have to delete the first one (dest default, iface bond)
    – cmak.fr
    Jul 31, 2019 at 8:06
  • How can to delete that one. Sorry this is the first time I use ubuntu
    – WillRock
    Jul 31, 2019 at 8:28
  • sudo route del default dev bond0
    – cmak.fr
    Jul 31, 2019 at 8:43

1 Answer 1


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).
  • 1
    Thank you so much.
    – WillRock
    Aug 6, 2019 at 2:40
  • I'm sorry there is no easy solution...
    – Fabby
    Aug 6, 2019 at 6:47
  • It's ok man, I understand. By the way, if i make an bonding with that 2 NICs so which bond mode should I chose ?
    – WillRock
    Aug 6, 2019 at 8:41
  • Now that would be a new question whereas that one is definitely a duplicate of this one... :-) Give a full description in the new one of your current network config (iincluding drivers) and why you're trying to do this by posting a link to this one. Tag it [networking] to have all the network gurus descend on your question like vampires... ;-)
    – Fabby
    Aug 6, 2019 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.