Setting up an alias ethernet interface

Simon White yellowdog-general@lists.terrasoftsolutions.com
Mon Apr 22 06:17:01 2002


On Mon, 22 Apr 2002, Alexander Holst wrote:

> I remember that it was possible to set up an alias ethernet interface
> with netcfg. i can't find this command in YDL2.2 any more. The "network
> Configuration" in the Systems menue does not allow new interfaces to be
> added. How can one achieve this now. Should I install linuxconf - I
> remember some time ago a statement from YDL that linuxconf wasn't the
> tool of choice and that's the reason it wasn't included in the distro.
>
> I need to set this machine up to route|masquerade between a private
> network [192.168.1.x] and a "real" network on the same wire to test some
> machines and routing issues.

Here's how:

$ ifconfig eth0:1 192.168.1.x netmask 255.255.255.0

That should give you a secondary IP on that interface. The routing should
take care of itself, your masquerading needs to be done with something
like iptables of course. Don't forget to do

$ echo 1 > /proc/sys/net/ipv4/ip_forward

Put the two lines at the end of your /etc/rc.local (or wherever rc.local
lives)  and it will restart automatically at boot with the alias.

To check settings do

$ ifconfig

These commands require you to be logged in as root.

Regards,

--
Simon White