Re: 2 IPs on one nic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hi list

Hi, Patrick

> Can someone tell me how to add a 2nd IP adress to a nic and ensure that
> 2nd
> IP is kept after a reboot
>
> Tried ifconfig eth0 add aaa.bbb.ccc.ddd, but the IP is dropped after
> reboot

As good as the suggestions to create a sub-interface are, there's an even
easier way to do so, now, using the "ip" command.

To alias an IP onto your NIC, just run:

ip addr add aaa.bbb.ccc.ddd/YY dev ethX (in this case, /YY is the CIDR
notation for netmask bits)

To list the ip addresses running on your NICs, run:

ip addr

To remove an IP address, just run:

ip addr del aaa.bbb.ccc.ddd/YY dev ethX

I used to use the sub-interface methodology, as well, until I discovered
the "ip" command round about RHL9 or one of the Fedora Core
products...I've been using it, now, for about 7-8 years, on my Fedora
server and on my IPCop firewall.  Works like a charm, and keeps my
ifconfig output fairly clean (don't have to weed through 25 sub-interfaces
if I don't want to).
-- 
Mike Burger
http://www.bubbanfriends.org

Visit the Dog Pound II BBS
telnet://dogpound2.citadel.org or http://dogpound2.citadel.org

To be notified of updates to the web site, visit:

https://www.bubbanfriends.org/mailman/listinfo/site-update

or send a blank email message to:

site-update-subscribe@xxxxxxxxxxxxxxxxx

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux