-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure_cards
108 lines (82 loc) · 2.24 KB
/
configure_cards
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
For RHEL/CentOS/Fedora
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO=static
ONBOOT=yes
TYPE="Ethernet"
IPADDR=192.168.50.2
NAME="System eth0"
HWADDR=00:0C:29:28:FD:4C
GATEWAY=192.168.50.1
For Ubuntu/Debian/Linux Mint
file /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.50.2
netmask 255.255.255.0
gateway 192.168.50.1
sudo /etc/init.d/networking restart
How to Assign a IP Address to Specific Interface
sudo ip addr add 192.168.50.5 dev eth1
How to Check an IP Address
sudo ip addr show
How to Remove an IP Address
sudo ip addr del 192.168.50.5/24 dev eth1
How to Enable Network Interface
sudo ip link set eth1 up
How to Disable Network Interface
sudo ip link set eth1 down
How do I Check Route Table
sudo ip route show
How do I Add Static Route
sudo ip route add 10.10.20.0/24 via 192.168.50.100 dev eth0
How to Remove Static Route
sudo ip route del 10.10.20.0/24
-How do I Add Persistence Static Routes
For RHEL/CentOS/Fedora
vi /etc/sysconfig/network-scripts/route-eth0
10.10.20.0/24 via 192.168.50.100 dev eth0
For Ubuntu/Debian/Linux Mint
sudo vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.50.2
netmask 255.255.255.0
gateway 192.168.50.100
#########{Static Route}###########
up ip route add 10.10.20.0/24 via 192.168.50.100 dev eth0
sudo /etc/init.d/network restart
How do I Add Default Gateway
sudo ip route add default via 192.168.50.100
*
*
*
NETSTAT
List all ports using netstat -a
# netstat -a | more
List all tcp ports using netstat -at
# netstat -at
List all udp ports using netstat -au
# netstat -au
List only listening ports using netstat -l
# netstat -l
List only listening TCP Ports using netstat -lt
# netstat -lt
List only listening UDP Ports using netstat -lu
# netstat -lu
List only the listening UNIX Ports using netstat -lx
# netstat -lx
Show statistics for all ports using netstat -s
# netstat -s
Show statistics for TCP (or) UDP ports using netstat -st (or) -su
# netstat -st
# netstat -su
Display PID and program names in netstat output using netstat -p
netstat -pt
Don’t resolve host, port and user name in netstat output
netstat -an
netsat -a --numeric-ports
# netsat -a --numeric-hosts
# netsat -a --numeric-users
Print netstat information continuously
netstat