/etc/sysconfig/static-routes는 영구 경로를 추가하는 더 이상 사용되지 않는 방법입니까?

/etc/sysconfig/static-routes는 영구 경로를 추가하는 더 이상 사용되지 않는 방법입니까?

RHEL 5.x

정적 경로를 추가하면 좋겠습니다 /etc/sysconfig/static-routes. 내가 리뷰할 때Red Hat 문서하지만 나는 이것이 언급된 것을 보지 못했습니다. 대신에 다음을 사용하는 것이 좋습니다./etc/sysconfig/network-scripts/route-<interface>

static-routes파일은 영구 경로를 추가하는 더 이상 사용되지 않는 방법입니까?

답변1

인터페이스를 종료하면 해당 인터페이스를 사용하는 모든 경로가 삭제됩니다. 이는 커널에서 자동으로 발생합니다.

나중에 인터페이스를 다시 시작하면 /etc/sysconfig/static-routes다시 실행되지 않으므로 파일에서 이 인터페이스에 대해 지정된 경로가 손실됩니다. 그러나 경로를 인터페이스별 파일에 넣으면~ 할 것이다이 정보는 인터페이스를 다시 열면 복원됩니다.

/etc/sysconfig/network-scripts/route-<interface>따라서 경로를 파일에 저장하는 것이 좋습니다 .

답변2

파일은 인터페이스에 특정하지 않은 정적 경로를 포함하는 것으로 보입니다. 다음을 사용하여 grep을 수행하십시오 /etc.

# grep -rl static-route .
./rc.d/init.d/network
./ppp/ipv6-up
./ppp/ip-up.ipv6to4
./sysconfig/network-scripts/ifup-sit
./sysconfig/network-scripts/ifup-ipv6
# perl -00 -ne 'print if m/static-routes/' rc.d/init.d/network 
        # Add non interface-specific static-routes.
        if [ -f /etc/sysconfig/static-routes ]; then
           grep "^any" /etc/sysconfig/static-routes | while read ignore args ; do
              /sbin/route add -$args
           done
        fi    
        # Add non interface-specific static arp entries.
        if [ -f /etc/ethers ]; then
                /sbin/arp -f /etc/ethers
        fi

이러한 파일은 RHEL5, 6 및 7에 존재하지만 파일이 참조 network되는지 모르기 때문에 비활성화된 경우 서비스가 실행되지 않을 수 있습니다 . 이를 위해서는 실제로 활성화하고 실행하여 무엇이 닿는지 확인해야 합니다.NetworkManagerstatic-routesstrace -o blah -ff -e trace=file ...

관련 정보