ip: Transmitted UDP packets: | 0 |
10.49 subnet
10.49.1Syntax
subnet
subnet add <name> <i/f> <IP address> <mask> subnet delete <name>
subnet flush
10.49.2Description
Lists defined subnets; defines a subnet; deletes a subnet definition; or deletes all subnet definitions.
•<name> is a label, that can be specified by subnet add and later used by subnet delete to delete the subnet.
•<i/f> is not used, but is present for historical reasons and must be specified as either “.” or a valid interface name.
•<IP address> is the IP address of the subnet being defined (only those bits of <dest> corresponding to bits set in <mask> are relevant).
•<mask> is the subnet mask of the subnet being defined, specified as four hexadecimal numbers separated by colons.
A subnet is defined automatically for each interface, with a name formed by appending .home to the device name.
The only significant use for the subnet command is to change the masks for these automatic subnets, if the default masks (see the command device on page 162) are not correct. (Subnet definitions for other subnets can also be useful in conjunction with RIP version 1, which does not communicate subnet masks, but this is not very common.)
Configuration saving saves this information.
10.49.3Example
mymachine> ip device |
|
|
| |
# | type | dev file |
| IP address |
device ether | ether | //edd | mtu 1500 | 192.168.2.1 |
device flane | ether | //lec1 | mtu 1500 | 192.168.55.1 |
mymachine> ip subnet |
|
|
|
subnet flane.home | . 192.168.55.0 | ff:ff:ff:00 flane | |
subnet ether.home | . 192.168.2.0 | ff:ff:ff:00 ether | |
mymachine> | ip subnet add flane.home . 192.168.55.1 ff:ff:fc:0 | ||
mymachine> | ip subnet |
|
|
subnet flane.home | . 192.168.52.0 | ff:ff:fc:00 flane |