Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
36
rated 0 times [  36] [ 0]  / answers: 1 / hits: 30502  / 2 Years ago, sat, september 10, 2022, 5:16:50

I always like to test new config files before deploying them--with tools like apachectl configtest and named-checkconf.



It's rare that mistakes crop up, but catching them before deployment eliminates any impact. The one that has bit me in the backside several times is /etc/network/interfaces; I can't seem to find a tool to test it, and restarting the network on a remote machine only to discover it's no longer reachable is quite annoying--especially when we use a lot of bonding and bridging.


More From » networking

 Answers
6

To expand upon @jdthood's answer...



If the interface is already up, you can still use this method to validate the /etc/network/interfaces file. For example, assuming you have an error, you may see something like this:



$ sudo ifup --no-act eth0
/etc/network/interfaces:11: unknown method
ifup: couldn't read interfaces file "/etc/network/interfaces"


Apparently there's an error on line 11. Great. Thank heavens I didn't bounce the networking only to lose SSH access!



If all is fine, you will see:



$ sudo ifup --no-act eth0
ifup: interface eth0 already configured

[#33797] Sunday, September 11, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
shionnky

Total Points: 276
Total Questions: 104
Total Answers: 108

Location: Montenegro
Member since Thu, Jun 16, 2022
2 Years ago
shionnky questions
;