ipconfig - multiple IPs - swapping IP effect on alias IPs?

ipconfig - multiple IPs - swapping IP effect on alias IPs?

Post by Armin Roeh » Thu, 05 Dec 2002 20:30:45



Hello,

my IP structure looks like this:
# ifconfig -a
 lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
         inet 127.0.0.1 netmask ff000000
 hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
         inet 194.163.186.149 netmask fffffff0 broadcast 194.163.186.159
         ether 0:80:17:28:ae:8f
 hme0:2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
         inet 194.163.186.158 netmask fffffff0 broadcast 194.163.186.255
 hme0:5: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
         inet 192.168.183.156 netmask ffffff00 broadcast 192.168.183.255

I enable and disable the various alias IPs using plumb and unplumb.
/usr/sbin/ifconfig hme0:1 plumb
/usr/sbin/ifconfig hme0:1 194.163.186.156 broadcast 194.163.186.255 netmask
 255.255.255.240 up

Can I also do a plumb and unplumb with hme:0, the hardware IP of the machine?
I unfortunately do not have a test-machine here. Would hme0:2 and hme0:5
get changed or stay as they are without being influenced?

Thanks,
    Armin

 
 
 

ipconfig - multiple IPs - swapping IP effect on alias IPs?

Post by John Howell » Thu, 05 Dec 2002 20:54:07



> Hello,

> my IP structure looks like this:
> # ifconfig -a
>  lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
>          inet 127.0.0.1 netmask ff000000
>  hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
>          inet 194.163.186.149 netmask fffffff0 broadcast 194.163.186.159
>          ether 0:80:17:28:ae:8f
>  hme0:2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
>          inet 194.163.186.158 netmask fffffff0 broadcast 194.163.186.255
>  hme0:5: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
>          inet 192.168.183.156 netmask ffffff00 broadcast 192.168.183.255

> I enable and disable the various alias IPs using plumb and unplumb.
> /usr/sbin/ifconfig hme0:1 plumb
> /usr/sbin/ifconfig hme0:1 194.163.186.156 broadcast 194.163.186.255 netmask
>  255.255.255.240 up

As for hme0:2 the broadcast address is wrong, it should be
194.163.186.159. Assuming /etc/netmasks is set up for this subnet why
not do

        ifconfig hme0:1 ... netmask + broadcast +

(the order is significant) and let the system work it out? Or if
/etc/netmasks is not set up

        ifconfig hme0:1 ... netmask 255.255.255.240 broadcast +

Quote:> Can I also do a plumb and unplumb with hme:0, the hardware IP of the machine?

If you mean hme0 - no - when you unplumb hme0 the whole hme0 "structure"
of hme0 and all the hme0:* interfaces will be removed.

John Howells

 
 
 

ipconfig - multiple IPs - swapping IP effect on alias IPs?

Post by Darren Dunha » Fri, 06 Dec 2002 01:45:27



> Hello,
> my IP structure looks like this:
> # ifconfig -a
>  lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
>          inet 127.0.0.1 netmask ff000000
>  hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
>          inet 194.163.186.149 netmask fffffff0 broadcast 194.163.186.159
>          ether 0:80:17:28:ae:8f
>  hme0:2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
>          inet 194.163.186.158 netmask fffffff0 broadcast 194.163.186.255
>  hme0:5: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
>          inet 192.168.183.156 netmask ffffff00 broadcast 192.168.183.255
> I enable and disable the various alias IPs using plumb and unplumb.
> /usr/sbin/ifconfig hme0:1 plumb
> /usr/sbin/ifconfig hme0:1 194.163.186.156 broadcast 194.163.186.255 netmask
>  255.255.255.240 up

Okay...

Quote:> Can I also do a plumb and unplumb with hme:0, the hardware IP of the

  machine?

No.  Don't unplumb it.  You don't need to do that to change the IP
address though.  Just do everything else..

ifconfig hme0 1.2.3.4 broadcast + netmask + up

Quote:> I unfortunately do not have a test-machine here. Would hme0:2 and hme0:5
> get changed or stay as they are without being influenced?

You'd wipe them out if you unplumbed hme0.

--

Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >

 
 
 

ipconfig - multiple IPs - swapping IP effect on alias IPs?

