2 Subnets on 1 Lan

David Timms dtimms at iinet.net.au
Fri Jul 13 13:20:13 UTC 2007


Thom Paine wrote:
> Can I add the eth0:0 from the command line somehow or do I need to run
> system-config-network?
> 
> I don't have linux on this machine I'm working on today and need to do
> this remotely with ssh.
> 
> Thanks.
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:6E:1C:65:4B
           inet addr:192.168.32.68  Bcast:192.168.32.255  Mask:255.255.255.0
...
# ifconfig eth0:1 172.16.2.65/22
...
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:6E:1C:65:4B
           inet addr:192.168.32.68  Bcast:192.168.32.255  Mask:255.255.255.0

eth0:1    Link encap:Ethernet  HWaddr 00:0C:6E:1C:65:4B
           inet addr:172.16.2.65  Bcast:172.16.3.255  Mask:255.255.252.0
...
The route from pc to devices within the new net is automatically added.
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use 
Iface
192.168.32.0    *               255.255.255.0   U     0      0        0 eth0
172.16.0.0      *               255.255.252.0   U     0      0        0 eth0

But as you mention, if you want the new net address routed outside, you 
are going to need to set their mask/gw address correctly, and probably 
provide inbound firewall / routing.

DaveT.




More information about the fedora-list mailing list