Need Help on Ubuntu Server 18.04.1 Static Routing
Sebastian Wright
I am currently having a difficult time configuring a Static Route. I have an Asterisk Server Hosted on my Ubuntu Server Machine, It has 2 NICs
eth0;
IP Address: 172.16.1.99
GW: 172.16.1.1
eth1
IP Address: 10.20.0.3
GW: 10.20.0.1I have a SIP Trunk (LAN: 172.16.1.98) with an External IP of 20.211.3.12 which responds only to packets coming from eth0 (172.16.1.99). When I try to do a trace route on the External IP I can see that it is exiting eth1 (10.20.0.3) hence, no ping reply is being received. Basically, What I need to is route all traffic intended for 20.211.3.12 and 172.16.1.98 to use eth0.
I've done this on my netplan but doesn't seem to work, any advice?
network: ethernets: eth0: addresses: [172.16.1.99/23] gateway4: 172.16.1.1 nameservers: addresses: [172.16.1.1,8.8.8.8] dhcp4: no routes: - to: 10.211.3.0/24 via: 172.16.1.1 eth1: addresses: [10.20.0.3/24] gateway4: 10.20.0.1 nameservers: addresses: [10.20.0.1,8.8.4.4] dhcp4: no routes: - to: 172.16.1.0/23 via: 10.20.0.1 - to: 10.211.3.0/24 via: 172.16.1.1 - to: 10.211.3.12/32 via: 172.16.1.99 version: 2 1 Answer
You should be declaring a route
- to: 10.211.3.12/32 via: 172.16.1.98attached to your eth0 interface.
1