49
Static IP Configuration
Linux configuration
Use the following procedure if you are running Linux.
Step 1
Record your current settings
Use “netstat -ni”, “netstat -nr” and “ifconfig” to determine the
interfaces, routing and addresses.
First, you should find the available interfaces:
# netstat -ni
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 521478 0 0 0 626019 0 0 0 BRU
lo 16192 0 92498 0 0 0 92498 0 0 0 LRU
#
In this example, there are two interfaces, the loopback (
lo
) and the
ethernet (
eth0
). The ethernet (
eth0
) is the one to use.
Second, look up the default route:
# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
255.255.255.255 0.0.0.0 255.255.255.255 UH 40 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 40 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 40 0 0 eth0
#
The default route (destination 0.0.0.0) towards the IP 192.168.1.1 is
the “gateway.” The other entries are a forced broadcast out the
device
eth0
(destination 255.255.255.255) and a “connected”
network (destination 192.168.1.0).
Finally, obtain the IP address for
eth0
:
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:50:C2:08:50:01
inet addr:192.168.1.5 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:523211 errors:0 dropped:0 overruns:0 frame:0
TX packets:627431 errors:0 dropped:0 overruns:0 carrier:0
collisions:3561 txqueuelen:100
Interrupt:10 Base address:0xe800
#
In this example, the address (
inet addr
) is 192.168.1.5 and the
netmask is 255.255.255.0 (
Mask
).
Step 2
Set your IP address to 172.30.192.2 and your default gateway to
172.30.192.1
First make sure you have “root” access:
% su
Password: <root password>
#
Then run
ifconfig
to set the new IP address. Do not do this
remotely, as you may lose network access to the machine:
# ifconfig eth0 172.30.192.2 netmask 255.255.255.0
Содержание Pivio
Страница 6: ...vi Table of Contents...
Страница 15: ...15 Getting Started...
Страница 19: ...19 Getting Started...
Страница 20: ...20 Pivio User s Guide...