1

I have two network interfaces but I am only able to SSH to one, what routing do I need to be able to connect to either?

If I set the default route to 10.0.0.1 dev eth0, I can connect on 10.0.0.157.
If I set the default route to 10.0.15.1 dev eth1, I can connect on 10.0.15.169.
But I obviously cant have two default's.

# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 06:d8:28:72:ca:62  
          inet addr:10.0.0.157  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::4d8:28ff:fe72:ca62/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:9001  Metric:1
          RX packets:4384 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4503 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:422764 (422.7 KB)  TX bytes:360354 (360.3 KB)

eth1      Link encap:Ethernet  HWaddr 06:ed:ac:73:86:60  
          inet addr:10.0.15.169  Bcast:10.0.15.255  Mask:255.255.255.0
          inet6 addr: fe80::4ed:acff:fe73:8660/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:9001  Metric:1
          RX packets:1368 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8670 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:77449 (77.4 KB)  TX bytes:614644 (614.6 KB)

Routing table

# ip route
default via 10.0.0.1 dev eth0 
10.0.0.0/24 dev eth0  proto kernel  scope link  src 10.0.0.157 
10.0.15.0/24 dev eth1  proto kernel  scope link  src 10.0.15.169 

The Server has a NIC on SUBNET1 and a NIC on SUBNET2. The Server I am trying to connect from is in SUBNET1. I can connect to SERVER3 from SERVER2 and vice versa.

enter image description here

Christian
  • 746
  • 3
  • 13
  • 30
  • A network diagram showing how this system is connected, and the networks you want to communicate with would allow us to give you a more detailed answer. – Zoredache Jul 30 '18 at 19:17
  • I haven't used amazon that much. What is rtb1 vs rtb2. Is it 'normal' to have the same subnet network `10.0.0.0/20` for both? Also, what are you connecting from? Is your connection from another system in AWS, or is this coming from the Internet? – Zoredache Jul 30 '18 at 19:57
  • rtb = routing table (abbreviated) 10/20 is actually set by Amazon and cant be removed. I can, for example, add a route in RTB1 that allows 0/0 out to the Internet, whilst block Internet access in RTB2 – Christian Jul 30 '18 at 21:09

2 Answers2

1

Your problem is almost certainly related to routing, but you haven't given us enough of a network diagram to give specific help.

You could possibly add some static routes to cover networks that should be appropriate to each interface.

Or you could set up multiple route tables and some rules that select the route table based on the interface.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
0

You probably left out some details in your question.

You should be able to connect to both 10.0.0.157 and 10.0.15.169 regardless of the default route, and also without any default route present.

RalfFriedl
  • 3,008
  • 4
  • 12
  • 17