Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I know I can rename my network interfaces (eg 'eth0' to 'lan', 'eth1' to 'net' etc) but does anyone know a way I can alias (symlink if you like) 'lan' -> 'eth0'
I want to be able to use more legible interface names in things like iptables rules (such as "-i lan" instead of "-i eth0") but I don't want to break any config that is expecting eth0 to exist....
Edit that file and change eth0 to whatever you want to call it.
I don't want to change the current name, just create an alias/"symlink" from 'lan' to 'eth0'...
Quote:
Originally Posted by bakdong
Traditionalists will use variable names that are meaningful and assign the actual eth0 or whatever values to them:
Yes, I could do that, but that means reinventing the iptables init script and discarding the stock one which I'd like to retain for simplicities sake (eg, when other sysadmins are on the box and don't know that it's actually "firewall" instead of "iptables" when calling service or chkconfig)... And I generally hate reinventing the wheel, especially for something as "small" as this
Yes, I could do that, but that means reinventing the iptables init script and discarding the stock one which I'd like to retain for simplicities sake (eg, when other sysadmins are on the box and don't know that it's actually "firewall" instead of "iptables" when calling service or chkconfig)... And I generally hate reinventing the wheel, especially for something as "small" as this
I use a script to generate the iptables rules (with the variables in it) then use iptables-save > /etc/sysconfig/iptables to save those rules in case of a reboot. Result is I get a readable script (with comments) that I can understand, but I don't have to change any inbuilt functionality.
I use a script to generate the iptables rules (with the variables in it) then use iptables-save > /etc/sysconfig/iptables to save those rules in case of a reboot. Result is I get a readable script (with comments) that I can understand, but I don't have to change any inbuilt functionality.
That's not a half bad idea actually if I can't figure out how to do this.
Have a script generate a save file, then load that using iptables-restore. Has the benefit of being atomic so if there's a syntax error in the rules, it won't bork the current rules
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.