7.26 setup-ip Command

Use the --setup-ip command to plumb a network interface on a KVM host.

Syntax

vm_maker --setup-ip ip_address --interface network_interface
  --netmask netmask --gateway gateway_address [ --vlan vlanid ]
vm_maker --setup-ip ip_address --discover
  --netmask netmask --gateway gateway_address [ --vlan vlanid ]

Options

  • ip_address: Specifies the IP address to plumb on the network interface.
  • --interface: Specifies the name of the network interface to plumb.
  • --discover: Instructs vm_maker to identify the network interface to plumb instead of specifying it by name.
  • --netmask: Specifies the IP netmask to plumb on the network interface.
  • --gateway: Specifies the IP network gateway address to plumb on the network interface.
  • --vlan: Optionally, specifies the VLAN ID to to plumb on the network interface.

Usage Notes

Use the --setup-ip command to plumb a network interface on a KVM host, which you can use for testing and troubleshooting purposes. Use the --cleanup-ip command to remove and clean up the network interface.

Example 7-2 Setting Up a Network Interface

The following shows an example of using the --setup-ip command plumb a network interface and use it to access the network gateway.

# ping 192.0.2.1
PING 192.0.2.1 (192.0.2.1) 56(84) bytes of data.
From 10.32.106.12 icmp_seq=1 Destination Host Unreachable
^C
--- 192.0.2.1 ping statistics ---
2 packets transmitted, 0 received, +1 errors, 100% packet loss, time 999ms
# /opt/exadata_ovm/vm_maker --setup-ip 192.0.2.6 --interface eth3 --netmask 255.255.255.128 --gateway 192.0.2.1 --vlan 144
[INFO] Interface eth3 currently down
[INFO] Bringing up interface eth3
[INFO] Interface eth3.144 is plumbed.
# ping 192.0.2.1 
PING 192.0.2.1 (192.0.2.1) 56(84) bytes of data.
64 bytes from 192.0.2.1: icmp_seq=2 ttl=255 time=0.317 ms
64 bytes from 192.0.2.1: icmp_seq=3 ttl=255 time=0.302 ms
64 bytes from 192.0.2.1: icmp_seq=4 ttl=255 time=0.307 ms
^C
--- 192.0.2.1 ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 3077ms
rtt min/avg/max/mdev = 0.302/0.308/0.317/0.021 ms
# ip rule 
0: from all lookup local 
32757: from 192.0.2.6 to 192.0.2.1 iif eth3.144 lookup main 
32758: from all to 10.32.96.5 lookup 220 
32759: from 10.32.96.5 lookup 220 
32760: from all to 10.32.106.0/23 lookup 210 
32761: from 10.32.106.0/23 lookup 210 
32762: from all to 192.168.0.4 lookup 181 
32763: from 192.168.0.4 lookup 181 
32764: from all to 192.168.0.3 lookup 180 
32765: from 192.168.0.3 lookup 180 
32766: from all lookup main 
32767: from all lookup default 
# ip a s | grep eth3
5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
67: eth3.144@eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
 inet 192.0.2.6/25 scope global eth3.144
# /opt/exadata_ovm/vm_maker --cleanup-ip eth3 --vlan 144
[INFO] Deleting routing rules.
[INFO] Flushing ip-address from interface.
# ip a s | grep eth3
5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000