Yuri Slobodyanyuk Blog on Information Security 2024年09月12日
Solaris interfaces – create assign delete
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

文章介绍了在Solaris系统中配置网络接口的方法,包括接口的连接、IP地址分配、设置的保存及逻辑接口的创建与删除等内容。

💻首先提到在Solaris中处理接口与Linux有相似之处。需将接口(以以太网类型接口为例)连接到IP栈,这一过程被称为'plumbing',如使用#ifconfig e1000g2 plumb命令。

📝接着是分配IP并使其启动,如#ifconfig e1000g2 inet 192.2.2.3/24 up,同时提到如何使设置在重启后仍能保存,需创建一个特定的文本文件。

🎯然后讲述了如何查看接口的状态及其双工/速度参数,以及如何创建和删除逻辑接口,如#ifconfig e1000g1 addif 193.92.13.3/24创建逻辑接口。

Working with interfaces in Solaris is pretty much the same as in Linux - you've got ifconfig, netstat,route. It looks in output a bit different but if you're used to the *BSD way of things you'll find yourself at home. So the most basic thing follows - bring interface up, assign ipv4 address, save the change to survive reboot.
Plumb. First step sounds a bit strange - plumbing, but is actually very simple (no need to call for Mario) . You just plumb the interface (I talk about Ethernet-type interfaces) to the IP stack.- Interface before plumbing :

bash-3.00# ifconfig e1000g2

ifconfig: status: SIOCGLIFFLAGS: e1000g2: no such interface

Even an unplumbed interface can be seen with:

bash-3.00# dladm show-link

e1000g0         type: non-vlan  mtu: 1500       device: e1000g0  e1000g1         type: non-vlan  mtu: 1500       device: e1000g1  e1000g2         type: non-vlan  mtu: 1500       device: e1000g2

bash-3.00# ifconfig e1000g2 plumb
bash-3.00# ifconfig e1000g2

e1000g2: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4        inet 0.0.0.0 netmask 0        ether 00:E0:9F:67:98:fb

Assing IP and bring it up.
This one is well known.

bash-3.00# ifconfig e1000g2 inet 192.2.2.3/24 up
bash-3.00# ifconfig e1000g2

e1000g2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4   inet 192.2.2.3 netmask ffffff00 broadcast 192.2.2.255          ether 00:E0:9F:67:98:fb

Make this change permanent
So far so good. But if youo restart the machine now it will lose its interface settings. To save them you create a text file named /etc/hostname. In my case it will be /etc/hostname.e1000g2 , this alone would plumb interface on start, and now put the IP address inside it in the form '192.2.2.3/24' . That is it.

To see if interface is up or down as a device and its duplex/speed parameters:

bash-3.00# dladm show-dev

e1000g0         link: up        speed: 1000  Mbps       duplex: full  e1000g1         link: up        speed: 1000  Mbps       duplex: full  e1000g2         link: up        speed: 1000  Mbps       duplex: full

Create/delete logical interface In Cisco world you would call it assigning secondary ip to the interface.

bash-3.00# ifconfig e1000g1 addif 193.92.13.3/24
Created new logical interface e1000g1:1
bash-3.00# ifconfig e1000g1:1 up
bash-3.00# ifconfig e1000g1:1

e1000g1:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3   inet 193.92.13.3 netmask ffffff00 broadcast 193.92.13.255 

Remove logical interface:

bash-3.00# ifconfig e1000g1 removeif 193.92.13.3
bash-3.00# ifconfig e1000g1:1

ifconfig: status: SIOCGLIFFLAGS: e1000g1:1: no such interface

Follow me on https://www.linkedin.com/in/yurislobodyanyuk/ not to miss what I publish on Linkedin, Github, blog, and more.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Solaris 网络接口 IP地址 逻辑接口
相关文章