Bold Text Hypertext Context ---------------------------------------------------------------------------- Note 185.0 ifconfig/netmask/broadcast/subnets 4 replies ANNECY::LEHY "Contre les virus, prenez un ´VAX I" 14 lines 23-SEP-1991 13:11 -------------------------------------------------------------------------------- Can you please explain the role of the ifconfig command. /etc/ifconfig interface address netmask xxx broadcast yyy When is the netmask used, how it is used, when is the broadcast used, how does they relate to network classes (A, B...). What happens if I set a bad netmask or broadcast. Can you give examples. Thanks for your help. Thanks Christophe. ================================================================================ Note 185.1 ifconfig/netmask/broadcast/subnets 1 of 4 BILLW::karen "Okay, okay! I'm rowing faster!" 20 lines 25-SEP-1991 20:52 -< The manual would be a better resource, probably >- -------------------------------------------------------------------------------- If you have a CB radio, then the channel you select to broadcast on would be your broadcast mask. If everyone else expects you to be on channel 15 but you're on channel 17, you won't hear them no matter how much they "broadcast" messages for you. If you want to communicate with other hosts on your network, you must have matching broadcast masks, you must agree on which channels you would find each other. Otherwise... The netmask determines which portion of your host number is to be used for subneting if you're subneting. Subneting is like making a mini-network on your network. So out of your designated host number, you on your mini-network would have to agree on which part will be used as "channel 17" and which part will be used as your host number - aka host number. For more detailed information and examples, please check the ULTRIX "Networking and Distributed System Services" in the "System and Network Managing Volume 4" manual. It is part of the standard doc set. _karen ================================================================================ Note 185.2 ifconfig/netmask/broadcast/subnets 2 of 4 ANNECY::LEHY "Contre les virus, prenez un ´VAX I" 13 lines 26-SEP-1991 16:35 -< thanks >- -------------------------------------------------------------------------------- If I understand well, if I am on a node connected to multiple subnets, I will have to make as much broadcast operations as there are subnets in order to send a message to all the nodes connected to all the subnets. I will select a subnet by specifying the broadcast address (mask ?) for that subnet as a "destination address". The broacast mask for a subnet if the one specified in the corresponding ifconfig command. Right ? However, I will look for the doc. Thanks. ================================================================================ Note 185.3 ifconfig/netmask/broadcast/subnets 3 of 4 BILLW::karen "Okay, okay! I'm rowing faster!" 14 lines 26-SEP-1991 19:22 -------------------------------------------------------------------------------- Subneting could be a pain in the neck. Unless you have a large network, you shouldn't have to do subneting. (If you have mutiple subnets, then you have to set up designated routers... and it quickly becomes a pain in the behind, at least to me. ) In the absence of subneting all you have to do, is make sure everyone on your network has the same broadcast and the same netmask. But yes, the broadcast mask for the subnet you belong to would be reflected in that ifconfig line. The netmask reflects which bits of your host number are interpreted as your subnet number. So with subneting, your field1.field2.field3.field4 is broken down into network number, subnet number and host number. Exactly how they are broken down depends on your network class, your broadcast mask and your netmask. karen ================================================================================ Note 185.4 ifconfig/netmask/broadcast/subnets 4 of 4 ANNECY::LEHY "Contre les virus, prenez un ´VAX I" 27 lines 14-OCT-1991 18:25 -< a bug ? >- -------------------------------------------------------------------------------- I have done the following experiment -----x----------x---------------x-------x------ | | | | ----------------- -------------- | netX netY | | netX netY | | | | | | | | | | Node A | | Node B | ----------------- -------------- A sofware running on node A and node B broadcasts udps onto netX and netY (two separate internet networks) The software uses socket, bind, setsockopt (for broadcasting) and sendto(). To send a broadcast onto interface associated with netX, the destination address in the sendto call is the broadcast mask specified in the ifconfig f for that interface. The software uses recvfrom to listen at broadcasts and read the internet address of the sender of each broadcast. When I disconnect node A 's interface with netX, the program on node A still receive broadcasted udp from netX on node B. Isn't it a bug ? ================================================================================ Add a network route for a specific INTERFACE route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4 route add net 172.28.1.0 netmask 255.255.255.0 gw 9a (or what ever interface we want it to go out) ================================================================================