Referrence : ClearOS Documentation
[1] Static routes on a ClearOS system are associated with a particular network interface.

vi /etc/sysconfig/network-scripts/route-eno1

10.168.3.0/24 via 10.4.4.1 dev eno1

After adding this static route, the route can be activated by re-enabling the interface:

/sbin/ifdown ifcfg-eno1

/sbin/ifup ifcfg-eno1

[2] Remotely from the console if possible

/sbin/ifdown ifcfg-eno1 && /sbin/ifup ifcfg-eno1

[3] If you are using Multi-WAN, then you also need to restart the firewall:
# /sbin/service firewall restart
# service network restart

[root@gateway network-scripts]# ip route
default via 202.129.20.1 dev enp2s0.2
10.4.4.0/24 dev eno1 proto kernel scope link src 10.4.4.252
10.8.0.0/24 via 10.8.0.2 dev tun0
10.8.0.2 dev tun0 proto kernel scope link src 10.8.0.1
10.8.10.0/24 via 10.8.10.2 dev tun1
10.8.10.2 dev tun1 proto kernel scope link src 10.8.10.1
10.19.51.0/24 dev enp2s0.250 proto kernel scope link src 10.19.51.60
10.168.3.0/24 via 10.4.4.1 dev eno1
192.168.99.0/24 dev enp2s0.105 proto kernel scope link src 192.168.99.1
202.129.20.0/26 dev enp2s0.2 proto kernel scope link src 202.129.20.29

[root@gateway network-scripts]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 202.129.20.1 0.0.0.0 UG 0 0 0 enp2s0.2
10.4.4.0 0.0.0.0 255.255.255.0 U 0 0 0 eno1
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
10.8.10.0 10.8.10.2 255.255.255.0 UG 0 0 0 tun1
10.8.10.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun1
10.19.51.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0.250
10.168.3.0 10.4.4.1 255.255.255.0 UG 0 0 0 eno1
192.168.99.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0.105
202.129.20.0 0.0.0.0 255.255.255.192 U 0 0 0 enp2s0.2

[root@gateway network-scripts]# netstat -nar
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 202.129.20.1 0.0.0.0 UG 0 0 0 enp2s0.2
10.4.4.0 0.0.0.0 255.255.255.0 U 0 0 0 eno1
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
10.8.10.0 10.8.10.2 255.255.255.0 UG 0 0 0 tun1
10.8.10.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun1
10.19.51.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0.250
10.168.3.0 10.4.4.1 255.255.255.0 UG 0 0 0 eno1
192.168.99.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0.105
202.129.20.0 0.0.0.0 255.255.255.192 U 0 0 0 enp2s0.2

ขั้นตอนการเเพิ่ม Network Routing

 

[root]# cat /etc/sysconfig/network-scripts/route-eno1
10.5.0.0/16 via 10.4.4.1 dev eno1
10.154.0.0/16 via 10.4.4.1 dev eno1
10.155.0.0/16 via 10.4.4.1 dev eno1
10.168.0.0/16 via 10.4.4.1 dev eno1
10.180.0.0/16 via 10.4.4.1 dev eno1

[root]# /sbin/ifdown ifcfg-eno1 && /sbin/ifup ifcfg-eno

[root]# /sbin/service firewall restart

[root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 202.129.20.1 0.0.0.0 UG 0 0 0 enp2s0.2
10.4.4.0 0.0.0.0 255.255.255.0 U 0 0 0 eno1
10.5.0.0 10.4.4.1 255.255.0.0 UG 0 0 0 eno1
10.19.51.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0.250
10.154.0.0 10.4.4.1 255.255.0.0 UG 0 0 0 eno1
10.155.0.0 10.4.4.1 255.255.0.0 UG 0 0 0 eno1
10.168.0.0 10.4.4.1 255.255.0.0 UG 0 0 0 eno1
10.180.0.0 10.4.4.1 255.255.0.0 UG 0 0 0 eno1
192.168.99.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0.105
202.129.20.0 0.0.0.0 255.255.255.192 U 0 0 0 enp2s0.2
[root]# ip route list
default via 202.129.20.1 dev enp2s0.2
10.4.4.0/24 dev eno1 proto kernel scope link src 10.4.4.156
10.5.0.0/16 via 10.4.4.1 dev eno1
10.19.51.0/24 dev enp2s0.250 proto kernel scope link src 10.19.51.60
10.154.0.0/16 via 10.4.4.1 dev eno1
10.155.0.0/16 via 10.4.4.1 dev eno1
10.168.0.0/16 via 10.4.4.1 dev eno1
10.180.0.0/16 via 10.4.4.1 dev eno1
192.168.99.0/24 dev enp2s0.105 proto kernel scope link src 192.168.99.1
202.129.20.0/26 dev enp2s0.2 proto kernel scope link src 202.129.20.29
[root]# ping 10.180.3.101
PING 10.180.3.101 (10.180.3.101) 56(84) bytes of data.
64 bytes from 10.180.3.101: icmp_seq=1 ttl=60 time=13.0 ms
64 bytes from 10.180.3.101: icmp_seq=2 ttl=60 time=13.1 ms
64 bytes from 10.180.3.101: icmp_seq=3 ttl=60 time=13.1 ms
^C
— 10.180.3.101 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 13.042/13.111/13.185/0.110 ms
[root@pds1 network-scripts]#

C:\Users>ping 10.180.3.101

Pinging 10.180.3.101 with 32 bytes of data:
Reply from 10.180.3.101: bytes=32 time=26ms TTL=59
Reply from 10.180.3.101: bytes=32 time=22ms TTL=59
Reply from 10.180.3.101: bytes=32 time=44ms TTL=59
Reply from 10.180.3.101: bytes=32 time=29ms TTL=59

Ping statistics for 10.180.3.101:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 22ms, Maximum = 44ms, Average = 30ms

Advertisements