ip andnginx gateway 真实ipnot in net怎么办

1.3. Changing IP Addresses and Routes
1.3. Changing IP Addresses and Routes
This section introduces
With the knowledge of
ifconfig and route output
it's a small step to
learn how to change IP configuration with these same tools.
1.3.1. Changing the IP on a machine
For a practical example, let's say that the branch office server,
morgan, needs to visit the main office for some hardware maintenance.
Since the services on the machine are not in use, it's a convenient
time to fetch some software updates, after configuring the machine to
join the LAN.
Once the machine is booted and connected to the Ethernet, it's
ready for IP reconfiguration.
In order to join an
IP network, the following information is required.
Refer to the
to gather the required information below.
An unused IP address (Use 192.168.99.14.)
netmask (What's your guess?)
IP address of the default gateway (What's your
network address
(What's your guess?)
The IP address of a name resolver. (Use the IP
of the default gateway here
Example 1.5. ifconfig and route
output before the change
[root@morgan]# ifconfig eth0
Link encap:Ethernet
HWaddr 00:80:C8:F8:4A:53
inet addr:192.168.98.82
Bcast:192.168.98.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b)
TX bytes:0 (0.0 b)
Interrupt:9 Base address:0x5000
[root@morgan]# route -n
Kernel IP routing table
Destination
Flags Metric Ref
192.168.98.0
255.255.255.0
192.168.98.254
The process of readdressing for the new network involves three steps.
It is clear in
, that morgan is configured
for a different network than the main office desktop network.
First, the
, and finally
If the networking configuration is correct and the
process is successful, the machine should be able to connect to local
and non-local destinations.
Example 1.6. Bringing down a network interface with
[root@morgan]# ifconfig eth0 down
This is a fast way to stop networking on a single-homed machine such
as a server or workstation.
On multi-homed hosts, other
interfaces on the machine would
be unaffected by this command.
This method of bringing down an
interface has some serious side effects, which should be understood.
Here is a summary of the side effects of bringing down an interface.
Side effects of bringing down an interface with
all IP addresses on the specified interface are deactivated
and removed
any connections established to or from IPs on the specified
interface are broken
all routes to any destinations through the specified interface
are removed from the routing tables
the link layer device is deactivated
The next step, bringing up the interface, requires the new
networking configuration information.
It's a good habit to check the
interface after configuration to verify settings.
Example 1.7. Bringing up an Ethernet interface with ifconfig
[root@morgan]# ifconfig eth0 192.168.99.14 netmask 255.255.255.0 up
[root@morgan]# ifconfig eth0
Link encap:Ethernet
HWaddr 00:80:C8:F8:4A:53
inet addr:192.168.99.14
Bcast:192.168.99.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b)
TX bytes:0 (0.0 b)
Interrupt:9 Base address:0x5000
The second call to ifconfig allows verification of
the IP addressing information.
The currently configured IP address on
eth0 is 192.168.99.14.
Bringing up an interface also has a small set
of side effects.
Side effects of bringing up an interface
the link layer device is activated
the requested IP address is assigned to the specified interface
all local, network, and broadcast routes implied by the
IP configuration are added to the routing tables
verify the reachability of other locally connected hosts or skip
directly to setting the default gateway.
1.3.2. Setting the Default Route
It should come as no surprise to a close reader
that the default route was removed at the execution of
ifconfig eth0 down.
The crucial final step is
configuring the default route.
Example 1.8. Adding a default route with route
[root@morgan]# route -n
Kernel IP routing table
Destination
Flags Metric Ref
192.168.99.0
255.255.255.0
[root@morgan]# route add default gw 192.168.99.254
[root@morgan]# route -n
Kernel IP routing table
Destination
Flags Metric Ref
192.168.99.0
255.255.255.0
192.168.99.254
The routing table on morgan should look exactly like the initial
routing table on tristan.
Compare the routing tables in
These changes to the routing table on morgan will stay in effect
until they are manually changed, the network is restarted, or the
machine reboots.
With knowledge of the addressing scheme of a
network, and the use of
simple to readdress a machine on just about any Ethernet you can
attach to.
The benefits of familiarity with these commands extend to
non-Ethernet IP networks as well, because these commands operate on the
IP layer, independent of the link layer.
1.3.3. Adding and removing a static route
Now that morgan has joined the LAN at the main office and can
reach the Internet, a static route to the branch office would be
convenient for accessing resources on that network.
A static route is any route entered into a routing table
which specifies at least a destination address and a gateway or device.
Static routes are special instructions regarding the
path a packet should take to reach a destination and
usually used to specify reachability of a destination through a router
other than the default gateway.
As we saw above, in , a static route
provides a specific route to a known destination.
There are several
pieces of information we need to know in order to be able to add a
static route.
the address of the destination (192.168.98.0)
the netmask of the destination (255.255.255.0)
EITHER the IP address of the router through which the
destination (192.168.99.1) is reachable
OR the name of the link layer device to which the
destination is directly connected
Example 1.9. Adding a static route with route
[root@morgan]# route -n
Kernel IP routing table
Destination
Flags Metric Ref
192.168.99.0
255.255.255.0
192.168.99.254
[root@morgan]# route add -net 192.168.98.0 netmask 255.255.255.0 gw 192.168.99.1
[root@morgan]# route -n
Kernel IP routing table
Destination
Flags Metric Ref
192.168.99.0
255.255.255.0
192.168.98.0
192.168.99.1
255.255.255.0
192.168.99.254
shows how to add a static
route to the 192.168.98.0/24 network.
In order to test the reachability of the remote network,
ping any machine on the 192.168.98.0/24 network.
Routers are
usually a good choice, since they rarely have packet
filters and are usually alive.
Because a more specific route is always chosen over a less specific
route, it is even possible to support host routes.
These are routes
for destinations which are single IP addresses.
This can be
accomplished with a manually added static route as below.
Example 1.10. Removing a static network route and adding a static host
[root@morgan]# route del -net 192.168.98.0 netmask 255.255.255.0 gw 192.168.99.1
[root@morgan]# route add -net 192.168.98.42 netmask 255.255.255.255 gw 192.168.99.1
[root@morgan]# route add -host 192.168.98.42 gw 192.168.99.1
SIOCADDRT: File exists
[root@morgan]# route -n
Kernel IP routing table
Destination
Flags Metric Ref
192.168.99.0
255.255.255.0
192.168.98.42
192.168.99.1
255.255.255.255 UGH
192.168.99.254
This should serve as an illustration that there is no difference to
the kernel in selecting a route between a host route and a network
route with a host netmask.
If this is a surprise or is at all
confusing, review the use of netmasks in IP networking.
Some collected links on general IP networking are available inCCNA 1 v5.0 Routing and Switching
CCNA 1 Chapter 2 v5 Exam Answers 2016
CCNA 1 Chapter 2 v5 Exam Answers 2016
Refer to the exhibit. A switch was configured as shown. A ping to the default gateway was issued, but the ping was not successful. Other switches in the same network can ping this gateway. What is a possible reason for this?
The default gateway address must be 192.168.10.1.
The ip default-gateway command has to be issued in the VLAN interface configuration mode.
The VLAN IP address and the default gateway IP address are not in the same network.
The no shutdown command was not issued for VLAN 1.
The local DNS server is not functioning correctly.
While trying to solve a network issue, a technician made multiple changes to the current router configuration file. The changes did not solve the problem and were not saved. What action can the technician take to discard the changes and work with the file in NVRAM?
Issue the reload command without saving the running configuration.
Close and reopen the terminal emulation software.
Delete the vlan.dat file and reboot the device.
Issue the copy startup-config running-config command.
Why is it important to configure a hostname on a device?
to allow local access to the device through the console port
a Cisco router or switch only begins to operate when its hostname is set
to identify the device during remote access (SSH or telnet)
a hostname must be configured before any other parameters
Which procedure is used to access a Cisco 2960 switch when performing an initial configuration in a secure environment?
Use the console port to locally access the switch from a serial or USB interface of the PC.
Use Secure Shell to remotely access the switch through the network.
Use Telnet to remotely access the switch through the network.
Use the AUX port to locally access the switch from a serial or USB interface of the PC.
What criterion must be followed in the design of an IPv4 addressing scheme for end devices?
Each local host should be assigned an IP address with a unique network component.
Each IP address must match the address that is assigned to the host by DNS.
Each IP address must be unique within the local network.
Each IP address needs to be compatible with the MAC address.
A network administrator needs to keep the user ID, password, and session contents private when establishing remote CLI connectivity with a switch to manage it. Which access method should be chosen?
Which interface allows remote management of a Layer 2 switch?
the switch virtual interface
the console port interface
the AUX interface
the first Ethernet port interface
What is a result of using the service password-encryption command on a Cisco network device?
All passwords in the configuration are not shown in clear text when viewing the configuration.
The command encrypts the banner message.
The command encrypts the enable mode password.
A network administrator who later logs into the device will be required to enter an administrator password in order to gain access to the Cisco device.
Match the difinitions to their respective CLI hot keys and shortcuts.
Tab -& Completes abbreviated commands and parameters
Ctrl-R -& returns directly to the privileged EXEC mode
Up Arrow -& scrolls backwards through previously entered commands
Ctrl-Z -& cancels any command currently being entered and returns directly to privileged EXEC mode
Ctrl-C -& Redisplays, on a new line, the command currently being typed
A network administrator is planning an IOS upgrade on several of the head office routers and switches. Which three questions must be answered before continuing with the IOS selection and upgrade? (Choose three.)
What models of routers and switches require upgrades?
Do the routers and switches have enough RAM and flash memory for the proposed IOS versions?
What ports are installed on the routers and switches?
Are the devices on the same LAN?
What features are required for the devices?
Do the devices have enough NVRAM to store the IOS image?
11. What benefit does DHCP provide to a network?
Hosts can connect to the network and get an IP address without manual configuration.
Duplicate addresses cannot occur on a network that issues dynamic addresses using DHCP and has static assignments.
DHCP allows users to refer to locations by a name rather than an IP address.
Hosts always have the same IP address and are therefore always reachable.
Which two functions are provided to users by the context-sensitive help feature of the Cisco IOS CLI? (Choose two.)
providing an error message when a wrong command is submitted
allowing the user to complete the remainder of an abbreviated command with the TAB key
displaying a list of all available commands within the current mode
selecting the best command to accomplish a task
determining which option, keyword, or argument is available for the entered command
A router has a valid operating system and a configuration stored in NVRAM. When the router boots up, which mode will display?
global configuration mode
user EXEC mode
setup mode
ROM monitor mode
Which two features are characteristics of flash memory? (Choose two.)
Flash receives a copy of the IOS from RAM when a device is powered on.
Flash provides nonvolatile storage.
The contents of flash may be overwritten.
Flash is a component in Cisco switches but not in Cisco routers.
The contents of flash may be lost during a power cycle.
Passwords can be used to restrict access to all or parts of the Cisco IOS. Select the modes and interfaces that can be protected with passwords. (Choose three.)
boot IOS mode
Ethernet interface
privileged EXEC mode
VTY interface
console interface
router configuration mode
Why would a Layer 2 switch need an IP address?
to enable the switch to send broadcast frames to attached PCs
to enable the switch to function as a default gateway
to enable the switch to receive frames from attached PCs
to enable the switch to be managed remotely
What is a user trying to determine when issuing a ping 10.1.1.1 command on a PC?
if there is connectivity with the destination device
what type of device is at the destination
if the TCP/IP stack is functioning on the PC without putting traffic on the wire
the path that traffic will take to reach the destination
What command can be used on a Windows PC to see the IP configuration of that computer?
show interfaces
show ip interface brief
Which statement is true about the running configuration file in a Cisco IOS device?
It should be deleted using the erase running-config command.
It is automatically saved when the router reboots.
It affects the operation of the device immediately when modified.
It is stored in NVRAM.
Match the description to the common IOS CLI access method.
Console port
It displays startup, debugging, and error messages by default.
It can be used to restore an out-of-box configuration on a switch or router.
Virtual interface
It allows access throught use of Telnet or SSH protocols.
It requires an active network connection.
It connects throught dialup connections
It is not supported on Catalyst switch devices
Which two characters are allowed as part of the hostname of a Cisco device? (Choose two.)
question mark
22. The shortcuts with their functions are as follows:
Tab –& Completes the remainder of a partially typed command or keyword
Space bar –& displays the next screen
? –& provides context-sensitive help
Up Arrow –& Allows user to scroll backward through former commands
Ctrl-C –& cancels any command currently being entered and returns directly to privileged EXEC mode
Ctrl-Shift-6 –& Allows the user to interrupt an IOS process such as ping or traceroute
23. A new network administrator has been asked to enter a banner message on a Cisco device. What is the fastest way a network administrator could test whether the banner is properly configured?
Exit privileged EXEC mode and press Enter. *TRUE*
Exit global configuration mode.
Enter CTRL-Z at the privileged mode prompt.
Reboot the device.
Power cycle the device.
24.Which two characters are allowed as part of the hostname of a Cisco device? (Choose two.)
question mark
UPDATE WITH QUESTIONS CCNA v5.1
25. What is the function of the kernel of an operating software?
It provides a user interface that allows users to request a specific task.
The kernel links the hardware drivers with the underlying electronics of a computer.
It is an application that allows the initial configuration of a Cisco device.
The kernel provisions hardware resources to meet software requirements.*
26. Which command or key combination allows a user to return to the previous level in the command hierarchy?
27. A router has a valid operating system and a configuration file stored in NVRAM. The configuration file contains an enable secret password but no console password. When the router boots up, which mode will display?
global configuration mode
setup mode
privileged EXEC mode
user EXEC mode*
28. Which information does the show startup-config command display?
the IOS image copied into RAM
the bootstrap program in the ROM
the contents of the current running configuration file in the RAM
the contents of the saved configuration file in the NVRAM*
29. Which two host names follow the guidelines for naming conventions on Cisco IOS devices? (Choose two.)
RM-3-Switch-2A4*
HO Floor 17
SwBranch799*
30. How does the service password-encryption command enhance password security on Cisco routers and switches?
It encrypts passwords as they are sent across the network.
It encrypts passwords that are stored in router or switch configuration files.*
It requires that a user type encrypted passwords to gain console access to a router or switch.
It requires encrypted passwords to be used when connecting remotely to a router or switch with Telnet.
31. Refer to the exhibit.
A network administrator is configuring the MOTD on switch SW1. What is the purpose of this command?
to display a message when a user accesses the switch*
to configure switch SW1 so that only the users in the Admin group can telnet into SW1
to force users of the Admin group to enter a password for authentication
to configure switch SW1 so that the message will display when a user enters the enable command
32. What are two characteristics of RAM on a Cisco device? (Choose two.)
RAM provides nonvolatile storage.
The configuration that is actively running on the device is stored in RAM.*
The contents of RAM are lost during a power cycle.*
RAM is a component in Cisco switches but not in Cisco routers.
RAM is able to store multiple versions of IOS and configuration files.
33. Which interface is the default SVI on a Cisco switch?
FastEthernet 0/1
GigabitEthernet 0/1
34. A technician is adding a new PC to a LAN. After unpacking the components and making all the connections, the technician starts the PC. After the OS loads, the technician opens a browser, and verifies that the PC can reach the Internet. Why was the PC able to connect to the network with no additional configuration?
The PC does not require any additional information to function on the network.
The PC came preconfigured with IP addressing information from the factory.
The PC was preconfigured to use DHCP.*
The PC used DNS to automatically receive IP addressing information from a server.
The PC virtual interface is compatible with any network.
35. Refer to the exhibit.
A network technician is testing connectivity in a new network. Based on the test results shown in the exhibit, which device does the technician have connectivity with and which device does the technician not have connectivity with? (Choose two.)
connectivity: switch 2*
connectivity: PC-D
connectivity: PC-B
no connectivity: switch 1
no connectivity: switch 2
no connectivity: PC-C*
36. Refer to the exhibit.
What three facts can be determined from the viewable output of the show ip interface brief command? (Choose three.)
Two physical interfaces have been configured.
The switch can be remotely managed.*
One device is attached to a physical interface.*
Passwords have been configured on the switch.
Two devices are attached to the switch.
The default SVI has been configured.*
37. An administrator is configuring a switch console port with a password. In what order will the administrator travel through the IOS modes of operation in order to reach the mode in which the configuration commands will be entered? (Not all options are used.)
38. Match the definitions to their respective CLI hot keys and shortcuts. (Not all options are used.)

我要回帖

更多关于 ip default gateway 的文章

 

随机推荐