Score:0

In a Linux environment, does the order of commands "ip Route" affect routing?

us flag

I attached multiple ethernets to the server, one for LAN and the rest for PPPOE. Each packet connected to each PPPOE was sent by itself. It works fine on CentOS 6.10.

In the 8 series, packets are routed through the default LAN. MIRACLE LINUX is a RHEL compatible distribution.

I'm curious about the order of the results of "ip route". How about that.

# cat /etc/redhat-release
CentOS release 6.10 (Final)

# cat /etc/iproute2/rt_tables | grep -v "^#\|^$"
255     local
254     main
253     default
0       unspec
100  tbl_ppp0

# ip route
C.C.C.C dev ppp0  proto kernel  scope link  src A.A.A.A
169.254.0.0/16 dev eth0  scope link  metric 1002
default via 192.168.1.1 dev eth0

# ip route show table tbl_ppp0
default via A.A.A.A dev ppp0

# ip rule | grep tbl_ppp0
27373:  from A.A.A.A lookup tbl_ppp0

# cat /etc/squid/acl.conf  | grep ppp0
http_port A.A.A.A:3128 name=ppp0_IP
acl ppp0_acl myportname ppp0_IP
tcp_outgoing_address A.A.A.A ppp0_acl

# curl -s -m 2 http://ifconfig.co/ip -x A.A.A.A:3128
A.A.A.A
# tail /var/log/squid/access.log | grep A.A.A.A
1688498713.497    260 A.A.A.A TCP_MISS/200 683 GET http://ifconfig.co/ip - DIRECT/172.64.163.15 text/plain

 

# cat /etc/redhat-release
MIRACLE LINUX release 8.7 (Peony)

# cat /etc/iproute2/rt_tables |  grep -v "^#\|^$"
255     local
254     main
253     default
0       unspec
100 tbl_ppp0

# ip route
default via 172.20.0.1 dev enp1s0
169.254.0.0/16 dev enp1s0 scope link metric 1002
172.20.0.0/24 dev enp1s0 proto kernel scope link src 172.20.0.104
C.C.C.C dev ppp0 proto kernel scope link src B.B.B.B

# ip route show table tbl_ppp0
default via B.B.B.B dev ppp0

# ip rule | grep tbl_ppp0
32615:  from B.B.B.B lookup tbl_ppp0

# cat /etc/squid/acl.conf  | grep ppp0
http_port B.B.B.B:3128 name=ppp0_IP
acl ppp0_acl myportname ppp0_IP
tcp_outgoing_address B.B.B.B ppp0_acl

# curl -s -m 2 http://ifconfig.co/ip -x B.B.B.B:3128
X.X.X.X        ← this ip is enp1s0
# tail /var/log/squid/access.log | grep B.B.B.B
1688498755.023    282 B.B.B.B TCP_MISS/200 681 GET http://ifconfig.co/ip - HIER_DIRECT/172.64.163.15 text/plain
pt flag
The order in which you enter the commands is not important. Routes are selected from most specific to least specific, not by order.
Cholho Lee avatar
us flag
I solved. There was nothing wrong with the question. It was because the caller squid was not reloaded.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.