Linux with Operating System Concepts



Download 5,65 Mb.
Pdf ko'rish
bet190/254
Sana22.07.2022
Hajmi5,65 Mb.
#840170
1   ...   186   187   188   189   190   191   192   193   ...   254
Bog'liq
Linux-with-Operating-System-Concepts-Fox-Richard-CRC-Press-2014

object
{
command
}
*
A tunnel is a network connection between two devices, for example, two computers communicating by ssh. What distin-
guishes a tunnel from an ordinary connection is that the tunnel is long term and the computers at both ends of the tun-
nel have two different IP addresses, their normal address, and one dedicated for the tunnel while it exists. Additionally, 
the tunnel can be used to encapsulate another protocol; for instance, within a normal TCP tunnel, we might use the SSH 
protocol to ensure encrypted communication.


508

Linux with Operating System Concepts
where 
object
is one of 
link

addr

addrlabel

route

rule

neigh

tunnel

maddr

mroute,
or 
monitor
. These are described below. The 
command
will vary 
depending on the object selected. Options are –V for version, -s for statistics, -r for 
resolve, -f for family that is followed by 
inet

inet6

ipx

dnet,
or 
link
, and –o to 
output on one line.
The object specified dictates just what ip will return or set.
• link—can have a command of 
set
or 
show
. For set, you are then required to specify 
the device such as lo or eth0. This should be followed by one of
• up/down
• arp on/off
• promisc on/off
• allmulticast on/off
• txqueuelen 
numpackets
• name/alias 
newname
• address/broadcast new_link_layer_address
• 
mtu 
MTUvalue
(maximum transmission unit)
• netps 
PID
• 
vf 
NUM
(virtual function device number)
• addr—can have commands of 
add

del

show
, and 
flush
to add or remove an IP 
address from the device, show the current IP address(es), or flush (remove) an address 
based on some specified criteria. With add, you can specify a new name for a device, a 
peer or broadcast address(es), label, or scope. The show command can be followed by 
one of dev 
name
, scope 
scope_val
, to 
addr
, label 
value
, dynamic, permanent, tentative, 
deprecated, primary, or secondary.
• addrlabel—to label an IPv6 address for later use, this object can be followed by one 
of 
add

del
, or 
list
.
• route—this object allows you to manipulate or inspect any of the routing tables. There 
are several types of routing tables maintained: 
unicast

unreachable

black-
hole

prohibit

local

broadcast

throw

nat

anycast
, and 
multicast

The command for route is one of 
add

change

replace

del
(delete), 
show

flush,
or 
get
. For add, change, and replace, you may follow this with the word 
to
and then both the type of table (e.g., 
unicast

nat
) and 
IP
or 
IPv6
. Alternate 
options for add, change, and replace are to specify a new preference number, a table 
ID, a new device name, a new src or via address, and a new mtu value among other 
values. The usage of the arguments for del differ somewhat from add, and show has 


Network Configuration

509
additional arguments available. The flush command flushes the given table(s) while 
the get command can be used to retrieve one specific value from a table. Here are a 
few examples of route commands.
• ip route add 10.11.12.0/24 dev eth0
• ip route add default via 10.11.12.13
• ip route add 10.11.1.2 via 10.11.30.1
• ip route add nat 192.51.185.16 via 10.11.12.1
• ip route change default via 10.11.30.6 dev eth0
ip route show cache
• rule—change the route selection algorithm so that the routing table used in a par-
ticular setting changes.
• neigh—
add

change

delete

replace
, or 
show
, where neighbors are objects 
specified as bindings between a protocol address and a link layer address.
• maddress—multicast address, commands are 
show

add
, and 
delete
.
• mroute—multicast-routing cache management, 
show
is the only command here.
• tunnel—
add

change
, and 
delete
a network tunnel.
• 
monitor
and 
rtmon
(state monitoring).
12.5.2 Other Network Commands
The ip instruction has replaced 
route
that previously let you view and manipulate the 
IP routing table. This table would contain the gateway address and the gateway’s router 
address along with netmasks for each interface device (excluding lo).
To view interface IP addresses, you can use 
ip addr
. Alternatively, the 
ifconfig
command will respond with the same information. The ifconfig statement, like ip, also 
allows you to configure your network interfaces. The command is followed by the interface 
in question (e.g., lo or eth0) and any options that you want to establish or the new address 
for that interface (if you omit the options/address, ifconfig responds with the already-
established address). The command will look like one of these:
ifconfig 

Download 5,65 Mb.

Do'stlaringiz bilan baham:
1   ...   186   187   188   189   190   191   192   193   ...   254




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish