* James Carlson <[email protected]> wrote:
> 
> viveks wrote:
> > hi,
> > 
> > I want to configure multiple ip's for a single nic with each ip on a 
> > different subnet. I want this to persist across system reboots. How do i do 
> > this (by editing which file can i do this)?
> 
> Assuming you have disabled NWAM, it's quite simple.  If your NIC is
> named (say) "e1000g0", and you currently have /etc/hostname.e1000g0 to
> configure its address, just create /etc/hostname.e1000g0:1 to configure
> a logical interface (also known as an "alias" on other operating
> systems), /etc/hostname.e1000g0:2 for another, and so on.
> 
> Note that it's not necessary for logical interfaces to be on the same
> network.  They can all be on separate subnets.
> 
> Note also that you can specify the subnet mask in the /etc/hostname.*
> file.  You can use something like:
> 
>       echo 10.2.5.1/24 > /etc/hostname.e1000g0:1
> 
> Furthermore, those files actually just contain a set of ifconfig
> options, so see the ifconfig(1M) man page for details.
> 
> The above sets up the system to establish the interfaces at boot time.
> To set them up without rebooting, just use ifconfig, like so:
> 
>       ifconfig e1000g0:1 plumb 10.2.5.1/24 broadcast + up
> 
> If you haven't disabled NWAM, then you won't be able to do this with the
> current version of NWAM integrated in OpenSolaris.
> 
> > I have gone through a lot of docs and searched enough, but couldn't find a 
> > solution.
> > I know how to configure multiple ip's for a nic on the same subnet.
> > 
> > Also, can the /etc/netmasks file contain multiple entries? 
> 
> Yes, but don't bother.  /etc/netmasks is a horror show.
> 
> > If i want to assign a netmask for an ip address, which file should i edit?
> > 
> > How can i assign mutiple gateway's?
> 
> Sure.  You can set multiple hard-coded default routes by adding multiple
> addresses to the /etc/defaultrouter file.

What's the format of this file then?

Regards,


Jie

> Or, if you need something other than just default ("0/0") routes, use
> the route(1M) "-p" flag to establish permanent routes.
> 
> Better still, if your network is complicated, use a routing protocol.
> That's what routing protocols are for, and using one means that you have
> much finer-grained control over your routing situation.
> 
> > Can i assign a gateway for a particular nic instead of specifying the 
> > default router?
> 
> No, I don't think that makes sense.  That's not quite how IP works.
> Routes are used to find interfaces, not the other way around.
> 
> -- 
> James Carlson         42.703N 71.076W         <[email protected]>
> _______________________________________________
> networking-discuss mailing list
> [email protected]
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to