# vi /root/iproute_add.sh

ip route add 10.155.0.0/16 dev enp2s0.6
ip route add 10.168.0.0/16 dev enp2s0.6
ip route add 10.180.0.0/16 dev enp2s0.6
ip route add 10.5.0.0/16 dev enp2s0.6

ip route add  10.34.227.0/24 dev enp2s0.6

:wq!

# crontab -e

00 23 * * * /root/iproute_add.sh

Netstat

# netstat -ntu | grep ESTABLISHED | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -nr

iptables -A INPUT -s 108.160.172.236 -j DROP
iptables -A INPUT -s 183.3.202.185 -j DROP

Set a default route
# ip route add default via 10.19.51.61

Set a Route to the Locally Connected Network eth0
# ip route add 10.19.0.0/16 dev eth0

Delete route from table
# ip route delete 10.19.0.0/16 dev eth0

# ip route list
202.129.xx.xx/26 dev eth0 proto kernel scope link src 202.129.xx.xx
10.19.51.0/24 dev eth1 proto kernel scope link src 10.19.51.61
10.19.53.0/24 dev eth1 scope link
10.19.52.0/24 dev eth1 scope link
default via 202.129.xx.1 dev eth0

# ip route show
202.129.20.0/26 dev eth1  proto kernel  scope link  src 202.129.xx.xx
10.19.51.0/24 dev eth0  proto kernel  scope link  src 10.19.51.61
10.19.0.0/16 dev eth0  scope link
default via 202.129.xx.1 dev eth1
# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
202.129.xx.0   0.0.0.0         255.255.255.192 U         0 0          0 eth1
10.19.51.0         0.0.0.0         255.255.255.0     U         0 0          0 eth0
10.19.0.0          0.0.0.0         255.255.0.0         U         0 0          0 eth0
0.0.0.0             202.129.xx.1    0.0.0.0            UG       0 0          0 eth1
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
202.129.xx.0   0.0.0.0         255.255.255.192 U     0      0        0 eth1
10.19.51.0         0.0.0.0         255.255.255.0     U     0      0        0 eth0
10.19.0.0          0.0.0.0         255.255.0.0         U     0      0        0 eth0
0.0.0.0             202.129.xx.1    0.0.0.0            UG    0      0        0 eth1
# ip route list
202.129.xx.0/26 dev eth1  proto kernel  scope link  src 202.129.xx.xx
10.19.51.0/24 dev eth0  proto kernel  scope link  src 10.19.51.61
10.19.0.0/16 dev eth0  scope link
default via 202.129.xx.1 dev eth1

Advertisements