OT: alias for a network card
Hi,
Excuse for this OT question here. But I don't know where I can get an answer. While doing NAT i need to have alias IPs for my router machine like,
# ipconfig eth0:1 192.168.0.4
But these rules are lost once the machine is rebooted. How can I make them permanent?
I thought of putting these in rc.local but it rather crude approach as my firewall might be started before that. I use Mandrake Linux.
Thanks a lot in advance.
With warm regards,
-Payal
Quoted 10 lines · Payal Rathod
Hi,
Excuse for this OT question here. But I don't know where I can get an answer. While doing NAT i need to have alias IPs for my router machine like,# ipconfig eth0:1 192.168.0.4But these rules are lost once the machine is rebooted. How can I make them permanent?
I thought of putting these in rc.local but it rather crude approach as my firewall might be started before that. I use Mandrake Linux.
Find out what script starts the firewall and put the line before the line starting the firewall. Or, put it in the firewall script. Or even better, put it in the script that initializes your network card.
--
Erik Wikström
Hi,
On Thu, 15 Jul 2004 14:28:48 +0200, Erik Wikström
Quoted 3 lines
Find out what script starts the firewall and put the line before the line starting the firewall. Or, put it in the firewall script. Or even better, put it in the script that initializes your network card.
I think I got it licked. BTW, is initializing IPs in /etc/rc.local a bad practice?
With warm regards,
-payal
rc.local is not the best place to place your initializing script
Quoted 14 lines · Payal Rathod
Hi,
On Thu, 15 Jul 2004 14:28:48 +0200, Erik WikströmQuoted 3 lines
Find out what script starts the firewall and put the line before the line starting the firewall. Or, put it in the firewall script. Or even better, put it in the script that initializes your network card.
I think I got it licked. BTW, is initializing IPs in
/etc/rc.locala bad practice?With warm regards,
-payal
Quoted 10 lines · Payal Rathod
Hi,
Excuse for this OT question here. But I don't know where I can get an answer. While doing NAT i need to have alias IPs for my router machine like,# ipconfig eth0:1 192.168.0.4But these rules are lost once the machine is rebooted. How can I make them permanent?
I thought of putting these in rc.local but it rather crude approach as my firewall might be started before that. I use Mandrake Linux.
It is OK to have firewall rules loaded before your interfaces are configured. I would go a step further and say that it is recommended. On most Linux distribution I saw that is exactly the order how things are done during boot (first iptables, than network). This way you don't have that one or two seconds gap when your machine/network is unprotected.
As for original question, check how and where your "normal" interfaces are configured. On RedHat it is file ifcfg-IF_NAME (where X is interface number, for example for eth0 file is ifcfg-eth0) in /etc/sysconfig/network-scripts directory (so if you want virtual interface on eth0, you just create ifcfg-eth0:1 file). Solaris does it the same way (/etc/hostname.hme0, /etc/hostname.hme0:1 and so on). On Mandrake it is probably something similar (when you find how the normal interfaces are configured, virtuals are most likely configured the very same way).
Signature · 3 lines
Aleksandar Milivojevic <[email protected]> Pollard Banknote Limited Systems Administrator 1499 Buffalo Place Tel: (204) 474-2323 ext 276 Winnipeg, MB R3T 1L7