Operating System - Linux
1753677 Members
5480 Online
108799 Solutions
New Discussion юеВ

Re: Getting different broadcast ip

 
monu_1
Regular Advisor

Getting different broadcast ip

Hi All,

When i config eth port, it's getting different broadcast ip. Pl see below output-

# ifconfig eth1 10.232.168.111 netmask 255.255.255.0 up

eth1 Link encap:Ethernet HWaddr 00:04:5A:46:99:51
inet addr:10.232.168.111 Bcast:10.255.255.255 Mask:255.255.255.0
inet6 addr: fe80::204:5aff:fe46:9951/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:31 dropped:0 overruns:0 carrier:62
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:11 Base address:0x8000

Broadcast ip should be 10.232.168.255

kernel version is 2.6.10

Please comment on this.


Thanks,
-MKS
3 REPLIES 3
Johnson Punniyalingam
Honored Contributor

Re: Getting different broadcast ip

Hi ,

Please edit this file add entry for your broadcast ip

vi /etc/sysconfig/network-scripts/ifcfg-eth1

Example:-
==========
DEVICE=eth1
BOOTPROTO=none
BROADCAST=10.8.48.255 --> you can change Broadcast ip address
HWADDR=00:09:6B:B5:36:DA
IPADDR=10.232.168.111
NETMASK=255.255.255.0
NETWORK=10.8.4.0
ONBOOT=yes
GATEWAY=10.232.168.0
TYPE=Ethernet

after that stop and start "

/etc/rc.d/init.d/network restart

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Ivan Ferreira
Honored Contributor

Re: Getting different broadcast ip

I just tested on a Linux kernel 2.6.18-92.el5.

# ifconfig eth0:1 10.232.168.111 netmask 255.255.255.0 up
# ifconfig eth0:1
eth0:1 Link encap:Ethernet HWaddr 00:0C:29:8A:24:2A
inet addr:10.232.168.111 Bcast:10.232.168.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:177 Base address:0x1400

The result is correct.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Fredrik.eriksson
Valued Contributor

Re: Getting different broadcast ip

# ifconfig eth1 10.232.168.111 netmask 255.255.255.0 broadcast 10.232.168.255

This will do the job, but if you want it to stick after next reboot i'd suggest the above method :)

ps. the "up" at the end is not needed when you're setting an address, the interface will be automagically up'd when you set an IP ds.

Best regards
Fredrik Eriksson