Post by Pillai, Krish [RICH2:2Y66:EXCH » Fri, 06 Dec 2002 07:31:48


    The virtual device sits on the real device that supplies the MAC layer.
If you unplumb the real device, you will lose the virtual devices.


Quote:> Hello,

> my IP structure looks like this:
> # ifconfig -a
>  lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
>          inet 127.0.0.1 netmask ff000000
>  hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
>          inet 194.163.186.149 netmask fffffff0 broadcast 194.163.186.159
>          ether 0:80:17:28:ae:8f
>  hme0:2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index
2
>          inet 194.163.186.158 netmask fffffff0 broadcast 194.163.186.255
>  hme0:5: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index
2
>          inet 192.168.183.156 netmask ffffff00 broadcast 192.168.183.255

> I enable and disable the various alias IPs using plumb and unplumb.
> /usr/sbin/ifconfig hme0:1 plumb
> /usr/sbin/ifconfig hme0:1 194.163.186.156 broadcast 194.163.186.255
netmask
>  255.255.255.240 up

> Can I also do a plumb and unplumb with hme:0, the hardware IP of the
machine?
> I unfortunately do not have a test-machine here. Would hme0:2 and hme0:5
> get changed or stay as they are without being influenced?

> Thanks,
>     Armin

 
 
 

ipconfig - multiple IPs - swapping IP effect on alias IPs?

Post by John Howell » Fri, 06 Dec 2002 18:52:28



> ifconfig hme0 1.2.3.4 broadcast + netmask + up

Should that not be

        ifconfig hme0 1.2.3.4 netmask + broadcast + up

as ifconfig will execute the parameters in order. If broadcast appears
first it will set the broadcast address based on the possibly incorrect
default netmask for Class for the address before setting the netmask.
Doing the netmask first will set the broadcast address for the
presumably correct netmask that is then configured.

John Howells

 
 
 

ipconfig - multiple IPs - swapping IP effect on alias IPs?

Post by Darren Dunha » Sat, 07 Dec 2002 01:21:15




>> ifconfig hme0 1.2.3.4 broadcast + netmask + up
> Should that not be
>    ifconfig hme0 1.2.3.4 netmask + broadcast + up

It should be whatever it is in the startup scripts, since you'll cut 'n'
paste it from there rather than whatever it is I come up with... :-)

--

Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >

 
 
 

1. answering to multiple IPs, IP Alias?

Hello:

I have some question about configuring my system to
answer to more than one IP.

[1] Is this a matter of configuring IP Alias?

[2] I had a look at the IP Alias FAQ it mentions this

    > * First load the IP Alias module (you can skip this step
    > if you compiled the module into the kernel):
    >
    > /sbin/insmod /lib/modules/`uname -r`/ipv4/ip_alias.o

    In my /lib/modules/Linux-2.0.33/ipv4 directory, there is
    no ip_alias.o. My system is a Slackware 3.4 box. Is IP Alias
    already part of the stock kernel?

[3] Is the last step edit /etc/rc.d/rc.local to include the following?

    /sbin/ifconfig lo     127.0.0.1
    /sbin/ifconfig eth0   up
    /sbin/ifconfig eth0   205.168.0.1
    /sbin/ifconfig eth0:0 198.200.0.10
    /sbin/ifconfig eth0:1 198.200.0.100

    /sbin/route add -net  127.0.0.0
    /sbin/route add -net  205.168.0.0   dev eth0
    /sbin/route add -host 205.168.0.1   eth0
    /sbin/route add -host 198.200.0.10  eth0:0
    /sbin/route add -host 198.200.0.100 eth0:1
    /sbin/route add default gw (ip of my gateway)

* the above IPs are just for example.
  the host's own IP would be 205.168.0.1
  the addtional IPs that host will listen to is 198.200.0.(10/100)

Am I missing something here?

Thanks in advance
Stephen

2. Scripts for managing student accounts

3. 4.2 nic aliasing, multiple IPs, one nic does not work???

4. ASUS P3B-F Motherboard Probe Software

5. "ifconfig alias" - multiple IPs on one interface

6. Calling pci_find_device from user space ?

7. ifconfig alias -or- assigning multiple IPs

8. ftpd wu.ftpd not starting up

9. 4.2 multiple IPs, one nic(aliasing), does not work??

10. Nishan IPS 3000 and IPS 4000 docs

11. RH 6.0: Stumped by network: works on L4 IPs, but not L3 IPs

12. MASQing 2 global ips to 2 private ips how?

13. IP accounting on aliased IPs