Configuring multiple FastEthernet interfaces using GNS3 - cisco

I'm doing a lab for my internetworking course and I'm using GNS3 as the emulator. I can configure single FastEthernet interfaces on each router but I need to have two per router. I am using the c7200 image and router.
This is my attempt to configure the router.
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface f0/0
Router(config-if)#ip address 172.16.1.1 255.255.255.192
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface f0/1
^
% Invalid input detected at '^' marker.
Router(config)#
Every time I try to do the f0/1 interface I get the invalid input detected message.
WHY?!!?
Any help would be appreciated, thanks :-)

It seems the interface FastEthernet0/1 does not exist ?
Use the command Router#show ip interface brief, to verify that the interface exists.
If it doesn't exist, in GNS3 you can add additional interfaces through the configure option menu of the router(slots tab).

i had the same problem.
right click on router, click on configure, go to slots, click on slot 0, choose the second on (2FE).
apply, and ok, now u have 2 FastEthernet interfaces.

Related

tftp config for autoconfiguration of 2 different switches

I currently have a Cisco switch (CBS-350) which is autoconfigured with isc-dhcp-server and atftpd on Ubuntu 18.04.
This is the dhcpd config:
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1;
range 192.168.0.100 192.168.0.120;
option tftp-server-name "192.168.0.1";
option bootfile-name "config/cisco-switch1.cfg"; }
I would like to have another different switch model on the same subnet that I would like also to be autoconfigured. Any idea on how I can achieve this?
Both switches will not be running at the same time. I just would like to have each switches take the good autoconfig file.
Thanks for your help
Typically you would autoconfig enough of a device configlet to allow it to be manageable - VLANs, SNMP, username/password, routing, etc. You may not need to push a full config. Then the 'template' of this baseline config could be used for multiple devices, especially if DHCP allocated IPs are an option.
THEN you would use some 2nd stage configuration management system to push the remaining, device-specific parts.
Otherwise you have to start doing some distinguishing identifiers (eg. MAC address or serial number) and use that to map a device to a waiting config on the file server.
I've found that using a SubClass might be an option:
subclass "Vendor-Class" "CiscoPnP" {
option bootfile-name "config/cisco-switch1.cfg";
}
Unfortunately, both switches have the same Vendor-Class (CiscoPnP) so I cannot use this to distinguished them.

How to assign an external ip to linux server at gcloud?

Last several days I'm struggling with a problem.
I have two instances(ubuntu server) on gcloud and I want to assign them their external IP.
And I can ping and ssh to my instances but when I try to do telnet it is not performed.
On gcloud all instances have one internal ip and one external IP.
And they does not know their ip. I get it from gcloud console.
How could I assign it to them?
Also I've tried sudo ifconfig eth0:0 130.211.95.1 up
You can do something like this to add the external IP to a local interface:
ip addr add 130.211.95.1/32 dev eth0 label eth0:shortlabel
Replace 'add' with 'del' to remove it once you are done with it.
shortlabel can be any string up to a certain (short) length.
Update: also see this GCE support issue for related information.
A feature request for this is already filed on GCE public issue tracker, however it is not yet implemented. You can star it to get notification if any update posted on the thread.
May you also mention what's your use case? so I can probably provide you with a workaround.

Ryu: convert datapath to switch IP address

