[Linux-users] 2 IP's on the same network card
Bill Campbell
linux-sxs
Fri Aug 31 08:28:19 PDT 2007
On Fri, Aug 31, 2007, Dirk Moolman wrote:
>-----Original Message-----
>From: linux-users-bounces at pananix.com
>[mailto:linux-users-bounces at pananix.com] On Behalf Of Bill Campbell
>Sent: 28 August 2007 04:32 PM
>To: linux-users at linux-sxs.org
>Subject: Re: [Linux-users] 2 IP's on the same network card
>
>On Tue, Aug 28, 2007, Dirk Moolman wrote:
>>>
>>>>On Tue, Aug 28, 2007, Dirk Moolman wrote:
>>>>>Just a question - how do I make a network setting, like the eth0:1
>>>that
>>>>>I created below, permanent ? .... so that it stays when I reboot the
>>>>>server
>>>
>>>>The SuSE way to do this is ``yast2 lan'', edit the interface, go
>>>>to the Advanced tab, and create an alias.
>>>
>>>On one of my existing servers (installed by someone else before my
>>>time), there are interfaces eth0, and also eth0:1 - the latter is
>not
>>>defined as an alias.
>
>
>>If it's a SuSE system newer than 9.0 Pro any eth0:x interface has
>>been created manually, not with yast2.
>>
>>The applicable scripts are under /etc/sysconfig/network with
>>names related to the Mac address(es) of the NICs. Aliases appear
>>in these files as lines like this for the alias guardian.
>>
>>IPADDR_guardian='192.136.111.16'
>>NETMASK_guardian='255.255.255.0'
>
>
>On my system, this is how the aliases get added. I added the alias in
>yast, and then confirmed in /etc/sysconfig/network that the alias was
>added to the ifcfg_<mac_address> file.
>
>I can manually remove it there, and then it also gets removed in yast.
>
>The aliases just don't show in the ifconfig output, which could cause
>trouble for me in future. I find it better (for myself) to keep things
>as simple as possible. If I can find a way to let it show in ifconfig,
>then I've made my life easier for future troubleshooting.
The command that shows the IP address assignments is ``ip addr list'' or
``ip addr list dev ethN''. On my mail server these return:
# ip addr list
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:15:f2:d9:70:7b brd ff:ff:ff:ff:ff:ff
inet 192.168.253.33/24 brd 192.168.253.255 scope global eth1
inet6 fe80::215:f2ff:fed9:707b/64 scope link
valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
link/ether 00:15:f2:d9:78:59 brd ff:ff:ff:ff:ff:ff
4: sit0: <NOARP> mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0
# ip addr list dev eth1
2: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:15:f2:d9:70:7b brd ff:ff:ff:ff:ff:ff
inet 192.168.253.33/24 brd 192.168.253.255 scope global eth1
inet6 fe80::215:f2ff:fed9:707b/64 scope link
valid_lft forever preferred_lft forever
And a more interesting one from one of our multi-homed public servers (SuSE
Linux Enterprise 9 SP2):
# ip addr list dev eth2
4: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:60:08:3e:91:87 brd ff:ff:ff:ff:ff:ff
inet 192.136.111.56/24 brd 192.136.111.255 scope global eth2
inet 192.136.111.16/24 brd 192.136.111.255 scope global secondary eth2
inet 192.136.111.42/24 brd 192.136.111.255 scope global secondary eth2
inet 192.136.111.10/24 brd 192.136.111.255 scope global secondary eth2
inet 192.136.111.45/24 brd 192.136.111.255 scope global secondary eth2
inet6 fe80::260:8ff:fe3e:9187/64 scope link
valid_lft forever preferred_lft forever
Bill
--
INTERNET: bill at celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
Government's view of the economy could be summed up in a few short phrases:
If it moves, tax it. If it keeps moving, regulate it. And if it stops
moving, subsidize it -- Ronald Reagan
More information about the Linux-users
mailing list