GUIDE: set default gateway eth0 or eth1

eth0 - lan2wan - ethernet
eth1 - ISP 10/8 NAT - SIP/trunk

rote add default via 100.64.0.1 eth0

service network restart

ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
64 bytes from 1.1.1.1: icmp_seq=554 ttl=57 time=6.10 ms
64 bytes from 1.1.1.1: icmp_seq=555 ttl=57 time=6.40 ms
64 bytes from 1.1.1.1: icmp_seq=556 ttl=57 time=5.22 ms
From 10.x.x.x. icmp_seq=557 Destination Host Unreachable
From …

This will help you save time and attempts to set up routing.

cd /etc/sysconfig/network-scripts

ll

[root@VoIP network-scripts]# ll
total 224
-rwxr-xr-x 1 root root 296 Feb 4 11:05 ifcfg-eth0
-rwxr-xr-x 1 root root 218 Feb 4 11:05 ifcfg-eth1
-rw-r–r-- 1 root root 281 Feb 2 21:08 ifcfg-lo
lrwxrwxrwx. 1 root root 24 Feb 1 21:05 ifdown → …

nano ifcfg-eth0

DEVICE=eth0
DEFROUTE=yes
BOOTPROTO=static

nano ifcfg-eth1

DEVICE=eth1
DEFROUTE=no
BOOTPROTO=dhcp
ONBOOT=‘yes’

service network restart

congrats you just saved your time

route

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default pfSense.lan.vit 0.0.0.0 UG 0 0 0 eth0
10.155.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
100.64.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
link-local 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
link-local 0.0.0.0 255.255.0.0 U 1003 0 0 eth1

ping 1.1.1.1

PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=57 time=5.70 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=57 time=5.56 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=57 time=5.75 ms
64 bytes from 1.1.1.1: icmp_seq=4 ttl=57 time=5.70 ms
64 bytes from 1.1.1.1: icmp_seq=5 ttl=57 time=5.99 ms
64 bytes from 1.1.1.1: icmp_seq=6 ttl=57 time=5.72 ms
64 bytes from 1.1.1.1: icmp_seq=7 ttl=57 time=5.68 ms
64 bytes from 1.1.1.1: icmp_seq=8 ttl=57 time=5.84 ms
64 bytes from 1.1.1.1: icmp_seq=9 ttl=57 time=6.08 ms

traceroute 1.1.1.1

traceroute to 1.1.1.1 (1.1.1.1), 30 hops max, 60 byte packets
1 pfSense.lan.vitko-core.ru (100.64.0.1) 1.078 ms 0.905 ms 0.413 ms
2 …
7 cloudflare.mdix.net (193.17.78.13) 6.028 ms 5.946 ms 5.547 ms
8 one.one.one.one (1.1.1.1) 5.258 ms 5.208 ms 5.079 ms

1 Like

and don’t forget to DHCP add GATEWAY= - yeah static for dhcp method

ifcfg-eth1
FreePBX Sysadmin Generated network configuration.
#This file was generated at 2023-02-02T18:57:55+00:00
DEVICE=eth1
DEFROUTE=no
BOOTPROTO=dhcp
ONBOOT=‘yes’
PEERDNS=no
IPV6_PEERDNS=no
ZONE=external
DESCRIPTION=“IDC”

GATEWAY=10.155.0.1

traceroute 10.155.0.1

traceroute to 10.155.0.1 (10.155.0.1), 30 hops max, 60 byte packets
1 10.155.0.1 (10.155.0.1) 5.310 ms * *

eth0 for Freepbx update and acces to WAN
eth1 for ISP 10.0.0.0/8/NAT

P.S. i know 10.155.0.0/255.255.0.0 != 10.0.0.0/8 it is 10.155.0.0/14 just showing that this is the provider’s network

BOOTPROTO=dhcp

Is almost always a bad choice if you are in control of your network.

it is my bridge with ISP SIP DHCP

Does it ever change? (Probably not)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.