Currently, I'm writing an application on top of Ryu, the Open-source OpenFlow Controller.
To create an OF-Config connection (or OVSDB connection), I think I have to get the IP address of each switch connected to the Ryu controller. However, I cannot find the API that converts the Datapath object or datapath id to the IP address of the switch.
So, if there is such an API, I want to know about it. If not, I'm looking forward to receiving some comments about the way to make the connections without the IP addresses.
#set_ev_cls(event.EventSwitchEnter)
def switch_features_handler(self, ev):
address = ev.switch.dp.address
dpid = ev.switch.dp.id
"address" is a tuple of (ip_address, port) and "dpid" is the datapath id.
Byungjoon are you using mininet?
If you are, all the switches are instantiated with the localhost ip address (This is mininet's default behavior). The controller distinguishes between switches using the tcp port.
As far as I know, you only need to know the dpid of the switch in order to send OF messages. This is what the sample l2-learning switch is doing: https://github.com/osrg/ryu/blob/master/ryu/app/simple_switch_13.py
I am also try to communicate with the switches using Ryu controller. I am using the above sample as my basic code and adding on top of it. It is not done yet (so you might see some bugs) but it's good starting point. Here is the link: https://github.com/Ehsan70/RyuApps/blob/master/l2.py
for latest version of ryu, you should use following code.
#set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
def _switch_features_handler(self, ev):
print(ev.msg.datapath.address)

How do I use puppet to configure network settings?

I have written a module that will configure network settings on my system but I can't apply the manifest because before a manifest is applied it does "facter ipaddress" to find and present global facts.
Does it mean that in order to apply puppet manifest we must have IP configured ?
So I have a system that has no IP address configured and i want to use puppet to configure that IP address for me, for that I am asking user to input IP address which i save in a .csv file, then I am using a template to configure if-eth0 file. Template will do extlookup to fill up the fields in template and template is finally called upon inside a manifest. So the problem is that before anything is applied by puppet, it fails to run with following error
facter ip address unable to resolve IP , reason anonymous
I am not sure about the actual question (if IP is indeed needed). However, if I understand correctly you can try one of the two workarounds:
Enable DHCP
This way when your system boots will take a little bit more time (assuming there is no DHCP service on the network). A timeout will occur which, in most of the cases, results in a default IP (169.254.Y.Z if I remember). In this case you may need to stop/kill the dhcp client process before applying static IP or restart the interface to get the new configuration.
Assign default static IP
If you know that puppet configuration will be applied no matter what (maybe a call in rc.local?), you can configure your interface with a static IP (ie 10.1.1.10) to avoid the error message. This is temporary since once puppet runs, the correct configuration will be applied.
Hope it helps,
Andreas

CentOS server: how to detect network status changes

I have setup a CentOS 6.4 server (minimal install) which is connected to network through an ethernet cable. The problem is that when the network link goes down, the status changes are not automatically detected but if i type "ifconfig" the interface still keeps its IP address (which is assigned by a DHCP server). After some time that the link is down the interface loses the address but when the link comes up again the network connection is not automatically restored like it would happen in a desktop computer. Even the command "dhclient eth0" does not always work to restore things, and I have to restart the whole network service with "/ect/init.d/network restart".
Is there any way to automatically detect network status changes like it happens in desktop installations? I'm thinking about a cron script that every 5 minutes pings a server outside my network and if it doesn't get any response it restarts network service, but this does not sound very efficient... is there another way?
EDIT: I realized I have not explained the situation correctly. My network topology is: server --> switch --> router --> external network (the router is another centos server with DHCPD).
For some reasons (that i'm not getting), when it happens that the router goes down and reboots, the other server becomes unreachable, and I have to manually restart network service on it. So the link does not effectively go down (the switch keeps it up), but the status change is at IP level.
You can check if you have NetworkManager enabled, I usually don't use it in the servers but it can help you in this case because it will monitor automatically the connections (it is quite common in desktop installations).
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-NetworkManager.html
To look for messages indicating an issue with the NIC just check the kernel ring buffer using the dmesg command.
For example when the cable is disconnected from a given interface this is what I get:
igb: eth1 NIC Link is Down
The first word will depend on the name of your network driver.
You could also configure the system to log these messages also to /var/log/messages (by default I am not sure if they appear there). Then it would be just a matter of monitoring the log, look for similar messages and restart the network service.
In any case the NetworkManager, if it is not already enabled, it should be an easier solution.
There is a module called miimon for monitoring the network interface's status. ethtool will give you the link status.
$ethtool eth0
...
Link detected: yes

Resources